Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 May 2005 14:27:51 -0400
From:      Gregory Crosswhite <cog@umd.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/80624: [patch] science/py-scipy links to wrong atlas library
Message-ID:  <200505041427.52151.cog@umd.edu>
Resent-Message-ID: <200505041830.j44IU3e4042427@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         80624
>Category:       ports
>Synopsis:       [patch] science/py-scipy links to wrong atlas library
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Wed May 04 18:30:03 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Gregory Crosswhite
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
University of Maryland, College Park
>Environment:
System: FreeBSD dragon.student.umd.edu 5.3-RELEASE FreeBSD 5.3-RELEASE #1: Sun 
Mar 13 14:21:12 EST 2005 cog@dragon.stude
nt.umd.edu:/usr/obj/usr/src/sys/MYKERNEL i386

Applicable Installed Ports:
    atlas-3.6.0,1       Automatically Tuned Linear Algebra Software (ATLAS)
    py23-scipy-0.3      Scientific tools for Python

        <machine, os, target, libraries (multiple lines)>
>Description:

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.

>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"

>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.
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200505041427.52151.cog>