pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

problem with math/blas/files/Makefile.blas



The python numpy package does play nice with pkgsrc-2008Q3:

    $ echo import numpy | python2.5
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File 
"/glib/pkgsrc-2008Q3/x86_64/lib/python2.5/site-packages/numpy/__init__.py", 
line 43, in <module>
        import linalg
      File 
"/glib/pkgsrc-2008Q3/x86_64/lib/python2.5/site-packages/numpy/linalg/__init__.py",
 line 4, in <module>
        from linalg import *
      File 
"/glib/pkgsrc-2008Q3/x86_64/lib/python2.5/site-packages/numpy/linalg/linalg.py",
 line 25, in <module>
        from numpy.linalg import lapack_lite
    ImportError: /glib/pkgsrc-2008Q3/x86_64/lib/libF77.so.0: undefined symbol: 
MAIN__

This problem is similar to the one described here:

  http://mail-index.netbsd.org/pkgsrc-users/2008/10/21/msg008397.html

From the above error message, one might think that the problem is
related to libF77.so.0.  However the problem is actually in math/blas.

I happened to have a pkgsrc-2008Q2 tree lying about which did not have
the problem.  Using this, I was able to isolate the issue.  

Note the following:

  $ nm /glib/pkgsrc-2008Q2/x86_64/lib/libblas.so.1.0.1 | grep MAIN__
  $ nm /glib/pkgsrc-2008Q3/x86_64/lib/libblas.so.1.0.1 | grep MAIN__
          U MAIN__

After reverting math/blas/files/Makefile.blas from version 1.2 down to
version 1.1, MAIN__ no longer appears undefined in libblas.so.1.0.1,
and the import of numpy succeeds.

The "cvs log" message related to the 1.2 checkin is as follows:

    ----------------------------
    revision 1.2
    date: 2008/08/12 21:29:11;  author: markd;  state: Exp;  lines: +1 -1
    Tell libtool that its linking fortran so the correct libraries get
    linked in.

So I don't think that we can simply revert the change.

I also think that math/lapack is affected in a similar way.
What is the correct fix?

-russ


cvs diff -r1.1 -r1.2 files/Makefile.blas
Index: files/Makefile.blas
===================================================================
RCS file: /cvsroot/pkgsrc/math/blas/files/Makefile.blas,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- files/Makefile.blas 7 Mar 2008 07:14:24 -0000       1.1
+++ files/Makefile.blas 12 Aug 2008 21:29:11 -0000      1.2
@@ -28,7 +28,7 @@
        ${LIBTOOL} --mode=compile --tag=CC ${COMPILE.f} ${.IMPSRC}

 libblas.la: $(OBJS)
-       ${LIBTOOL} --mode=link ${CC} -o ${.TARGET} ${OBJS:.o=.lo}       \
+       ${LIBTOOL} --mode=link --tag=F77 ${FC} -o ${.TARGET} ${OBJS:.o=.lo}     
\
                -rpath $(libdir)                                        \
                -version-info ${SHLIB_MAJOR}:${SHLIB_MINOR}



Home | Main Index | Thread Index | Old Index