Bug 80624 - [patch] science/py-scipy links to wrong atlas library
Summary: [patch] science/py-scipy links to wrong atlas library
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Volker Stolz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-04 19:30 UTC by Gregory Crosswhite
Modified: 2005-05-18 16:46 UTC (History)
0 users

See Also:


Attachments
patch-scipy_core-scipy_distutils-systeminfo.py (704 bytes, application/x-python)
2005-05-04 21:21 UTC, Gregory Crosswhite
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gregory Crosswhite 2005-05-04 19:30:03 UTC
In FreeBSD, the atlas libraries have a slightly different naming convention 
than that expected by SciPy.  In particular,
the threaded versions of the libraries end in "_r",  which SciPy does not 
expect.  Thus, it links against the wrong
libraries.  When you use the SciPy libraries, they throw an ImportError 
reporting that they are unable to find symbols
they need.

I have seen two such errors:

    ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol 
"ATL_cpttrsm"

when using the optimize package, and then, after a fix was applied for the 
above,

    ImportError: /usr/local/lib/python2.3/site-packages/scipy/linalg/clapack.so: 
Undefined symbol "clapack_sgesv"

when using the linear algebra package.

Fix: 

Before building the port, change the file 
scipy_core/scipy_distutils/system_info.py so that
lines 547-549, which formally read

          atlas_libs = self.get_libs('atlas_libs',
                                     self._lib_names + ['atlas'])
          lapack_libs = self.get_libs('lapack_libs',['lapack'])

now read

          atlas_libs = self.get_libs('atlas_libs',
                                     self._lib_names + ['atlas_r'])
          lapack_libs = self.get_libs('lapack_libs',['alapack_r'])

(I changed the names of the libraries slightly: 'atlas'->'atlas_r' and 
'lapack'->'alapack_r'.)

A patch has been included which does this automatically.  It can just be 
dropped directly into the
"files/" directory in the science/py-scipy port.
How-To-Repeat: 
Build and install the science/scipy port.

Run python and type in the commands:

   from scipy.optimize.optimize import *
   fmin_bfgs

ImportError: /usr/local/lib/libptf77blas.so.1: Undefined symbol "ATL_cpttrsm"
Comment 1 Gregory Crosswhite 2005-05-04 21:21:45 UTC
The patch I had meant to include with the problem report is attached to this 
e-mail.  My apologies.

- Greg
Comment 2 Pav Lucistnik freebsd_committer 2005-05-06 19:02:29 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vs

vs already owns two other scipy PRs
Comment 3 Volker Stolz freebsd_committer 2005-05-18 16:46:09 UTC
State Changed
From-To: open->closed

Committed, thanks!