Skip to content

Conversation

@Crivella
Copy link
Contributor

@Crivella Crivella commented Oct 23, 2025

Addresses issue described in

Creates an openblas[SUFFIX] subdir for include files and then symlinks all the headers with a filename[SUFFIX].h variant.
Also preserve the PC files for pkgconfig for all installations so that

pkg-config --libs openblas[SUFFIX] works for all variants that we create

NOTE

I tried to preserve the current behavior of the EB, but i find it weird.
Right now for a 64bit enabled installation (the default) we actually run 3 build:

  • the normal non 64bit one producing a libopenblas.so
  • A 64 bit version with the same symbol names as the normal one libopenblas64.so
  • A 64 bit version with suffixed symbols and headers libopenblas64_.so

I am not a BLAS expert but if the 64bit non suffixed version can act as a drop-in replacement for the non 64bit variant i am not sure why the suffixes are needed.
On the other hand if the 64bit cannot be used as a replacement for the 32 than we want the suffixed version but not sure what is the use of the non-suffixed 64bit one.

Is this to allow to use both libraries at once in the same program (doing both 32 and 64 bit calls)?

cmake files

Currently we only get a lib/cmake/OpenBLASConfig.cmake file valid for the last build, and unless people start to implement a `find_package(openblas[SUFFIX]) in their cmake files i do not see a way to improve this.

The only think that comes to mind would be to write a custom OpenBLASConfig.cmake exposing the different variants as components, but also that would become a behavior unique to EB.
This is probably something that should be done upstream

TODO

  • Do we want to symlink all headers or only cblas.h (the only one that i think changes)
    • Right now i did all of them, but I realize that would also require patching the suffixed versions to have the suffix in the internal include "XXX.h" statements for it actually work as intended

@Crivella
Copy link
Contributor Author

@boegelbot please test @ jsc-zen3
EB_ARGS="--installpath /tmp/$USER/ebpr-3968 OpenBLAS-0.3.24-GCC-13.2.0.eb OpenBLAS-0.3.30-GCC-14.3.0.eb"

@Crivella
Copy link
Contributor Author

Crivella commented Oct 23, 2025

Current structure of the installation of OpenBLAS with this PR

symlinks

crivella@crivella-desktop:/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0$ ls -l include/
total 108
lrwxrwxrwx 1 crivella crivella   82 Oct 23 15:02 cblas64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/cblas.h
lrwxrwxrwx 1 crivella crivella   83 Oct 23 15:00 cblas64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/cblas.h
lrwxrwxrwx 1 crivella crivella   80 Oct 23 15:05 cblas.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/cblas.h
lrwxrwxrwx 1 crivella crivella   84 Oct 23 15:02 f77blas64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/f77blas.h
lrwxrwxrwx 1 crivella crivella   85 Oct 23 15:00 f77blas64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/f77blas.h
lrwxrwxrwx 1 crivella crivella   82 Oct 23 15:05 f77blas.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/f77blas.h
lrwxrwxrwx 1 crivella crivella   83 Oct 23 15:02 lapack64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/lapack.h
lrwxrwxrwx 1 crivella crivella   84 Oct 23 15:00 lapack64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/lapack.h
lrwxrwxrwx 1 crivella crivella   84 Oct 23 15:02 lapacke64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/lapacke.h
lrwxrwxrwx 1 crivella crivella   85 Oct 23 15:00 lapacke64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/lapacke.h
lrwxrwxrwx 1 crivella crivella   91 Oct 23 15:02 lapacke_config64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/lapacke_config.h
lrwxrwxrwx 1 crivella crivella   92 Oct 23 15:00 lapacke_config64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/lapacke_config.h
lrwxrwxrwx 1 crivella crivella   89 Oct 23 15:05 lapacke_config.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/lapacke_config.h
lrwxrwxrwx 1 crivella crivella   82 Oct 23 15:05 lapacke.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/lapacke.h
lrwxrwxrwx 1 crivella crivella   93 Oct 23 15:02 lapacke_mangling64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/lapacke_mangling.h
lrwxrwxrwx 1 crivella crivella   94 Oct 23 15:00 lapacke_mangling64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/lapacke_mangling.h
lrwxrwxrwx 1 crivella crivella   91 Oct 23 15:05 lapacke_mangling.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/lapacke_mangling.h
lrwxrwxrwx 1 crivella crivella   90 Oct 23 15:02 lapacke_utils64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/lapacke_utils.h
lrwxrwxrwx 1 crivella crivella   91 Oct 23 15:00 lapacke_utils64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/lapacke_utils.h
lrwxrwxrwx 1 crivella crivella   88 Oct 23 15:05 lapacke_utils.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/lapacke_utils.h
lrwxrwxrwx 1 crivella crivella   81 Oct 23 15:05 lapack.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/lapack.h
drwxr-xr-x 2 crivella crivella 4096 Oct 23 15:59 openblas
drwxr-xr-x 2 crivella crivella 4096 Oct 23 15:59 openblas64
drwxr-xr-x 2 crivella crivella 4096 Oct 23 15:59 openblas64_
lrwxrwxrwx 1 crivella crivella   92 Oct 23 15:02 openblas_config64.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64/openblas_config.h
lrwxrwxrwx 1 crivella crivella   93 Oct 23 15:00 openblas_config64_.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas64_/openblas_config.h
lrwxrwxrwx 1 crivella crivella   90 Oct 23 15:05 openblas_config.h -> /tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/include/openblas/openblas_config.h
crivella@crivella-desktop:/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0$ ls -l lib
total 130760
drwxr-xr-x 3 crivella crivella     4096 Oct 23 15:00 cmake
lrwxrwxrwx 1 crivella crivella       32 Oct 23 15:02 libopenblas64.a -> libopenblas64_haswellp-r0.3.24.a
lrwxrwxrwx 1 crivella crivella       33 Oct 23 15:00 libopenblas64_.a -> libopenblas64__haswellp-r0.3.24.a
-rw-r--r-- 1 crivella crivella 29771002 Oct 23 15:02 libopenblas64_haswellp-r0.3.24.a
-rw-r--r-- 1 crivella crivella 29771002 Oct 23 15:00 libopenblas64__haswellp-r0.3.24.a
-rwxr-xr-x 1 crivella crivella 14909272 Oct 23 15:02 libopenblas64_haswellp-r0.3.24.so
-rwxr-xr-x 1 crivella crivella 14940616 Oct 23 15:00 libopenblas64__haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       33 Oct 23 15:02 libopenblas64.so -> libopenblas64_haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       34 Oct 23 15:00 libopenblas64_.so -> libopenblas64__haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       33 Oct 23 15:02 libopenblas64.so.0 -> libopenblas64_haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       34 Oct 23 15:00 libopenblas64_.so.0 -> libopenblas64__haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       30 Oct 23 15:05 libopenblas.a -> libopenblas_haswellp-r0.3.24.a
-rw-r--r-- 1 crivella crivella 29699810 Oct 23 15:05 libopenblas_haswellp-r0.3.24.a
-rwxr-xr-x 1 crivella crivella 14788840 Oct 23 15:05 libopenblas_haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       31 Oct 23 15:05 libopenblas.so -> libopenblas_haswellp-r0.3.24.so
lrwxrwxrwx 1 crivella crivella       31 Oct 23 15:05 libopenblas.so.0 -> libopenblas_haswellp-r0.3.24.so
drwxr-xr-x 2 crivella crivella     4096 Oct 23 16:02 pkgconfig

pkg-config

crivella@crivella-desktop:/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0$ pkg-config --libs openblas
-L/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/lib -lopenblas
crivella@crivella-desktop:/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0$ pkg-config --libs openblas64
-L/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/lib -lopenblas64
crivella@crivella-desktop:/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0$ pkg-config --libs openblas64_ 
-L/tmp/tmp.Zp1qJ9EppO/software/OpenBLAS/0.3.24-GCC-13.2.0/lib -lopenblas64_

@boegelbot
Copy link

@Crivella: Request for testing this PR well received on jsczen3l1.int.jsc-zen3.fz-juelich.de

PR test command 'if [[ develop != 'develop' ]]; then EB_BRANCH=develop ./easybuild_develop.sh 2> /dev/null 1>&2; EB_PREFIX=/home/boegelbot/easybuild/develop source init_env_easybuild_develop.sh; fi; EB_PR=3968 EB_ARGS="--installpath /tmp/$USER/ebpr-3968 OpenBLAS-0.3.24-GCC-13.2.0.eb OpenBLAS-0.3.30-GCC-14.3.0.eb" EB_CONTAINER= EB_REPO=easybuild-easyblocks EB_BRANCH=develop /opt/software/slurm/bin/sbatch --job-name test_PR_3968 --ntasks=8 ~/boegelbot/eb_from_pr_upload_jsc-zen3.sh' executed!

  • exit code: 0
  • output:
Submitted batch job 8538

Test results coming soon (I hope)...

- notification for comment with ID 3437368810 processed

Message to humans: this is just bookkeeping information for me,
it is of no use to you (unless you think I have a bug, which I don't).

@akesandgren
Copy link
Contributor

since mkl uses cblas_64.h I think we should have that too

@Crivella
Copy link
Contributor Author

Crivella commented Oct 23, 2025

since mkl uses cblas_64.h I think we should have that too

@akesandgren Should we then keep the symbol suffix as 64_ or flip it to _64 (which would automatically give us cblas_64.h?

EDIT: Atleast the mkl seems to also use _64 as the suffix

@Crivella
Copy link
Contributor Author

Test report by @Crivella

Overview of tested easyconfigs (in order)

  • SUCCESS OpenBLAS-0.3.24-GCC-13.2.0.eb
  • SUCCESS OpenBLAS-0.3.30-GCC-14.3.0.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
crivella-desktop - Linux Ubuntu 22.04.5 LTS (Jammy Jellyfish), x86_64, 13th Gen Intel(R) Core(TM) i9-13900K (skylake), Python 3.11.13
See https://gist.github.com/Crivella/04521f8be827c5250147dec67491988e for a full test report.

@boegelbot
Copy link

Test report by @boegelbot

Overview of tested easyconfigs (in order)

  • SUCCESS OpenBLAS-0.3.24-GCC-13.2.0.eb
  • SUCCESS OpenBLAS-0.3.30-GCC-14.3.0.eb

Build succeeded for 2 out of 2 (2 easyconfigs in total)
jsczen3c1.int.jsc-zen3.fz-juelich.de - Linux Rocky Linux 9.6, x86_64, AMD EPYC-Milan Processor (zen3), Python 3.9.21
See https://gist.github.com/boegelbot/c264e9ab1c5daaba0cf8aa9f90853995 for a full test report.

@akesandgren
Copy link
Contributor

since mkl uses cblas_64.h I think we should have that too

@akesandgren Should we then keep the symbol suffix as 64_ or flip it to _64 (which would automatically give us cblas_64.h?

Not sure what the best result is, but I don't remember seeing 64_ anywhere previously until whomever mentioned it in the discussions.

@Crivella
Copy link
Contributor Author

It is the default one since #2753

'ilp64_lib_suffix': ['64', "Library name suffix to use when building with 64-bit integers", CUSTOM],
'ilp64_symbol_suffix': ['64_', "Symbol suffix to use when building with 64-bit integers", CUSTOM],

I also find what we are doing right now weird of having 3 builds instead of two

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potentially wrong cblas.h in OpenBLAS installations with 64bit support

3 participants