Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cross-compile liblapack #1810

Closed
han-so1omon opened this issue Oct 11, 2018 · 6 comments
Closed

cross-compile liblapack #1810

han-so1omon opened this issue Oct 11, 2018 · 6 comments

Comments

@han-so1omon
Copy link

han-so1omon commented Oct 11, 2018

After building with make HOSTCC=gcc TARGET=ARMV7 CC=arm-linux-gnueabihf-gcc FC=arm-linux-gnueabihf-gfortran NO_SHARED=0 BINARY=32, the openblas libraries are built, but not the lapack libraries. The install process adds the following files to the install location:


include/:
cblas.h
f77blas.h
lapacke_config.h
lapacke.h
lapacke_mangling.h
lapacke_utils.h
openblas_config.h

lib/:
cmake
libopenblas.a
libopenblas_armv7p-r0.3.4.dev.a
libopenblas_armv7p-r0.3.4.dev.so
libopenblas.so
libopenblas.so.0
pkgconfig

What is the command to build liblapack.so (and libcblas.so)?

@brada4
Copy link
Contributor

brada4 commented Oct 11, 2018

You can rename the file, it contains all of:
libblas.so
libcblas.so
liblapack.so
liblapacke.so

@brada4
Copy link
Contributor

brada4 commented Oct 11, 2018

You need to set HOSTCC=gcc for cross-compilation

@han-so1omon
Copy link
Author

Yes, HOSTCC=gcc is in the full command that I used. Edited that in. How do I rename the file? Which file is being renamed?

@martin-frbg
Copy link
Collaborator

If you really need a separate liblapack.so etc., copy libopenblas.so to that name. The build system creates just one library that contains all of blas, cblas, lapack and lapacke.

@han-so1omon
Copy link
Author

ok thanks. i might need it for mxnet. mxnet links against liblapack to allow for certain linear algebra operations.

@brada4
Copy link
Contributor

brada4 commented Oct 11, 2018

Normally you set mxnet so that all BLAS/LAPACK interfaces are
-L/opt/OpenBLAS/lib -lopenblas -I/opt/OpenBLAS/include
If that fails (should not with mxnet)

ln -s libopenblas.so libblas.so
ln -s libopenblas.so libcblas.so
ln -s libopenblas.so liblapack.so
ln -s libopenblas.so liblapacke.so

And in ./configure:
--with-blas/lapack-libs=/opt/OpenBLAS/lib --with-blas-includes=/opt/OpenBLAS/include

It is "simpler" to have pre-baked guides if you use Ubuntu:
https://mxnet.incubator.apache.org/install/ubuntu_setup.html
And then you can try out latest release IF you have time:
https://github.com/xianyi/OpenBLAS/wiki/faq#debianlts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants