python portfile issue with running setup.py twice

Ryan Schmidt ryandesign at macports.org
Tue Sep 28 15:17:55 PDT 2010


On Sep 28, 2010, at 16:59, Frank Schima wrote:
> On Sep 28, 2010, at 3:01 PM, Ryan Schmidt wrote:
>> Why don't you show us what errors you're getting when using the python portgroups as written.
> 
> running build_ext
> customize UnixCCompiler
> customize UnixCCompiler using build_ext
> customize NAGFCompiler
> Could not locate executable f95
> 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 Gnu95FCompiler
> Could not locate executable gfortran
> don't know how to compile Fortran code on platform 'posix'
> warning: build_ext: f77_compiler=None is not available.
> building 'usadel1._solvercore' extension
> error: extension 'usadel1._solvercore' has Fortran sources but no Fortran compiler found
> shell command " cd "/opt/local/var/macports/build/_opt_mports_trunk_dports_python_py26-usadel/work/usadel1-0.2.3.2" && /opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6 setup.py --no-user-cfg build " returned error 1
> Error: Target org.macports.build returned: shell command failed
> Warning: the following items did not execute (for py26-usadel1): org.macports.activate org.macports.build org.macports.destroot org.macports.install
> 
> The first setup.py command is supposed to select the fortran compiler. But I cannot get it to recognize the gcc44 fortran compiler. This is my attempt after fixing the portfile:
> 
> build {
>     system "cd ${worksrcpath}; ${python.bin} ${worksrcpath}/setup.py config_fc --fcompiler=gfortran-mp-4.4 --noarch build"
>     system "cd ${worksrcpath}; ${python.bin} ${worksrcpath}/setup.py install --skip-build"
> }

You most likely do not want to run "setup.py install" in the build phase, as already discussed. Let that happen in the destroot phase via the portgroup.

Sounds like you don't need to override the build phase at all; you just want to add some build.args.


build.args-append --fcompiler=something


> it returns this error:
> 
> running build_ext
> customize UnixCCompiler
> customize UnixCCompiler using build_ext
> don't know how to compile Fortran code on platform 'posix' with 'gfortran-mp-4.4' compiler. Supported compilers are: intelvem,none,absoft,compaq,gnu,vast,sun,nag,lahey,intelem,gnu95,intelv,g95,intele,pg,intel,mips,hpux,intelev,ibm)
> warning: build_ext: f77_compiler=gfortran-mp-4.4 is not available.
> building 'usadel1._solvercore' extension
> error: extension 'usadel1._solvercore' has Fortran sources but no Fortran compiler found

As it says above, and again in their documentation (in doc/src/installation.srt), they have a list of valid fortran compilers, and of course "gfortran-mp-4.4" isn't in that list.


I was able to get it work by using --fcompiler=gnu95 and specifying the path to the fortran compiler in the F90 environment variable, so try:


build.args-append --fcompiler=g95
build.env-append F90=${prefix}/bin/gfortran-mp-4.4





More information about the macports-dev mailing list