Opened 12 years ago

Closed 10 years ago

#35141 closed defect (worksforme)

py*-scipy + gcc45: ___ieee_divdc3 symbol not found

Reported by: andre.dos.anjos@… Owned by: seanfarley (Sean Farley)
Priority: Normal Milestone:
Component: ports Version: 2.1.1
Keywords: Cc: petrrr, wimmer@…, calvin.giles@…, mf2k (Frank Schima)
Port: py-scipy

Description (last modified by ryandesign (Ryan Carsten Schmidt))

This port, at its present state, give me problems on my OSX (10.7) installation. I have updated all the ports and re-installed py26-scipy with the gcc45 variant (default), gcc46 and gcc47 variants. All these variants do not survive the following simple test:

/opt/local/bin/python2.6 -c 'import scipy.signal'

The error: ___ieee_divdc3 symbol not found at runtime.

Some mail message around the net mentions that (at least) gcc45 does not define the symbol ___ieee_divdc3, required by scipy somehow. It starts with gcc46. See message (from March/2012):

http://sourceforge.net/mailarchive/message.php?msg_id=29039341

But, I should add that the only variant I tried that worked flawlessly as gcc44. Any experience with this?

Attachments (1)

build.log (817.0 KB) - added by wimmer@… 11 years ago.
Log of build of py27-scipy on OSX 10.8 showing the use of clang for linking

Download all attachments as: .zip

Change History (25)

comment:1 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ram@… ryandesign@… removed
Description: modified (diff)
Owner: changed from macports-tickets@… to ram@…

comment:2 Changed 12 years ago by skymoo (Adam Mercer)

I can't reproduce this, on Lion, with the gcc45 variant of py27-scipy:

$ port installed py27-scipy
The following ports are currently installed:
  py27-scipy @0.10.1_2+gcc45 (active)
$ /opt/local/bin/python2.7 -c 'import scipy.signal'
$

comment:3 Changed 12 years ago by andre.dos.anjos@…

Humm... Does it still work with the python26 variant?

comment:4 Changed 12 years ago by skymoo (Adam Mercer)

I didn't have python26 installed, installing this gives:

$ port installed py26-scipy
The following ports are currently installed:
  py26-scipy @0.10.1_2+gcc45 (active)
$ /opt/local/bin/python2.6 -c 'import scipy.signal'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/__init__.py", line 198, in <module>
    from spline import *
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/spline.so, 2): Symbol not found: ___ieee_divdc3
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/spline.so
  Expected in: flat namespace
 in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/spline.so
$

Which is very odd, not sure why the python27 version would work whereas python26 doesn't?

comment:5 Changed 12 years ago by andre.dos.anjos@…

I'm not sure on the reason. The only message I could find on the net I linked to this bug. Maybe it is the case to forward this to the scipy mailing list or bug tracker?

The facts are:

  1. This function is available with gcc453 and above
  2. The scipy ports with gcc45, 46 and 47 go wrong
  3. If I compile scipy with gcc44 it works

IMO, this relates to the upgrade to gcc45 and incompatibilities between the builds of python and scipy. Maybe rebuilding python26 with gcc45 would fix this? Have you tried it?

comment:6 Changed 11 years ago by skymoo (Adam Mercer)

Owner: ram@… deleted

comment:7 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to macports-tickets@…

comment:8 Changed 11 years ago by petrrr

Cc: Peter.Danecek@… added

Cc Me!

comment:9 in reply to:  4 ; Changed 11 years ago by petrrr

Which is very odd, not sure why the python27 version would work whereas python26 doesn't?

This issue is in deed specific to python26. I get the same behaviour on two different machines running very differ MacOSX versions (10.5.8 and 10.8.4).

This is from Mountain Lion ...

12.4.0 Darwin Kernel Version 12.4.0: Wed May  1 17:57:12 PDT 2013; root:xnu-2050.24.15~1/RELEASE_X86_64 x86_64

Xcode 4.6.2
Build version 4H1003
radegast: $ port installed "py2?-scipy"
The following ports are currently installed:
  py26-scipy @0.12.0_2+gcc47 (active)
  py27-scipy @0.12.0_2+gcc47 (active)

radegast: $ python2.6
Python 2.6.8 (unknown, Nov 17 2012, 21:23:35) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.signal
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/__init__.py", line 232, in <module>
    from .spline import *
ImportError: dlopen(/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/spline.so, 2): Symbol not found: ___ieee_divdc3
  Referenced from: /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/spline.so
  Expected in: flat namespace
 in /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/scipy/signal/spline.so
>>> exit()

radegast: $ python2.7
Python 2.7.5 (default, May 19 2013, 13:26:46) 
[GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy.signal
>>> exit()
radegast: $ 

comment:10 in reply to:  9 ; Changed 11 years ago by wimmer@…

Let me note that I get the same problem for python 2.7 on OSX 10.8 when I install from source using "port install -s py27-scipy", instead of installing the prebuilt version. I looked into the problem, and figured out that the problem is due to the fact that scipy compiles all code with the macports gcc/gfortran, but when building the shared library object spline.so links with clang - hence the symbol ___ieee_divdc3 which is specific to gcc is not found. In fact, clang is used for all modules based on C-code (not Fortran code). You can see this in the attached build.log.

I have no idea what why that does not happen in the prebuilt package. Presumably there is something different in the build environment.

It's always tricky how python chooses the compiler it uses to compile stuff (usually, it would like to use the same compiler as it is compiled with itself, which is clang). With scipy/numpy it's even more tricky, and I didn't figure out yet how to change the compiler for the linkage ... (setting LDSHARED breaks stuff in the Fortran compilation)

Changed 11 years ago by wimmer@…

Attachment: build.log added

Log of build of py27-scipy on OSX 10.8 showing the use of clang for linking

comment:11 Changed 11 years ago by wimmer@…

Oh, just for reference: Seems like the fink guys had the same problem: http://echelog.com/logs/browse/fink/1365285600

comment:12 in reply to:  10 ; Changed 11 years ago by petrrr

Replying to wimmer@…:

Let me note that I get the same problem for python 2.7 on OSX 10.8 when I install from source using "port install -s py27-scipy", instead of installing the prebuilt version. I looked into the problem, and figured out that the problem is due to the fact that scipy compiles all code with the macports gcc/gfortran, but when building the shared library object spline.so links with clang - hence the symbol ___ieee_divdc3 which is specific to gcc is not found. In fact, clang is used for all modules based on C-code (not Fortran code). You can see this in the attached build.log.

Well, if this is really due to the fact that clang is used for linking, why this would happen on a 10.5 system? As far as I remember there is no clang, yet.

comment:13 Changed 11 years ago by petrrr

By the way, I am able to reproduce the problem the same behaviour on my 10.8. Will recheck on this on the 10.5 machine as well, but there actually all port are build from source.

comment:14 in reply to:  12 Changed 11 years ago by wimmer@…

Replying to Peter.Danecek@…:

Replying to wimmer@…:

Let me note that I get the same problem for python 2.7 on OSX 10.8 when I install from source using "port install -s py27-scipy", instead of installing the prebuilt version. I looked into the problem, and figured out that the problem is due to the fact that scipy compiles all code with the macports gcc/gfortran, but when building the shared library object spline.so links with clang - hence the symbol ___ieee_divdc3 which is specific to gcc is not found. In fact, clang is used for all modules based on C-code (not Fortran code). You can see this in the attached build.log.

Well, if this is really due to the fact that clang is used for linking, why this would happen on a 10.5 system? As far as I remember there is no clang, yet.

It is clang on my 10.8, could be gcc-4.2 on 10.5, for example. Also, it might depend on the python version, as different python versions have different logic on figuring out which compiler to use (python usually wants to compile things with the same compiler as it is compiled itself) ... it is possible that the problem for python2.7 only shows up since a very recent update of python2.7.

In any case ___ieee_divdc3 is apparently a GNU gcc symbol, and the error is also in the previous cases probably due to the linker not linking against the GNU gcc libraries (as probably an Apple compiler was used for linking).

comment:15 Changed 11 years ago by wimmer@…

Cc: wimmer@… added

Cc Me!

comment:16 Changed 11 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to sean@…

comment:17 Changed 11 years ago by mf2k (Frank Schima)

Port: py-scipy added; py26-scipy removed

comment:18 Changed 11 years ago by calvin.giles@…

By the way, this also seems to happen with py33.

I have py27 installed with full scipy stack, no problems.

I then started to install the py33 stack. scipy was installed automatically because of a dependency from somewhere else (matplotlib I think).

comment:19 Changed 11 years ago by calvin.giles@…

Cc: calvin.giles@… added

Cc Me!

comment:20 Changed 11 years ago by petrrr

I cannot reproduce this problem any more. There are recent commits to this port, which may have resolved this.

comment:21 Changed 11 years ago by mf2k (Frank Schima)

Cc: macsforever2000@… added

Cc Me!

comment:22 in reply to:  21 Changed 11 years ago by wimmer@…

As far as I can see, the changes have lead to scipy C/C++ code being compiled by clang, hence the issues I mentioned above do not happen any more. I think this bug can be closed.

comment:23 Changed 10 years ago by petrrr

I think this problem is gone. ticket can be closed.

comment:24 Changed 10 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.