[Numpy-discussion] numpy build system questions for use in another project (fwrap)
Sun Apr 11 20:23:15 CDT 2010
On Sun, Apr 11, 2010 at 12:54 PM, Dag Sverre Seljebotn
> Kurt Smith wrote:
>> So you could do something like the following to get the compiler flags:
>> $ fwrap --get-cflags --fcompiler=intelem
>> And it would spit out the flags necessary to include when compiling
>> the fortran source files.
> Hmm. Would --get-cflags ever return anything but (the equivalent of) -fPIC?
> For C source which includes "Python.h" there are more flags
> (-fno-strict-aliasing for instance) because Python.h requires it.
> BUT, note that this is only for "Python.h"-including C source. For just
> linking in C source without a Python.h dependency, the compiler flags
> don't matter at all, just as long as one uses -fPIC (IIUC).
> Fortran code is also in this latter category, so I wonder whether what
> you mention above is really necesarry. To me it seems like one can just
> a) Use the same compiler for both the Fortran project and the fwrap
> b) Use -fPIC.
> c) Feed the build system of the fwrap wrapper the path to the mod files.
Yes, (b) is a possibility (if indeed -fPIC (or it's equivalent) is all
you need -- are you sure this is the case?), but if it's easy for
fwrap to query numpy.distutils.fcompiler for the compiler and platform
specific flags, then why not? IOW, the work has already been done in
the fcompiler package, and it should be simple to query those modules.
One fewer barrier for the user, as I see it.
More information about the NumPy-Discussion