Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 415827 - dev-python/cvxopt-1.1.5 always links against libblas in building 'cholmod' extension
Summary: dev-python/cvxopt-1.1.5 always links against libblas in building 'cholmod' ex...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Science Mathematics related packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-14 03:25 UTC by Steven Trogdon
Modified: 2012-05-26 15:06 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steven Trogdon 2012-05-14 03:25:12 UTC
When dev-python/cvxopt-1.1.5 is built the 'cholmod' extension is always linked against libblas regardless of which blas one has eselect'd. The following is a failure when only openblas is installed and thus eselect'd:

running build_ext
building 'glpk' extension
creating build-2.7/temp.linux-x86_64-2.7
creating build-2.7/temp.linux-x86_64-2.7/C
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/glpk.c -o build-2.7/temp.linux-x86_64-2.7/C/glpk.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -march=opteron -O2 -pipe build-2.7/temp.linux-x86_64-2.7/C/glpk.o -L -L/usr/lib64 -lglpk -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/cvxopt/glpk.so
building 'base' extension
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/base.c -o build-2.7/temp.linux-x86_64-2.7/C/base.o
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/dense.c -o build-2.7/temp.linux-x86_64-2.7/C/dense.o
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/sparse.c -o build-2.7/temp.linux-x86_64-2.7/C/sparse.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -march=opteron -O2 -pipe build-2.7/temp.linux-x86_64-2.7/C/base.o build-2.7/temp.linux-x86_64-2.7/C/dense.o build-2.7/temp.linux-x86_64-2.7/C/sparse.o -L -L/usr/lib64 -llapack -lopenblas -lm -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/cvxopt/base.so
building 'blas' extension
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/blas.c -o build-2.7/temp.linux-x86_64-2.7/C/blas.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -march=opteron -O2 -pipe build-2.7/temp.linux-x86_64-2.7/C/blas.o -L -L/usr/lib64 -lopenblas -lm -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/cvxopt/blas.so
building 'lapack' extension
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/lapack.c -o build-2.7/temp.linux-x86_64-2.7/C/lapack.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -march=opteron -O2 -pipe build-2.7/temp.linux-x86_64-2.7/C/lapack.o -L -L/usr/lib64 -llapack -lopenblas -lm -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/cvxopt/lapack.so
building 'umfpack' extension
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -I/usr/include/python2.7 -c C/umfpack.c -o build-2.7/temp.linux-x86_64-2.7/C/umfpack.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -march=opteron -O2 -pipe build-2.7/temp.linux-x86_64-2.7/C/umfpack.o -L -L/usr/lib64 -lumfpack -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/cvxopt/umfpack.so
building 'cholmod' extension
x86_64-pc-linux-gnu-gcc -pthread -march=opteron -O2 -pipe -fPIC -DDLONG= -DNPARTITION=1 -I/usr/include/python2.7 -c C/cholmod.c -o build-2.7/temp.linux-x86_64-2.7/C/cholmod.o
x86_64-pc-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -march=opteron -O2 -pipe build-2.7/temp.linux-x86_64-2.7/C/cholmod.o -L/usr/lib64 -lcholmod -lblas -lpython2.7 -o build-2.7/lib.linux-x86_64-2.7/cvxopt/cholmod.so
/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.3/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lblas
collect2: ld returned 1 exit status
error: command 'x86_64-pc-linux-gnu-gcc' failed with exit status 1

Notice that blas is linked correctly in building the 'base', 'blas' and 'lapack' extensions. If blas-reference is installed then the build succeeds even if that blas is not eselect'd since blas-reference provides /usr/lib/libblas.so.
Comment 1 Steven Trogdon 2012-05-14 16:46:14 UTC
I believe in the cholmod extension section of cvxopt-1.1.5-setup.patch

+     libraries = ['cholmod','blas'],
+     define_macros = MACROS + [('NPARTITION', '1')],
+     sources = [ 'C/cholmod.c' ])
+

there should be

libraries = [ 'cholmod' ] + BLAS_LIB,
Comment 2 Thomas Kahle (RETIRED) gentoo-dev 2012-05-16 11:36:09 UTC
(In reply to comment #1)
> I believe in the cholmod extension section of cvxopt-1.1.5-setup.patch
> 
> +     libraries = ['cholmod','blas'],
> +     define_macros = MACROS + [('NPARTITION', '1')],
> +     sources = [ 'C/cholmod.c' ])
> +
> 
> there should be
> 
> libraries = [ 'cholmod' ] + BLAS_LIB,

Well, I patched the patch last time this came up, but looking at it now, I don't understand what it is doing.  I guess Sebastien should look at it.  Sorry.
Comment 3 Sébastien Fabbro (RETIRED) gentoo-dev 2012-05-24 16:07:52 UTC
+  24 May 2012; Sébastien Fabbro <bicatali@gentoo.org>
+  files/cvxopt-1.1.5-setup.patch:
+  fixed cholmod blas linking, thanks Steve Trogdon, bug #415827
+
Comment 4 Steven Trogdon 2012-05-24 20:09:28 UTC
The updated patch has

+     libraries = ['cholmod'] + BLAS_LIBS,

But shouldn't this be

+     libraries = ['cholmod'] + BLAS_LIB,

No (S), since the unpatched setup.py has as variables

# Default names of BLAS and LAPACK libraries
BLAS_LIB = ['blas']
LAPACK_LIB = ['lapack']
BLAS_EXTRA_LINK_ARGS = []
Comment 5 Steven Trogdon 2012-05-26 15:03:53 UTC
OK, there's apparently no option to reopen a bug so let's try needinfo before opening a new bug.
Comment 6 Sébastien Fabbro (RETIRED) gentoo-dev 2012-05-26 15:06:16 UTC
just fixed it and revbumped. thanks for the catch.