[Numpy-discussion] distutils -- compiling extension twice, two sets of compiler settings

Sebastian Haase seb.haase@gmail....
Tue Jul 28 07:15:18 CDT 2009


Hi,

maybe someone here could help me by using distutils:
my problem is that I have some C++ files that I need to get compiled twice,
first to make a "singleFloat"-module using  gcc -DUSE_DOUBLE=0
and then
to make the "doubleFloat"-module using  gcc -DUSE_DOUBLE=1.

Apparently distutils recognises (like "make") that the object files
are already there and skips the gcc for the second run.
My setup.py so far is something like this:
ext_ccg_s = Extension('_CCG_smodule', [
        'Priithon_25_C/ccg/CCG_caller.cpp',
        'Priithon_25_C/ccg/ccg_funct.cpp',
        'Priithon_25_C/ccg/ccg.cpp',
        'Priithon_25_C/ccg/CCG_s_wrap.cxx',
        ],
                      define_macros=[('USE_DOUBLE', '0'),],
)
ext_ccg_d = Extension('_CCG_dmodule', [
        'Priithon_25_C/ccg/CCG_caller.cpp',
        'Priithon_25_C/ccg/ccg_funct.cpp',
        'Priithon_25_C/ccg/ccg.cpp',
        'Priithon_25_C/ccg/CCG_d_wrap.cxx',
        ],
                      define_macros=[('USE_DOUBLE', '1'),],
)
setup(...
      ext_package='Priithon_bin',
      ext_modules=[ext_ccg_s, ext_ccg_d],
     )

Thanks for any help,

--
Sebastian Haase


More information about the NumPy-Discussion mailing list