diff options
author | Thomas Tuegel <ttuegel@gmail.com> | 2015-05-24 19:01:50 -0500 |
---|---|---|
committer | Thomas Tuegel <ttuegel@gmail.com> | 2015-05-24 19:01:50 -0500 |
commit | d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105 (patch) | |
tree | 0b16b5e528a55abb88ac18b93798cafa16f9e506 /pkgs/development | |
parent | 5722d7c5b593c8cabf0cf2783161ad5ef8d89e07 (diff) | |
parent | e802740b69375fc628e446ffd7c3f746c59312d0 (diff) | |
download | nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.tar nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.tar.gz nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.tar.bz2 nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.tar.lz nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.tar.xz nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.tar.zst nixpkgs-d8dab38fda0e48b31edc6fdd88ebfb1ad08c5105.zip |
Merge pull request #7899 from thinkpad20/openblas_on_osx
added flags/switches necessary to get openblas to compile on osx
Diffstat (limited to 'pkgs/development')
-rw-r--r-- | pkgs/development/compilers/gcc/gfortran-darwin.nix | 26 | ||||
-rw-r--r-- | pkgs/development/libraries/science/math/openblas/default.nix | 13 |
2 files changed, 35 insertions, 4 deletions
diff --git a/pkgs/development/compilers/gcc/gfortran-darwin.nix b/pkgs/development/compilers/gcc/gfortran-darwin.nix new file mode 100644 index 00000000000..954b236ff6f --- /dev/null +++ b/pkgs/development/compilers/gcc/gfortran-darwin.nix @@ -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; + }; +} diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index e779957a6fb..67d95f97e07 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -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 ]; }; } |