[Numpy-discussion] numpy build system questions for use in another project (fwrap)

Kurt Smith kwmsmith at gmail.com
Sun Apr 11 21:23:15 EDT 2010


On Sun, Apr 11, 2010 at 12:54 PM, Dag Sverre Seljebotn
<dagss at student.matnat.uio.no> wrote:
> 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
> document:
>
>  a) Use the same compiler for both the Fortran project and the fwrap
> wrapper.
>  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.

Kurt



More information about the NumPy-Discussion mailing list