From 3ae3e1f5a364f097bdc4657ad13c8e089c7d2891 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Tue, 6 Dec 2022 17:19:36 -0500 Subject: [PATCH] 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. --- .../libraries/science/math/liblapack/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/science/math/liblapack/default.nix b/pkgs/development/libraries/science/math/liblapack/default.nix index c8f0b37e0659..b9563346ada4 100644 --- a/pkgs/development/libraries/science/math/liblapack/default.nix +++ b/pkgs/development/libraries/science/math/liblapack/default.nix @@ -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; };