Beispiel #1
0
def cpp_evaluator(expr, ns):
    compiler, extra_compile_args = get_compiler_and_args()
    with std_silent():
        return weave.inline('return_val = %s;' % expr, ns.keys(), local_dict=ns,
                            support_code=CPPCodeGenerator.universal_support_code,
                            compiler=compiler,
                            extra_compile_args=extra_compile_args,
                            extra_link_args=prefs['codegen.cpp.extra_link_args'],
                            library_dirs=prefs['codegen.cpp.library_dirs'],
                            include_dirs=prefs['codegen.cpp.include_dirs']
                            )
Beispiel #2
0
def cpp_evaluator(expr, ns):
    if weave is not None:
        compiler, extra_compile_args = get_compiler_and_args()
        with std_silent():
            return weave.inline('return_val = %s;' % expr, ns.keys(), local_dict=ns,
                                compiler=compiler,
                                extra_compile_args=extra_compile_args,
                                include_dirs=prefs['codegen.cpp.include_dirs']
                                )
    else:
        raise nose.SkipTest('No weave support.')
Beispiel #3
0
def cpp_evaluator(expr, ns):
    if weave is not None:
        compiler, extra_compile_args = get_compiler_and_args()
        with std_silent():
            return weave.inline('return_val = %s;' % expr,
                                ns.keys(),
                                local_dict=ns,
                                compiler=compiler,
                                extra_compile_args=extra_compile_args,
                                include_dirs=prefs['codegen.cpp.include_dirs'])
    else:
        raise nose.SkipTest('No weave support.')
Beispiel #4
0
def cpp_evaluator(expr, ns):
    compiler, extra_compile_args = get_compiler_and_args()
    library_dirs = prefs['codegen.cpp.library_dirs']
    extra_link_args = prefs['codegen.cpp.extra_link_args']
    update_for_cross_compilation(library_dirs, extra_compile_args,
                                 extra_link_args)
    with std_silent():
        return weave.inline(
            'return_val = %s;' % expr,
            list(ns),
            local_dict=ns,
            support_code=CPPCodeGenerator.universal_support_code,
            compiler=compiler,
            extra_compile_args=extra_compile_args,
            extra_link_args=extra_link_args,
            library_dirs=library_dirs,
            include_dirs=prefs['codegen.cpp.include_dirs'])
Beispiel #5
0
def cpp_evaluator(expr, ns):
    compiler, extra_compile_args = get_compiler_and_args()
    library_dirs = prefs['codegen.cpp.library_dirs']
    extra_link_args = prefs['codegen.cpp.extra_link_args']
    if (platform.system() == 'Linux' and
                platform.architecture()[0] == '32bit' and
                platform.machine() == 'x86_64'):
        # TODO: This should be refactored, it is repeated in several places
        library_dirs += ['/lib32', '/usr/lib32']
        extra_compile_args += ['-m32']
        extra_link_args += ['-m32']
    with std_silent():
        return weave.inline('return_val = %s;' % expr, ns.keys(), local_dict=ns,
                            support_code=CPPCodeGenerator.universal_support_code,
                            compiler=compiler,
                            extra_compile_args=extra_compile_args,
                            extra_link_args=extra_link_args,
                            library_dirs=library_dirs,
                            include_dirs=prefs['codegen.cpp.include_dirs']
                            )