Ejemplo n.º 1
0
        Extension(modulename, [pyx_src] + other_sources,
                  language=language,
                  **deepcopy(ext_kwargs)))  # deepcopy lists

# Do our own build and install time dependency checking. setup.py gets called in
# many different ways, and may be called just to collect information (egg_info).
# We need to set up tripwires to raise errors when actually doing things, like
# building, rather than unconditionally in the setup.py import or exec
# We may make tripwire versions of build_ext, build_py, install
need_cython = True
try:
    from nisext.sexts import get_comrec_build
except ImportError:  # No nibabel
    msg = ('Need nisext package from nibabel installation'
           ' - please install nibabel first')
    pybuilder = derror_maker(du_build_py, msg)
    extbuilder = derror_maker(du_build_ext, msg)
else:  # We have nibabel
    pybuilder = get_comrec_build('dipy')
    # Cython is a dependency for building extensions, iff we don't have stamped
    # up pyx and c files.
    build_ext, need_cython = cyproc_exts(EXTS, info.CYTHON_MIN_VERSION,
                                         'pyx-stamps')
    # Add openmp flags if they work
    simple_test_c = """int main(int argc, char** argv) { return(0); }"""
    omp_test_c = """#include <omp.h>
    int main(int argc, char** argv) { return(0); }"""
    extbuilder = add_flag_checking(
        build_ext,
        [[['/arch:SSE2'], [], simple_test_c, 'USING_VC_SSE2'],
         [['-msse2', '-mfpmath=sse'], [], simple_test_c, 'USING_GCC_SSE2'],
Ejemplo n.º 2
0
    EXTS.append(Extension(modulename, [pyx_src] + other_sources,
                          language=language,
                          **deepcopy(ext_kwargs)))  # deepcopy lists


# Do our own build and install time dependency checking. setup.py gets called in
# many different ways, and may be called just to collect information (egg_info).
# We need to set up tripwires to raise errors when actually doing things, like
# building, rather than unconditionally in the setup.py import or exec
# We may make tripwire versions of build_ext, build_py, install
try:
    from nisext.sexts import package_check, get_comrec_build
except ImportError: # No nibabel
    msg = ('Need nisext package from nibabel installation'
           ' - please install nibabel first')
    pybuilder = derror_maker(build_py.build_py, msg)
    extbuilder = derror_maker(build_ext.build_ext, msg)
    def package_check(*args, **kwargs):
        raise RuntimeError(msg + " or try 'python setup_egg.py install'")
else: # We have nibabel
    pybuilder = get_comrec_build('dipy')
    # Cython is a dependency for building extensions, iff we don't have stamped
    # up pyx and c files.
    build_ext = cyproc_exts(EXTS, CYTHON_MIN_VERSION, 'pyx-stamps')
    # Add openmp flags if they work
    simple_test_c = """int main(int argc, char** argv) { return(0); }"""
    omp_test_c = """#include <omp.h>
    int main(int argc, char** argv) { return(0); }"""
    extbuilder = add_flag_checking(
        build_ext, [[['/arch:SSE2'], [], simple_test_c, 'USING_VC_SSE2'],
            [['-msse2', '-mfpmath=sse'], [], simple_test_c, 'USING_GCC_SSE2'],
Ejemplo n.º 3
0
                          language=language,
                          **deepcopy(ext_kwargs)))  # deepcopy lists


# Do our own build and install time dependency checking. setup.py gets called in
# many different ways, and may be called just to collect information (egg_info).
# We need to set up tripwires to raise errors when actually doing things, like
# building, rather than unconditionally in the setup.py import or exec
# We may make tripwire versions of build_ext, build_py, install
need_cython = True
try:
    from nisext.sexts import get_comrec_build
except ImportError: # No nibabel
    msg = ('Need nisext package from nibabel installation'
           ' - please install nibabel first')
    pybuilder = derror_maker(du_build_py, msg)
    extbuilder = derror_maker(du_build_ext, msg)
else: # We have nibabel
    pybuilder = get_comrec_build('dipy')
    # Cython is a dependency for building extensions, iff we don't have stamped
    # up pyx and c files.
    build_ext, need_cython = cyproc_exts(EXTS,
                                         info.CYTHON_MIN_VERSION,
                                         'pyx-stamps')
    # Add openmp flags if they work
    simple_test_c = """int main(int argc, char** argv) { return(0); }"""
    omp_test_c = """#include <omp.h>
    int main(int argc, char** argv) { return(0); }"""
    extbuilder = add_flag_checking(
        build_ext, [[['/arch:SSE2'], [], simple_test_c, 'USING_VC_SSE2'],
            [['-msse2', '-mfpmath=sse'], [], simple_test_c, 'USING_GCC_SSE2'],