fortran compiler for f2py

Mark Brethen mark.brethen at gmail.com
Wed Aug 13 10:44:27 PDT 2014


I'm trying to compile a fortran file in  python using f2py however its not finding the gcc 4.8 fortran compiler 'gfortran-mp-4.8' in /opt/local/bin. Here's the ipython console output:

build_src: building npy-pkg config files
running build_ext
customize UnixCCompiler
customize UnixCCompiler using build_ext
customize Gnu95FCompiler
Could not locate executable gfortran
Could not locate executable f95
customize NAGFCompiler
customize AbsoftFCompiler
Could not locate executable f90
Could not locate executable f77
customize IBMFCompiler
Could not locate executable xlf90
Could not locate executable xlf
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize GnuFCompiler
Could not locate executable g77
customize PGroupFCompiler
Could not locate executable pgfortran
don't know how to compile Fortran code on platform 'posix'
warning: build_ext: f77_compiler=None is not available.

building 'ts13725lib' extension
error: extension 'ts13725lib' has Fortran sources but no Fortran compiler found

According to this:

brethen-mbp:files marbre$ port info gcc_select
gcc_select @0.1_8 (sysutils)

Description:          gcc_select installs files that allow 'port select' to switch the default version of gcc. It
                      symlinks the standard compiler executables in the MacPorts prefix to the selected version.
Homepage:             http://www.macports.org/

Platforms:            darwin
License:              BSD
Maintainers:          mww at macports.org

It sounds like I need to run gcc_select to link the standard executables. How is this used?


Mark






More information about the macports-users mailing list