Hi, I am trying to install py-scipy using MacPorts, but always end up with the errors listed below. I have the following gcc-ports installed: gcc41 lang/gcc41 4.1.2 The GNU compiler collection gcc42 lang/gcc42 4.2-20070307 The GNU compiler collection, prerelease BETA Any hints are appreciated. If I need to send more information, please let me know what to send. ---> Building py-scipy with target build Error: Target com.apple.build returned: shell command "cd "/opt/local/ var/db/dports/build/ _opt_local_var_db_dports_sources_rsync.rsync.darwinports.org_dpupdate_dp orts_python_py-scipy/work/scipy-0.5.2" && CCFLAGS="-I/opt/local/ include -L/opt/local/lib" /opt/local/bin/python2.4 setup.py build" returned error 1 Command output: running build_py copying build/src.darwin-8.9.1-i386-2.4/scipy/__config__.py -> build/ lib.darwin-8.9.1-i386-2.4/scipy running build_clib customize UnixCCompiler customize UnixCCompiler using build_clib customize NAGFCompiler customize AbsoftFCompiler customize IbmFCompiler Could not locate executable g77 Could not locate executable f77 Could not locate executable f95 customize GnuFCompiler customize Gnu95FCompiler Couldn't match compiler version for 'GNU Fortran (GCC) 4.2.0 20070307 (prerelease)\nCopyright (C) 2007 Free Software Foundation, Inc.\n \nGNU Fortran comes with NO WARRANTY, to the extent permitted by law. \nYou may redistribute copies of GNU Fortran\nunder the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING\n' customize G95FCompiler customize GnuFCompiler customize Gnu95FCompiler Couldn't match compiler version for 'GNU Fortran (GCC) 4.2.0 20070307 (prerelease)\nCopyright (C) 2007 Free Software Foundation, Inc.\n \nGNU Fortran comes with NO WARRANTY, to the extent permitted by law. \nYou may redistribute copies of GNU Fortran\nunder the terms of the GNU General Public License.\nFor more information about these matters, see the file named COPYING\n' customize NAGFCompiler customize NAGFCompiler using build_clib building 'dfftpack' library compiling Fortran sources Fortran f77 compiler: f95 -fixed -O4 -target=native Fortran f90 compiler: f95 -O4 -target=native Fortran fix compiler: f95 -fixed -O4 -target=native compile options: '-c' f95:f77: Lib/fftpack/dfftpack/dcosqb.f sh: line 1: f95: command not found sh: line 1: f95: command not found error: Command "f95 -fixed -O4 -target=native -c -c Lib/fftpack/ dfftpack/dcosqb.f -o build/temp.darwin-8.9.1-i386-2.4/Lib/fftpack/ dfftpack/dcosqb.o" failed with exit status 127 Error: Status 1 encountered during processing. Greetings, Jochen -- Einigkeit und Recht und Freiheit http://www.Jochen- Kuepper.de Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D Sex, drugs and rock-n-roll
On 14.04.2007, at 09:39, Jochen Küpper wrote:
I am trying to install py-scipy using MacPorts, but always end up with the errors listed below.
I have the following gcc-ports installed: gcc41 lang/gcc41 4.1.2 The GNU compiler collection gcc42 lang/gcc42 4.2-20070307 The GNU compiler collection, prerelease BETA
Ok, I have looked around a bit more and realized, that the py-numpy Portfiel uses different compilers for PPC and Intel: variant darwin powerpc { depends_build-append port:gcc41 post-patch { reinplace "s:MACPORTS_FORTRAN:gfortran-dp-4.1:g" $ {worksrcpath}/numpy/distutils/fcompiler/gnu.py reinplace "s:MACPORTS_PREFIX:${prefix}:g" $ {worksrcpath}/numpy/distutils/system_info.py reinplace "s:MACPORTS_GCCPORT:gcc41:g" $ {worksrcpath}/numpy/distutils/system_info.py } } variant darwin i386 { depends_build-append port:gcc41 post-patch { reinplace "s:MACPORTS_FORTRAN:gfortran-dp-4.2:g" $ {worksrcpath}/numpy/distutils/fcompiler/gnu.py reinplace "s:MACPORTS_PREFIX:${prefix}:g" $ {worksrcpath}/numpy/distutils/system_info.py reinplace "s:MACPORTS_GCCPORT:gcc42:g" $ {worksrcpath}/numpy/distutils/system_info.py } } Started wondering whay that is (why is it?), but also pragmatically decided to set i386 to gcc41 as well... This allowed me to build py-numpy and py-scipy, but using scipy does not work, i.e. when trying to "from scipy import *" the symbols, python crashes: Running it in gdb gives the following backtrace: #0 0x900dfb26 in strtod_l () #1 0x90030a66 in strtod () #2 0x002ac1b6 in PyOS_ascii_strtod (nptr=0xbfff7460 "1.", '0' <repeats 15 times>, "1e-05", endptr=0x0) at Python/pystrtod.c:159 #3 0x002ac461 in PyOS_ascii_atof (nptr=0xbfff7460 "1.", '0' <repeats 15 times>, "1e-05") at Python/pystrtod.c:257 #4 0x002a04c3 in r_object (p=0xbfffbb30) at Python/marshal.c:484 #5 0x002a077e in r_object (p=0xbfffbb30) at Python/marshal.c:581 #6 0x002a0539 in r_object (p=0xbfffbb30) at Python/marshal.c:651 #7 0x002a0d9d in PyMarshal_ReadLastObjectFromFile (fp=0xa000be50) at Python/marshal.c:804 #8 0x0029d3ff in load_source_module (name=0xbfffc4d7 "scipy.linalg.iterative", pathname=0xbfffc037 "/opt/local/lib/ python2.4/site-packages/scipy/linalg/iterative.py", fp=0xa000bdf8) at Python/import.c:723 #9 0x0029e22f in import_submodule (mod=0x1371910, subname=0xbfffc4e4 "iterative", fullname=0xbfffc4d7 "scipy.linalg.iterative") at Python/ import.c:2266 #10 0x0029e461 in load_next (mod=0x1371910, altmod=0x2e0160, p_name=0xbfffc4e4, buf=0xbfffc4d7 "scipy.linalg.iterative", p_buflen=0xbfffc8d8) at Python/import.c:2086 #11 0x0029e915 in PyImport_ImportModuleEx (name=0x143d69c "iterative", globals=0x595d0, locals=0x595d0, fromlist=0x1366bd0) at Python/import.c:1921 #12 0x00271adb in builtin___import__ (self=0x0, args=0x50ab0) at Python/bltinmodule.c:45 #13 0x0020e213 in PyObject_Call (func=0xf260, arg=0x50ab0, kw=0x0) at Objects/abstract.c:1795 #14 0x00279a86 in PyEval_CallObjectWithKeywords (func=0xf260, arg=0x50ab0, kw=0x0) at Python/ceval.c:3430 #15 0x0027c63b in PyEval_EvalFrame (f=0x635370) at Python/ceval.c:2020 #16 0x00280c62 in PyEval_EvalCodeEx (co=0x143b6a0, globals=0x595d0, locals=0x595d0, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2736 #17 0x00280ea2 in PyEval_EvalCode (co=0x143b6a0, globals=0x595d0, locals=0x595d0) at Python/ceval.c:484 #18 0x0029ce90 in PyImport_ExecCodeModuleEx (name=0xbfffdae7 "scipy.linalg", co=0x143b6a0, pathname=0xbfffcd4f "/opt/local/lib/ python2.4/site-packages/scipy/linalg/__init__.pyc") at Python/ import.c:631 #19 0x0029d246 in load_source_module (name=0xbfffdae7 "scipy.linalg", pathname=0xbfffcd4f "/opt/local/lib/python2.4/site-packages/scipy/ linalg/__init__.pyc", fp=0xa000bda0) at Python/import.c:909 #20 0x0029dd53 in load_package (name=0xbfffdae7 "scipy.linalg", pathname=0x1374a20 "\003") at Python/import.c:965 #21 0x0029e22f in import_submodule (mod=0x57290, subname=0x57634 "linalg", fullname=0xbfffdae7 "scipy.linalg") at Python/import.c:2266 #22 0x0029e7c2 in ensure_fromlist (mod=0x57290, fromlist=0x585d0, buf=0xbfffdae7 "scipy.linalg", buflen=5, recursive=1) at Python/ import.c:2177 #23 0x0029e726 in ensure_fromlist (mod=0x57290, fromlist=0x2b490, buf=0xbfffdae7 "scipy.linalg", buflen=5, recursive=0) at Python/ import.c:2156 #24 0x0029ec09 in PyImport_ImportModuleEx (name=0x572b4 "scipy", globals=0x20a50, locals=0x20a50, fromlist=0x2b490) at Python/import.c: 1948 #25 0x00271adb in builtin___import__ (self=0x0, args=0x1fb10) at Python/bltinmodule.c:45 #26 0x0020e213 in PyObject_Call (func=0xf260, arg=0x1fb10, kw=0x0) at Objects/abstract.c:1795 #27 0x00279a86 in PyEval_CallObjectWithKeywords (func=0xf260, arg=0x1fb10, kw=0x0) at Python/ceval.c:3430 #28 0x0027c63b in PyEval_EvalFrame (f=0x608c30) at Python/ceval.c:2020 #29 0x00280c62 in PyEval_EvalCodeEx (co=0x4ede0, globals=0x20a50, locals=0x20a50, args=0x0, argcount=0, kws=0x0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:2736 #30 0x00280ea2 in PyEval_EvalCode (co=0x4ede0, globals=0x20a50, locals=0x20a50) at Python/ceval.c:484 #31 0x002a7736 in PyRun_InteractiveOneFlags (fp=0xa0001be0, filename=0x2d1648 "<stdin>", flags=0xbfffe508) at Python/pythonrun.c: 1265 #32 0x002a7851 in PyRun_InteractiveLoopFlags (fp=0xa0001be0, filename=0x2d1648 "<stdin>", flags=0xbfffe508) at Python/pythonrun.c:695 #33 0x002a8590 in PyRun_AnyFileExFlags (fp=0xa0001be0, filename=0x2d1648 "<stdin>", closeit=0, flags=0xbfffe508) at Python/ pythonrun.c:658 #34 0x002b18b8 in Py_Main (argc=0, argv=0xbfffe58c) at Modules/main.c: 493 #35 0x000018ee in _start () #36 0x00001815 in start () Why do we need gcc42 for py-numpy? I'll now try to reinstall gcc42 and py-numpy and see where I get this time;/ Greetings, Jochen -- Einigkeit und Recht und Freiheit http://www.Jochen- Kuepper.de Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D Sex, drugs and rock-n-roll
On 14.04.2007, at 09:39, Jochen Küpper wrote:
I am trying to install py-scipy using MacPorts, but always end up with the errors listed below.
I have the following gcc-ports installed: gcc41 lang/gcc41 4.1.2 The GNU compiler collection gcc42 lang/gcc42 4.2-20070307 The GNU compiler collection, prerelease BETA
Ok, the real problem seems to be an incompatibility between numpy and gcc42: In numpy/distutils/fcompiler/gnu.py a string match is done against the output of `gfortran --version`: class GnuF95Compiler(FCompiler): compiler_type = 'gnu' version_match = simple_version_match(start=r'GNU Fortran 95') but `gfortran-dp-4.2 --version` gives "GNU Fortran (GCC) 4.2.0 20070307 (prerelease)" (thus: no "95"!) Using the following patch to numpy fixes the problem for me and I can successfully compile and use py-scipy on Intel then. However, the real fix might be to correct the gfortran version output. --- /opt/local/lib/python2.4/site-packages/numpy/distutils/fcompiler/ gnu.py~ 2007-04-15 14:00:26.000000000 +0200 +++ /opt/local/lib/python2.4/site-packages/numpy/distutils/fcompiler/ gnu.py 2007-04-15 14:16:32.000000000 +0200 @@ -13,7 +13,7 @@ class GnuFCompiler(FCompiler): compiler_type = 'gnu' - version_match = simple_version_match(start=r'GNU Fortran (?!95)') + version_match = simple_version_match(start=r'GNU Fortran') # 'g77 --version' results # SunOS: GNU Fortran (GCC 3.2) 3.2 20020814 (release) @@ -240,7 +240,7 @@ class Gnu95FCompiler(GnuFCompiler): compiler_type = 'gnu95' - version_match = simple_version_match(start='GNU Fortran 95') + version_match = simple_version_match(start='GNU Fortran') # 'gfortran --version' results: # Debian: GNU Fortran 95 (GCC 4.0.3 20051023 (prerelease) (Debian 4.0.2-3)) Greetings, Jochen -- Fritz-Haber-Institut der MPG -- Department of Molecular Physics Faradayweg 4-6 (C1.03) D-14195 Berlin, Germany phone: +49-30-84135686 fax: +49-30-84135892
Hi Jochen, There are two bugs filed on py-scipy. Could you add the problem you had and the workaround to the ticket that describes a similar problem? It will help the maintainer to resolve it. Thanks. http://trac.macosforge.org/projects/macports/ticket/11048 http://trac.macosforge.org/projects/macports/ticket/11564 Mark Jochen Küpper <jochen@fhi-berlin.mpg.de> on Sunday, April 15, 2007 at 6:29 AM -0800 wrote:
I am trying to install py-scipy using MacPorts, but always end up with the errors listed below.
I have the following gcc-ports installed: gcc41 lang/gcc41 4.1.2 The GNU compiler collection gcc42 lang/gcc42 4.2-20070307 The GNU compiler collection, prerelease BETA
Ok, the real problem seems to be an incompatibility between numpy and gcc42:
In numpy/distutils/fcompiler/gnu.py a string match is done against the output of `gfortran --version`:
class GnuF95Compiler(FCompiler): compiler_type = 'gnu' version_match = simple_version_match(start=r'GNU Fortran 95')
but `gfortran-dp-4.2 --version` gives "GNU Fortran (GCC) 4.2.0 20070307 (prerelease)" (thus: no "95"!)
Using the following patch to numpy fixes the problem for me and I can successfully compile and use py-scipy on Intel then. However, the real fix might be to correct the gfortran version output.
--- /opt/local/lib/python2.4/site-packages/numpy/distutils/fcompiler/ gnu.py~ 2007-04-15 14:00:26.000000000 +0200 +++ /opt/local/lib/python2.4/site-packages/numpy/distutils/fcompiler/ gnu.py 2007-04-15 14:16:32.000000000 +0200 @@ -13,7 +13,7 @@ class GnuFCompiler(FCompiler): compiler_type = 'gnu' - version_match = simple_version_match(start=r'GNU Fortran (?!95)') + version_match = simple_version_match(start=r'GNU Fortran') # 'g77 --version' results # SunOS: GNU Fortran (GCC 3.2) 3.2 20020814 (release) @@ -240,7 +240,7 @@ class Gnu95FCompiler(GnuFCompiler): compiler_type = 'gnu95' - version_match = simple_version_match(start='GNU Fortran 95') + version_match = simple_version_match(start='GNU Fortran') # 'gfortran --version' results: # Debian: GNU Fortran 95 (GCC 4.0.3 20051023 (prerelease) (Debian 4.0.2-3))
participants (2)
-
Jochen Küpper
-
markd@macports.org