python portfile issue with running setup.py twice
Frank Schima
macsforever2000 at macports.org
Tue Sep 28 15:53:46 PDT 2010
On Sep 28, 2010, at 4:17 PM, Ryan Schmidt wrote:
> 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
I'm still not clear how this will run both setup.py commands that are needed. If i remove the build block and just add the following as you say (note that i needed gnu95 not g95):
build.args-append --fcompiler=gnu95
build.env-append F90=${prefix}/bin/gfortran-mp-4.4
It builds the fortran, but I get the following linking error:
Undefined symbols:
"_PyErr_Occurred", referenced from:
_f2py_rout__solvercore_kin_solve_3 in _solvercoremodule.o
_f2py_rout__solvercore_kin_solve_2 in _solvercoremodule.o
_f2py_rout__solvercore_kin_solve_1 in _solvercoremodule.o
_f2py_rout__solvercore_sp_init_2 in _solvercoremodule.o
_f2py_rout__solvercore_sp_init_1 in _solvercoremodule.o
_f2py_rout__solvercore_sp_solve_2 in _solvercoremodule.o
_f2py_rout__solvercore_sp_solve_1 in _solvercoremodule.o
and so on for many more lines and objects.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-dev/attachments/20100928/19091111/attachment-0001.html>
More information about the macports-dev
mailing list