liblapack: fix cross-compilation

3.11 now attempts to run host platform binaries at build time by default.
Fortunately, this can be easily disabled. These binaries test certain compiler
behaviors and are for informational purposes only. Apparently, they cause
problems with GCC 12 as well and therefore will likely be disabled by default
in the next release.
This commit is contained in:
Ben Wolsieffer 2022-12-06 17:19:36 -05:00
parent 84c17bc98f
commit 3ae3e1f5a3

View File

@ -30,7 +30,11 @@ stdenv.mkDerivation rec {
"-DCBLAS=ON"
"-DBUILD_TESTING=ON"
] ++ lib.optional shared "-DBUILD_SHARED_LIBS=ON"
++ lib.optional blas64 "-DBUILD_INDEX64=ON";
++ lib.optional blas64 "-DBUILD_INDEX64=ON"
# Tries to run host platform binaries during the build
# Will likely be disabled by default in 3.12, see:
# https://github.com/Reference-LAPACK/lapack/issues/757
++ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) "-DTEST_FORTRAN_COMPILER=OFF";
passthru = { inherit blas64; };