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

Print rustc-link-search for the in-tree static openblas before everything else #61

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

maoe
Copy link
Contributor

@maoe maoe commented Mar 24, 2021

Fixes #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.

I've confirmed that the reproducer in #60 now prints the same config string across all distributions:

% git clone https://github.com/maoe/openblas-src.git
% cd openblas-src
% git checkout print-config-fix # this is the reproducer with this fix
% docker build -f Dockerfile.debian-bullseye -t openblas-src-bullseye .
% docker build -f Dockerfile.ubuntu-bionic -t openblas-src-bionic .
% docker build -f Dockerfile.ubuntu-focal -t openblas-src-focal .
% docker run -it --rm openblas-src-bullseye
OpenBLAS 0.3.10 NO_AFFINITY HASWELL MAX_THREADS=12
% docker run -it --rm openblas-src-bionic
OpenBLAS 0.3.10 NO_AFFINITY HASWELL MAX_THREADS=12
% docker run -it --rm openblas-src-focal
OpenBLAS 0.3.10 NO_AFFINITY HASWELL MAX_THREADS=12

…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.
@IvanUkhov
Copy link
Member

@termoshtt, you probably know best if it is safe to change the order.

@termoshtt
Copy link
Member

OK. I've confirm for listed environments. Thanks a lot :)

@termoshtt termoshtt merged commit 96957f8 into blas-lapack-rs:master Apr 2, 2021
@maoe maoe deleted the debug-static branch April 2, 2021 22:47
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
3 participants