[Numpy-discussion] Help using numpy.distutils.fcompiler for my GSoC project
Wed Jun 24 09:05:45 CDT 2009
Kurt Smith wrote:
> On Tue, Jun 23, 2009 at 10:17 PM, David Cournapeau<email@example.com> wrote:
>> If possible, you should not build executables, it is not portable.
>> Compiling and linking is Ok, running is not. For a tool which is aimed
>> a general use, I think this is important. Knowing the exact tests
>> needed by the OP would help me to give more detailed advices.
> Hmmm. Thanks for the input.
> Ironically, the reason we're building the executable is for
> portability of the interoperable types. By running the genconfig
> program it guarantees that we get the correct C type <-> Fortran type
> correspondence set up. This is especially desirable given that
> compiler flags can change the size of some datatypes, which would be
> captured correctly by the genconfig program's output -- if everything
> goes as planned ;-) We'd like to make it so that any fortran
> procedure can be wrapped without having to modify the kind type
> parameters of the arguments.
Can't you do this without running executables ? What is not portable is
to run executables (because they cannot always run - for example cross
compilation on windows). Windows causes quite a headache with recent
version of pythons w.r.t running executables if you need to link against
the C runtime.
> This would need to be run before compiling the extension module. Is
> it possible to make this portable?
No. But most of the time, you can test things without running anything.
For example, all the type sizeofs are detected by compilation-only with
numpy, using some C hackery. What are the exact tests you need to do ?
More information about the Numpy-discussion