mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-03-06 15:21:38 +00:00
Merge pull request #7899 from thinkpad20/openblas_on_osx
added flags/switches necessary to get openblas to compile on osx
This commit is contained in:
commit
d8dab38fda
pkgs
development
top-level
26
pkgs/development/compilers/gcc/gfortran-darwin.nix
Normal file
26
pkgs/development/compilers/gcc/gfortran-darwin.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
# This is a derivation specific to OS X (Darwin). It may work on other
|
||||
# systems as well but has not been tested.
|
||||
{gmp, mpfr, libmpc, fetchurl, stdenv}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "gfortran-${version}";
|
||||
version = "5.1.0";
|
||||
buildInputs = [gmp mpfr libmpc];
|
||||
src = fetchurl {
|
||||
url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
|
||||
sha256 = "1bd5vj4px3s8nlakbgrh38ynxq4s654m6nxz7lrj03mvkkwgvnmp";
|
||||
};
|
||||
configureFlags = ''
|
||||
--enable-languages=fortran --enable-checking=release --disable-bootstrap
|
||||
--with-gmp=${gmp}
|
||||
--with-mpfr=${mpfr}
|
||||
--with-mpc=${libmpc}
|
||||
'';
|
||||
makeFlags = ["CC=clang"];
|
||||
meta = with stdenv.lib; {
|
||||
description = "GNU Fortran compiler, part of the GNU Compiler Collection.";
|
||||
homepage = "https://gcc.gnu.org/fortran/";
|
||||
license = licenses.gpl3Plus;
|
||||
platforms = platforms.darwin;
|
||||
};
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchurl, gfortran, perl, liblapack, config }:
|
||||
{ stdenv, fetchurl, gfortran, perl, liblapack, config, coreutils }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
|
@ -7,6 +7,7 @@ let local = config.openblas.preferLocalBuild or false;
|
|||
{
|
||||
i686-linux = "32";
|
||||
x86_64-linux = "64";
|
||||
x86_64-darwin = "64";
|
||||
}."${stdenv.system}" or (throw "unsupported system: ${stdenv.system}");
|
||||
genericFlags =
|
||||
[
|
||||
|
@ -29,14 +30,18 @@ stdenv.mkDerivation rec {
|
|||
|
||||
preBuild = "cp ${liblapack.src} lapack-${liblapack.meta.version}.tgz";
|
||||
|
||||
nativeBuildInputs = [gfortran perl];
|
||||
nativeBuildInputs = optionals stdenv.isDarwin [coreutils] ++ [gfortran perl];
|
||||
|
||||
makeFlags =
|
||||
(if local then localFlags else genericFlags)
|
||||
++
|
||||
optionals stdenv.isDarwin ["MACOSX_DEPLOYMENT_TARGET=10.9"]
|
||||
++
|
||||
[
|
||||
"FC=gfortran"
|
||||
"CC=gcc"
|
||||
# Note that clang is available through the stdenv on OSX and
|
||||
# thus is not an explicit dependency.
|
||||
"CC=${if stdenv.isDarwin then "clang" else "gcc"}"
|
||||
''PREFIX="''$(out)"''
|
||||
"INTERFACE64=1"
|
||||
];
|
||||
|
@ -45,7 +50,7 @@ stdenv.mkDerivation rec {
|
|||
description = "Basic Linear Algebra Subprograms";
|
||||
license = licenses.bsd3;
|
||||
homepage = "https://github.com/xianyi/OpenBLAS";
|
||||
platforms = with platforms; linux;
|
||||
platforms = with platforms; unix;
|
||||
maintainers = with maintainers; [ ttuegel ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -3698,7 +3698,8 @@ let
|
|||
isl = isl_0_14;
|
||||
}));
|
||||
|
||||
gfortran = gfortran48;
|
||||
gfortran = if !stdenv.isDarwin then gfortran48
|
||||
else callPackage ../development/compilers/gcc/gfortran-darwin.nix {};
|
||||
|
||||
gfortran48 = wrapCC (gcc48.cc.override {
|
||||
name = "gfortran";
|
||||
|
|
Loading…
Reference in a new issue