openblas: fix on darwin
The openblas script relies on CC=clang for succesfully compiling on Darwin systems. This seems like bad behavior, but we get things like https://hydra.nixos.org/build/87657058 otherwise. Fixes #55536.
This commit is contained in:
parent
2926b6e11f
commit
cfc43138cb
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchFromGitHub, fetchpatch, gfortran, perl, which, config, coreutils
|
{ stdenv, fetchFromGitHub, fetchpatch, gfortran, perl, which, config
|
||||||
# Most packages depending on openblas expect integer width to match
|
# Most packages depending on openblas expect integer width to match
|
||||||
# pointer width, but some expect to use 32-bit integers always
|
# pointer width, but some expect to use 32-bit integers always
|
||||||
# (for compatibility with reference BLAS).
|
# (for compatibility with reference BLAS).
|
||||||
@ -102,24 +102,18 @@ stdenv.mkDerivation rec {
|
|||||||
"relro" "bindnow"
|
"relro" "bindnow"
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
perl
|
nativeBuildInputs = [ perl which gfortran ];
|
||||||
which
|
|
||||||
buildPackages.gfortran
|
|
||||||
buildPackages.stdenv.cc
|
|
||||||
] ++ optionals stdenv.isDarwin [
|
|
||||||
coreutils
|
|
||||||
];
|
|
||||||
|
|
||||||
makeFlags = mapAttrsToList (var: val: "${var}=${toString val}") (config // {
|
makeFlags = mapAttrsToList (var: val: "${var}=${toString val}") (config // {
|
||||||
FC = "${stdenv.cc.targetPrefix}gfortran";
|
FC = "${stdenv.cc.targetPrefix}gfortran";
|
||||||
CC = "${stdenv.cc.targetPrefix}cc";
|
CC = "${stdenv.cc.targetPrefix}${if stdenv.cc.isClang then "clang" else "cc"}";
|
||||||
PREFIX = placeholder "out";
|
PREFIX = placeholder "out";
|
||||||
NUM_THREADS = 64;
|
NUM_THREADS = 64;
|
||||||
INTERFACE64 = blas64;
|
INTERFACE64 = blas64;
|
||||||
NO_STATIC = true;
|
NO_STATIC = true;
|
||||||
CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
|
CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
|
||||||
HOSTCC = "${buildPackages.stdenv.cc.targetPrefix}cc";
|
HOSTCC = "cc";
|
||||||
NO_BINARY_MODE = stdenv.hostPlatform != stdenv.buildPlatform;
|
NO_BINARY_MODE = stdenv.hostPlatform != stdenv.buildPlatform;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user