Skip to content
New issue

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

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

Already on GitHub? # to your account

The static feature doesn't static link to the in-tree openblas on Debian Bullseye when libopenblas-dev is installed #60

Closed
maoe opened this issue Mar 10, 2021 · 2 comments · Fixed by #61
Labels

Comments

@maoe
Copy link
Contributor

maoe commented Mar 10, 2021

The static feature is (I think) supposed to build the openblas source in the submodule and link it statically but it appears that on Debian Bullseye it links to the system library (libopenblas-dev) instead. On Ubuntu Bionic it seems to work fine.

Steps to reproduce:

  1. checkout my repro branch:
git clone https://github.com/maoe/openblas-src.git
cd openblas-src
git checkout print-config
  1. build docker images
docker build -f Dockerfile.debian-bullseye -t openblas-src-bullseye .
docker build -f Dockerfile.ubuntu-bionic -t openblas-src-bionic .
  1. run the containers
% docker run -it --rm openblas-src-bullseye
OpenBLAS 0.3.13 NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell MAX_THREADS=64
% docker run -it --rm openblas-src-bionic   
NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Haswell

FWIW OpenBLAS 0.3.13 is installed via apt-get install in both containers.

@maoe maoe changed the title The static feature doesn't do static linking on Debian Bullseye when libopenblas-dev is installed The static feature doesn't static link to the in-tree openblas on Debian Bullseye when libopenblas-dev is installed Mar 10, 2021
@maoe
Copy link
Contributor Author

maoe commented Mar 10, 2021

Apparently Ubuntu Focal has the same issue:

% docker build -f Dockerfile.ubuntu-focal -t openblas-src-focal .
% docker run -it --rm openblas-src-focal                         
OpenBLAS 0.3.8 NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Sandybridge MAX_THREADS=64

@termoshtt termoshtt added the bug label Mar 20, 2021
maoe added a commit to maoe/openblas-src that referenced this issue Mar 24, 2021
…hing else

Fixes blas-lapack-rs#60.

The gnu linker searches libraries in the order of -L options and stops
the search when the first matching library is found. This means if
libopenblas.a is either in deriv.make_conf.c_extra_libs.search_path or
in deliv.make_conf.f_extra_libs.search_path, the in-tree libopenblas.a
won't be used.

This patch fixes the issue by printing the rustc-link-search instruction
for the in-tree openblas before everything else.
maoe added a commit to maoe/openblas-src that referenced this issue Mar 24, 2021
…hing else

Fixes blas-lapack-rs#60.

The gnu linker searches libraries in the order of -L options and stops
the search when the first matching library is found. This means if
libopenblas.a is either in deliv.make_conf.c_extra_libs.search_path or
in deliv.make_conf.f_extra_libs.search_path, the in-tree libopenblas.a
won't be used.

This patch fixes the issue by printing the rustc-link-search instruction
for the in-tree openblas before everything else.
@termoshtt
Copy link
Member

Thanks a lot!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants