Re: [f2py] What's the preferred way to select a compiler

Pearu Peterson <[email protected]> Wed, 22 Jun 2011 13:47:23 +0300
Newsgroups gmane.comp.python.f2py.user
Message-ID <[email protected]>
> Hi Pearu,
>
>
> Thanks for you answers. It clarified things.
>
> The reason my question popped up is that I'm trying to write a CMake
> macro add_f2py_module() that can automatically generated a Python module
> from a list of Fortran sources, using f2py under the hood.
>
> I could use the CMake variable CMAKE_Fortran_COMPILER, which contains
> the full path to the Fortran compiler used throughout the build, as
> argument to either --f90exec, --f77exec, or both. However, when I do
> that, I notice that f2py will still search for suitable compilers.
>
> I could also use the CMake variable CMAKE_Fortran_COMPILER_ID, which
> contains the "vendor", and use that as argument to --fcompiler. In that
> case, f2py does not search for a suitable compiler. However, then there
> is a (small) risk that f2py will find a different compiler than CMake
> did (e.g., when there's more than one GNU compiler installed).
>
> Or maybe I should use both --fcompiler and --f77exec/--f90exec, using
> the CMake variables mentioned above?
>
>
Yes, using both --fcompiler and --f77exec/--f90exec should be the safest
approach
as presumably CMAKE_Fortran_COMPILER and CMAKE_Fortran_COMPILER_ID
are consistent.

Pearu

_______________________________________________
f2py-users mailing list
f2py-users-Y4l6ocDipWCuvFJfX82//[email protected]
http://cens.ioc.ee/mailman/listinfo/f2py-users