def make_declare(loop_orders, dtypes, sub):
    """
    Produce code to declare all necessary variables.

    """
    decl = ''
    for i, (loop_order, dtype) in enumerate(zip(loop_orders, dtypes)):
        var = sub['lv%i' % i]
        decl += """
        %(dtype)s* %(var)s_iter;
        """ % locals()
        for j, value in enumerate(loop_order):
            if value != 'x':
                decl += (
                    """
                npy_intp %(var)s_n%(value)i;
                ssize_t %(var)s_stride%(value)i;
                int %(var)s_jump%(value)i_%(j)i;
                """
                     % locals())
            else:
                decl += (
                    """
                int %(var)s_jump%(value)s_%(j)i;
                """
                     % locals())
    return decl
