Merge pull request #83888 from matthewbauer/blas-alternatives
Add BLAS/LAPACK switching mechanism
This commit is contained in:
commit
cdfda4b455
|
@ -12,7 +12,7 @@
|
||||||
, pythonPackages
|
, pythonPackages
|
||||||
, uhd
|
, uhd
|
||||||
, log4cpp
|
, log4cpp
|
||||||
, openblas
|
, blas, lapack
|
||||||
, matio
|
, matio
|
||||||
, pugixml
|
, pugixml
|
||||||
, protobuf
|
, protobuf
|
||||||
|
@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
|
||||||
# nothing to be gained by leaving it out.
|
# nothing to be gained by leaving it out.
|
||||||
uhd
|
uhd
|
||||||
log4cpp
|
log4cpp
|
||||||
openblas
|
blas lapack
|
||||||
matio
|
matio
|
||||||
pugixml
|
pugixml
|
||||||
protobuf
|
protobuf
|
||||||
|
@ -63,8 +63,8 @@ stdenv.mkDerivation rec {
|
||||||
# armadillo is built using both, so skip checking for them.
|
# armadillo is built using both, so skip checking for them.
|
||||||
"-DBLAS=YES"
|
"-DBLAS=YES"
|
||||||
"-DLAPACK=YES"
|
"-DLAPACK=YES"
|
||||||
"-DBLAS_LIBRARIES=-lopenblas"
|
"-DBLAS_LIBRARIES=-lblas"
|
||||||
"-DLAPACK_LIBRARIES=-lopenblas"
|
"-DLAPACK_LIBRARIES=-llapack"
|
||||||
|
|
||||||
# Similarly, it doesn't actually use gfortran despite checking for
|
# Similarly, it doesn't actually use gfortran despite checking for
|
||||||
# its presence.
|
# its presence.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchFromGitHub, zlib, openblas, darwin}:
|
{ stdenv, fetchFromGitHub, zlib, blas, lapack, darwin}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "plink-ng";
|
pname = "plink-ng";
|
||||||
|
@ -11,14 +11,20 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq";
|
sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ zlib ] ++ (if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ openblas ]) ;
|
buildInputs = [ zlib ] ++ (if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ blas lapack ]) ;
|
||||||
|
|
||||||
buildPhase = ''
|
preBuild = ''
|
||||||
sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h
|
sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h
|
||||||
${if stdenv.cc.isClang then "sed -i 's|g++|clang++|g' Makefile.std" else ""}
|
${if stdenv.cc.isClang then "sed -i 's|g++|clang++|g' Makefile.std" else ""}
|
||||||
make ZLIB=-lz ${if stdenv.isDarwin then "" else "BLASFLAGS=-lopenblas"} -f Makefile.std
|
|
||||||
|
makeFlagsArray+=(
|
||||||
|
ZLIB=-lz
|
||||||
|
BLASFLAGS="-lblas -lcblas -llapack"
|
||||||
|
);
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
makefile = "Makefile.std";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cp plink $out/bin
|
cp plink $out/bin
|
||||||
|
@ -31,4 +37,3 @@ stdenv.mkDerivation rec {
|
||||||
platforms = stdenv.lib.platforms.linux;
|
platforms = stdenv.lib.platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
{ stdenv, fetchFromGitLab, symlinkJoin, gfortran, perl, procps
|
{ stdenv, fetchFromGitLab, symlinkJoin, gfortran, perl, procps
|
||||||
, libyaml, libxc, fftw, openblas, gsl, netcdf, arpack, autoreconfHook
|
, libyaml, libxc, fftw, blas, lapack, gsl, netcdf, arpack, autoreconfHook
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "octopus";
|
pname = "octopus";
|
||||||
version = "9.2";
|
version = "9.2";
|
||||||
|
@ -14,12 +16,12 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ perl procps autoreconfHook ];
|
nativeBuildInputs = [ perl procps autoreconfHook ];
|
||||||
buildInputs = [ libyaml gfortran libxc openblas gsl fftw netcdf arpack ];
|
buildInputs = [ libyaml gfortran libxc blas lapack gsl fftw netcdf arpack ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-yaml-prefix=${libyaml}"
|
"--with-yaml-prefix=${libyaml}"
|
||||||
"--with-blas=-lopenblas"
|
"--with-blas=-lblas"
|
||||||
"--with-lapack=-lopenblas"
|
"--with-lapack=-llapack"
|
||||||
"--with-fftw-prefix=${fftw.dev}"
|
"--with-fftw-prefix=${fftw.dev}"
|
||||||
"--with-gsl-prefix=${gsl}"
|
"--with-gsl-prefix=${gsl}"
|
||||||
"--with-libxc-prefix=${libxc}"
|
"--with-libxc-prefix=${libxc}"
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{ stdenv, fetchFromGitLab, cmake, gfortran, perl
|
{ stdenv, fetchFromGitLab, cmake, gfortran, perl
|
||||||
, openblas, hdf5-cpp, python3, texlive
|
, openblas, blas, lapack, hdf5-cpp, python3, texlive
|
||||||
, armadillo, openmpi, globalarrays, openssh
|
, armadillo, openmpi, globalarrays, openssh
|
||||||
, makeWrapper, fetchpatch
|
, makeWrapper, fetchpatch
|
||||||
} :
|
} :
|
||||||
|
|
||||||
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "19.11";
|
version = "19.11";
|
||||||
gitLabRev = "v${version}";
|
gitLabRev = "v${version}";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchurl
|
{ stdenv, fetchurl
|
||||||
, gfortran, fftw, openblas
|
, gfortran, fftw, blas, lapack
|
||||||
, mpi ? null
|
, mpi ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
||||||
patchShebangs configure
|
patchShebangs configure
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ fftw openblas gfortran ]
|
buildInputs = [ fftw blas lapack gfortran ]
|
||||||
++ (stdenv.lib.optionals (mpi != null) [ mpi ]);
|
++ (stdenv.lib.optionals (mpi != null) [ mpi ]);
|
||||||
|
|
||||||
configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];
|
configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchurl
|
{ stdenv, fetchurl
|
||||||
, gfortran, openblas
|
, gfortran, blas, lapack
|
||||||
, mpi ? null, scalapack
|
, mpi ? null, scalapack
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation {
|
||||||
inherit mpi;
|
inherit mpi;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ openblas gfortran ]
|
buildInputs = [ blas lapack gfortran ]
|
||||||
++ (stdenv.lib.optionals (mpi != null) [ mpi scalapack ]);
|
++ (stdenv.lib.optionals (mpi != null) [ mpi scalapack ]);
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -33,11 +33,11 @@ stdenv.mkDerivation {
|
||||||
makeFlagsArray=(
|
makeFlagsArray=(
|
||||||
CC="mpicc" FC="mpifort"
|
CC="mpicc" FC="mpifort"
|
||||||
FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
|
FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
|
||||||
COMP_LIBS="" LIBS="-lopenblas -lscalapack"
|
COMP_LIBS="" LIBS="-lblas -llapack -lscalapack"
|
||||||
);
|
);
|
||||||
'' else ''
|
'' else ''
|
||||||
makeFlagsArray=(
|
makeFlagsArray=(
|
||||||
COMP_LIBS="" LIBS="-lopenblas"
|
COMP_LIBS="" LIBS="-lblas -llapack"
|
||||||
);
|
);
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# data, compression
|
# data, compression
|
||||||
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
|
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
|
||||||
# maths
|
# maths
|
||||||
, openblasCompat, eigen, nlopt, lp_solve, colpack, liblapack, glpk
|
, blas, lapack, eigen, nlopt, lp_solve, colpack, glpk
|
||||||
# libraries
|
# libraries
|
||||||
, libarchive, libxml2
|
, libarchive, libxml2
|
||||||
# extra support
|
# extra support
|
||||||
|
@ -13,6 +13,8 @@
|
||||||
assert pythonSupport -> pythonPackages != null;
|
assert pythonSupport -> pythonPackages != null;
|
||||||
assert opencvSupport -> opencv != null;
|
assert opencvSupport -> opencv != null;
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
let
|
let
|
||||||
pname = "shogun";
|
pname = "shogun";
|
||||||
version = "6.1.4";
|
version = "6.1.4";
|
||||||
|
@ -64,8 +66,8 @@ stdenv.mkDerivation rec {
|
||||||
CCACHE_DIR=".ccache";
|
CCACHE_DIR=".ccache";
|
||||||
|
|
||||||
buildInputs = with lib; [
|
buildInputs = with lib; [
|
||||||
openblasCompat bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
|
blas lapack bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
|
||||||
protobuf nlopt snappy swig (libarchive.dev) libxml2 liblapack glpk
|
protobuf nlopt snappy swig (libarchive.dev) libxml2 lapack glpk
|
||||||
]
|
]
|
||||||
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
|
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
|
||||||
++ optional (opencvSupport) opencv;
|
++ optional (opencvSupport) opencv;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
|
{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
|
||||||
, libtiff, ncurses, pango, pcre, perl, readline, tcl, texLive, tk, xz, zlib
|
, libtiff, ncurses, pango, pcre, perl, readline, tcl, texLive, tk, xz, zlib
|
||||||
, less, texinfo, graphviz, icu, pkgconfig, bison, imake, which, jdk, openblas
|
, less, texinfo, graphviz, icu, pkgconfig, bison, imake, which, jdk, blas, lapack
|
||||||
, curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch
|
, curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch
|
||||||
, withRecommendedPackages ? true
|
, withRecommendedPackages ? true
|
||||||
, enableStrictBarrier ? false
|
, enableStrictBarrier ? false
|
||||||
|
@ -9,6 +9,8 @@
|
||||||
, static ? false
|
, static ? false
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "R-3.6.3";
|
name = "R-3.6.3";
|
||||||
|
|
||||||
|
@ -22,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
|
bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
|
||||||
pango pcre perl readline texLive xz zlib less texinfo graphviz icu
|
pango pcre perl readline texLive xz zlib less texinfo graphviz icu
|
||||||
pkgconfig bison imake which openblas curl tcl tk jdk
|
pkgconfig bison imake which blas lapack curl tcl tk jdk
|
||||||
] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ];
|
] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
|
@ -43,8 +45,8 @@ stdenv.mkDerivation rec {
|
||||||
configureFlagsArray=(
|
configureFlagsArray=(
|
||||||
--disable-lto
|
--disable-lto
|
||||||
--with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
|
--with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
|
||||||
--with-blas="-L${openblas}/lib -lopenblas"
|
--with-blas="-L${blas}/lib -lblas"
|
||||||
--with-lapack="-L${openblas}/lib -lopenblas"
|
--with-lapack="-L${lapack}/lib -llapack"
|
||||||
--with-readline
|
--with-readline
|
||||||
--with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh"
|
--with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh"
|
||||||
--with-cairo
|
--with-cairo
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
, opencv3
|
, opencv3
|
||||||
, protobuf
|
, protobuf
|
||||||
, doxygen
|
, doxygen
|
||||||
, openblas
|
, blas
|
||||||
, Accelerate, CoreGraphics, CoreVideo
|
, Accelerate, CoreGraphics, CoreVideo
|
||||||
, lmdbSupport ? true, lmdb
|
, lmdbSupport ? true, lmdb
|
||||||
, leveldbSupport ? true, leveldb, snappy
|
, leveldbSupport ? true, leveldb, snappy
|
||||||
|
@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
|
||||||
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
|
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
|
||||||
++ ["-DUSE_LMDB=${toggle lmdbSupport}"];
|
++ ["-DUSE_LMDB=${toggle lmdbSupport}"];
|
||||||
|
|
||||||
buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv3 openblas ]
|
buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv3 blas ]
|
||||||
++ lib.optional cudaSupport cudatoolkit
|
++ lib.optional cudaSupport cudatoolkit
|
||||||
++ lib.optional cudnnSupport cudnn
|
++ lib.optional cudnnSupport cudnn
|
||||||
++ lib.optional lmdbSupport lmdb
|
++ lib.optional lmdbSupport lmdb
|
||||||
|
|
|
@ -15,7 +15,7 @@ index 9cab2fc..6e977b8 100755
|
||||||
OCCXMAIN = $(SCCXMAIN:.c=.o)
|
OCCXMAIN = $(SCCXMAIN:.c=.o)
|
||||||
|
|
||||||
-DIR=../../../SPOOLES.2.2
|
-DIR=../../../SPOOLES.2.2
|
||||||
+LIBS = -lpthread -lm -lc -lspooles -larpack -lopenblas
|
+LIBS = -lpthread -lm -lc -lspooles -larpack -lblas -llapack
|
||||||
|
|
||||||
-LIBS = \
|
-LIBS = \
|
||||||
- $(DIR)/spooles.a \
|
- $(DIR)/spooles.a \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, gfortran, arpack, spooles, openblas }:
|
{ stdenv, fetchurl, gfortran, arpack, spooles, blas, lapack }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "calculix";
|
pname = "calculix";
|
||||||
|
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ gfortran ];
|
nativeBuildInputs = [ gfortran ];
|
||||||
|
|
||||||
buildInputs = [ arpack spooles openblas ];
|
buildInputs = [ arpack spooles blas lapack ];
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles";
|
NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles";
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
{ lib, stdenv, fetchgit, fetchFromGitHub, cmake
|
{ lib, stdenv, fetchgit, fetchFromGitHub, cmake
|
||||||
, openblas, opencv3, libzip, boost, protobuf, openmpi
|
, openblas, blas, lapack, opencv3, libzip, boost, protobuf, openmpi
|
||||||
, onebitSGDSupport ? false
|
, onebitSGDSupport ? false
|
||||||
, cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
|
, cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
|
||||||
, cudnnSupport ? cudaSupport, cudnn
|
, cudnnSupport ? cudaSupport, cudnn
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert cudnnSupport -> cudaSupport;
|
assert cudnnSupport -> cudaSupport;
|
||||||
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
let
|
let
|
||||||
# Old specific version required for CNTK.
|
# Old specific version required for CNTK.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ lib, stdenv, fetchurl, blas, gfortran, liblapack }:
|
{ lib, stdenv, fetchurl, blas, gfortran, lapack }:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "csdp-6.1.1";
|
name = "csdp-6.1.1";
|
||||||
|
@ -8,7 +8,7 @@ stdenv.mkDerivation {
|
||||||
sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05";
|
sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ blas gfortran.cc.lib liblapack ];
|
buildInputs = [ blas gfortran.cc.lib lapack ];
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace Makefile --replace /usr/local/bin $out/bin
|
substituteInPlace Makefile --replace /usr/local/bin $out/bin
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, cmake, gfortran, openblas, openmpi, petsc, python3 }:
|
{ stdenv, fetchurl, cmake, gfortran, blas, lapack, openmpi, petsc, python3 }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "getdp-${version}";
|
name = "getdp-${version}";
|
||||||
|
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake gfortran ];
|
nativeBuildInputs = [ cmake gfortran ];
|
||||||
buildInputs = [ openblas openmpi petsc python3 ];
|
buildInputs = [ blas lapack openmpi petsc python3 ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A General Environment for the Treatment of Discrete Problems";
|
description = "A General Environment for the Treatment of Discrete Problems";
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
{ stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, liblapack
|
{ stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, lapack, blas
|
||||||
, gmp, mpfr, pari, ntl, gsl, blas, mpfi, ecm, glpk, nauty
|
, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
|
||||||
, readline, gettext, libpng, libao, gfortran, perl
|
, readline, gettext, libpng, libao, gfortran, perl
|
||||||
, enableGUI ? false, libGL ? null, libGLU ? null, xorg ? null, fltk ? null
|
, enableGUI ? false, libGL ? null, libGLU ? null, xorg ? null, fltk ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert enableGUI -> libGLU != null && libGL != null && xorg != null && fltk != null;
|
assert enableGUI -> libGLU != null && libGL != null && xorg != null && fltk != null;
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
|
pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
|
||||||
|
@ -41,7 +42,7 @@ stdenv.mkDerivation rec {
|
||||||
# gfortran.cc default output contains static libraries compiled without -fPIC
|
# gfortran.cc default output contains static libraries compiled without -fPIC
|
||||||
# we want libgfortran.so.3 instead
|
# we want libgfortran.so.3 instead
|
||||||
(stdenv.lib.getLib gfortran.cc)
|
(stdenv.lib.getLib gfortran.cc)
|
||||||
liblapack
|
lapack blas
|
||||||
] ++ stdenv.lib.optionals enableGUI [
|
] ++ stdenv.lib.optionals enableGUI [
|
||||||
libGL libGLU fltk xorg.libX11
|
libGL libGLU fltk xorg.libX11
|
||||||
];
|
];
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
{ stdenv, fetchurl, cmake, openblasCompat, gfortran, gmm, fltk, libjpeg
|
{ stdenv, fetchurl, cmake, blas, lapack, gfortran, gmm, fltk, libjpeg
|
||||||
, zlib, libGL, libGLU, xorg, opencascade-occt }:
|
, zlib, libGL, libGLU, xorg, opencascade-occt }:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "gmsh";
|
pname = "gmsh";
|
||||||
version = "4.5.6";
|
version = "4.5.6";
|
||||||
|
@ -10,7 +12,7 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "0gs65bgr1ph5lz7r6manqj8cra30s7c94pxilkd2z0p5vq6fpsj6";
|
sha256 = "0gs65bgr1ph5lz7r6manqj8cra30s7c94pxilkd2z0p5vq6fpsj6";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ openblasCompat gmm fltk libjpeg zlib libGLU libGL
|
buildInputs = [ blas lapack gmm fltk libjpeg zlib libGLU libGL
|
||||||
libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes xorg.libXext
|
libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes xorg.libXext
|
||||||
xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE
|
xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE
|
||||||
opencascade-occt
|
opencascade-occt
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{stdenv, fetchurl, gfortran, openblas}:
|
{stdenv, fetchurl, gfortran, blas, lapack}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "JAGS-4.3.0";
|
name = "JAGS-4.3.0";
|
||||||
|
@ -6,8 +6,8 @@ stdenv.mkDerivation rec {
|
||||||
url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
|
url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
|
||||||
sha256 = "1z3icccg2ic56vmhyrpinlsvpq7kcaflk1731rgpvz9bk1bxvica";
|
sha256 = "1z3icccg2ic56vmhyrpinlsvpq7kcaflk1731rgpvz9bk1bxvica";
|
||||||
};
|
};
|
||||||
buildInputs = [gfortran openblas];
|
buildInputs = [gfortran blas lapack];
|
||||||
configureFlags = [ "--with-blas=-lopenblas" "--with-lapack=-lopenblas" ];
|
configureFlags = [ "--with-blas=-lblas" "--with-lapack=-llapack" ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Just Another Gibbs Sampler";
|
description = "Just Another Gibbs Sampler";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ config, stdenv, lib, fetchurl, bash, cmake
|
{ config, stdenv, lib, fetchurl, bash, cmake
|
||||||
, opencv3, gtest, openblas, liblapack, perl
|
, opencv3, gtest, blas, perl
|
||||||
, cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11
|
, cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11
|
||||||
, cudnnSupport ? cudaSupport, cudnn
|
, cudnnSupport ? cudaSupport, cudnn
|
||||||
}:
|
}:
|
||||||
|
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake perl ];
|
nativeBuildInputs = [ cmake perl ];
|
||||||
|
|
||||||
buildInputs = [ opencv3 gtest openblas liblapack ]
|
buildInputs = [ opencv3 gtest blas ]
|
||||||
++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
|
++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
|
||||||
++ lib.optional cudnnSupport cudnn;
|
++ lib.optional cudnnSupport cudnn;
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
|
||||||
substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
|
substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
|
||||||
--replace "/bin/bash" "${bash}/bin/bash"
|
--replace "/bin/bash" "${bash}/bin/bash"
|
||||||
|
|
||||||
# Build against the system version of OpenMP.
|
# Build against the system version of OpenMP.
|
||||||
# https://github.com/apache/incubator-mxnet/pull/12160
|
# https://github.com/apache/incubator-mxnet/pull/12160
|
||||||
rm -rf 3rdparty/openmp
|
rm -rf 3rdparty/openmp
|
||||||
'';
|
'';
|
||||||
|
|
|
@ -41,7 +41,8 @@
|
||||||
, lcalc
|
, lcalc
|
||||||
, rubiks
|
, rubiks
|
||||||
, flintqs
|
, flintqs
|
||||||
, openblasCompat
|
, blas
|
||||||
|
, lapack
|
||||||
, flint
|
, flint
|
||||||
, gmp
|
, gmp
|
||||||
, mpfr
|
, mpfr
|
||||||
|
@ -53,6 +54,8 @@
|
||||||
, less
|
, less
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
# This generates a `sage-env` shell file that will be sourced by sage on startup.
|
# This generates a `sage-env` shell file that will be sourced by sage on startup.
|
||||||
# It sets up various environment variables, telling sage where to find its
|
# It sets up various environment variables, telling sage where to find its
|
||||||
# dependencies.
|
# dependencies.
|
||||||
|
@ -114,7 +117,7 @@ writeTextFile rec {
|
||||||
# testsuite instead, but since all the packages are also runtime
|
# testsuite instead, but since all the packages are also runtime
|
||||||
# dependencies it doesn't really hurt to include them here.
|
# dependencies it doesn't really hurt to include them here.
|
||||||
singular
|
singular
|
||||||
openblasCompat
|
blas lapack
|
||||||
fflas-ffpack givaro
|
fflas-ffpack givaro
|
||||||
gd
|
gd
|
||||||
libpng zlib
|
libpng zlib
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
, lib
|
, lib
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, sage-env
|
, sage-env
|
||||||
, openblasCompat
|
, blas
|
||||||
|
, lapack
|
||||||
, pkg-config
|
, pkg-config
|
||||||
, three
|
, three
|
||||||
, singular
|
, singular
|
||||||
|
@ -21,6 +22,9 @@
|
||||||
, pythonEnv
|
, pythonEnv
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
# lots of segfaults with (64 bit) blas
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
# Wrapper that combined `sagelib` with `sage-env` to produce an actually
|
# Wrapper that combined `sagelib` with `sage-env` to produce an actually
|
||||||
# executable sage. No tests are run yet and no documentation is built.
|
# executable sage. No tests are run yet and no documentation is built.
|
||||||
|
|
||||||
|
@ -29,7 +33,7 @@ let
|
||||||
pythonEnv # for patchShebangs
|
pythonEnv # for patchShebangs
|
||||||
makeWrapper
|
makeWrapper
|
||||||
pkg-config
|
pkg-config
|
||||||
openblasCompat # lots of segfaults with regular (64 bit) openblas
|
blas lapack
|
||||||
singular
|
singular
|
||||||
three
|
three
|
||||||
pynac
|
pynac
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
, perl
|
, perl
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, arb
|
, arb
|
||||||
, openblasCompat
|
, blas
|
||||||
|
, lapack
|
||||||
, brial
|
, brial
|
||||||
, cliquer
|
, cliquer
|
||||||
, cypari2
|
, cypari2
|
||||||
|
@ -52,6 +53,8 @@
|
||||||
, pplpy
|
, pplpy
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
# This is the core sage python package. Everything else is just wrappers gluing
|
# This is the core sage python package. Everything else is just wrappers gluing
|
||||||
# stuff together. It is not very useful on its own though, since it will not
|
# stuff together. It is not very useful on its own though, since it will not
|
||||||
# find many of its dependencies without `sage-env`, will not be tested without
|
# find many of its dependencies without `sage-env`, will not be tested without
|
||||||
|
@ -103,7 +106,8 @@ buildPythonPackage rec {
|
||||||
m4rie
|
m4rie
|
||||||
mpfi
|
mpfi
|
||||||
ntl
|
ntl
|
||||||
openblasCompat
|
blas
|
||||||
|
lapack
|
||||||
pari
|
pari
|
||||||
planarity
|
planarity
|
||||||
ppl
|
ppl
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
|
{stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
|
||||||
hwloc, jre, liblapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which,
|
hwloc, jre, lapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which,
|
||||||
lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison,
|
lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison,
|
||||||
doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
|
doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ stdenv.mkDerivation {
|
||||||
src = fetchgit (import ./src-main.nix);
|
src = fetchgit (import ./src-main.nix);
|
||||||
|
|
||||||
buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
|
buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
|
||||||
hwloc jre liblapack blas hdf5 expat ncurses readline qt4 webkitgtk which
|
hwloc jre lapack blas hdf5 expat ncurses readline qt4 webkitgtk which
|
||||||
lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison
|
lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison
|
||||||
doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu
|
doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu
|
||||||
git gtk2 makeWrapper];
|
git gtk2 makeWrapper];
|
||||||
|
@ -40,7 +40,7 @@ stdenv.mkDerivation {
|
||||||
for e in $(cd $out/bin && ls); do
|
for e in $(cd $out/bin && ls); do
|
||||||
wrapProgram $out/bin/$e \
|
wrapProgram $out/bin/$e \
|
||||||
--prefix PATH : "${gnumake}/bin" \
|
--prefix PATH : "${gnumake}/bin" \
|
||||||
--prefix LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ liblapack blas ]}"
|
--prefix LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ lapack blas ]}"
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -53,5 +53,3 @@ stdenv.mkDerivation {
|
||||||
broken = true;
|
broken = true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchFromGitHub
|
{ stdenv, fetchFromGitHub
|
||||||
, libpng, gzip, fftw, openblas
|
, libpng, gzip, fftw, blas, lapack
|
||||||
, mpi ? null
|
, mpi ? null
|
||||||
}:
|
}:
|
||||||
let packages = [
|
let packages = [
|
||||||
|
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
||||||
inherit packages;
|
inherit packages;
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ fftw libpng openblas gzip ]
|
buildInputs = [ fftw libpng blas lapack gzip ]
|
||||||
++ (stdenv.lib.optionals withMPI [ mpi ]);
|
++ (stdenv.lib.optionals withMPI [ mpi ]);
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, apfel, apfelgrid, applgrid, blas, gfortran, lhapdf, liblapack, libyaml, lynx, mela, root5, qcdnum, which }:
|
{ stdenv, fetchurl, apfel, apfelgrid, applgrid, blas, gfortran, lhapdf, lapack, libyaml, lynx, mela, root5, qcdnum, which }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "xfitter";
|
pname = "xfitter";
|
||||||
|
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = [ gfortran which ];
|
nativeBuildInputs = [ gfortran which ];
|
||||||
buildInputs =
|
buildInputs =
|
||||||
[ apfel apfelgrid applgrid blas lhapdf liblapack mela root5 qcdnum ]
|
[ apfel apfelgrid applgrid blas lhapdf lapack mela root5 qcdnum ]
|
||||||
# pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin
|
# pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin
|
||||||
++ stdenv.lib.optional (!stdenv.isDarwin) libyaml
|
++ stdenv.lib.optional (!stdenv.isDarwin) libyaml
|
||||||
;
|
;
|
||||||
|
|
137
pkgs/build-support/alternatives/blas/default.nix
Normal file
137
pkgs/build-support/alternatives/blas/default.nix
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
{ lib, stdenv
|
||||||
|
, lapack-reference, openblasCompat, openblas
|
||||||
|
, is64bit ? false
|
||||||
|
, blasProvider ? if is64bit then openblas else openblasCompat }:
|
||||||
|
|
||||||
|
let
|
||||||
|
blasFortranSymbols = [
|
||||||
|
"caxpy" "ccopy" "cdotc" "cdotu" "cgbmv" "cgemm" "cgemv" "cgerc" "cgeru"
|
||||||
|
"chbmv" "chemm" "chemv" "cher" "cher2" "cher2k" "cherk" "chpmv" "chpr"
|
||||||
|
"chpr2" "crotg" "cscal" "csrot" "csscal" "cswap" "csymm" "csyr2k" "csyrk"
|
||||||
|
"ctbmv" "ctbsv" "ctpmv" "ctpsv" "ctrmm" "ctrmv" "ctrsm" "ctrsv" "dasum"
|
||||||
|
"daxpy" "dcabs1" "dcopy" "ddot" "dgbmv" "dgemm" "dgemv" "dger" "dnrm2"
|
||||||
|
"drot" "drotg" "drotm" "drotmg" "dsbmv" "dscal" "dsdot" "dspmv" "dspr"
|
||||||
|
"dspr2" "dswap" "dsymm" "dsymv" "dsyr" "dsyr2" "dsyr2k" "dsyrk" "dtbmv"
|
||||||
|
"dtbsv" "dtpmv" "dtpsv" "dtrmm" "dtrmv" "dtrsm" "dtrsv" "dzasum" "dznrm2"
|
||||||
|
"icamax" "idamax" "isamax" "izamax" "lsame" "sasum" "saxpy" "scabs1"
|
||||||
|
"scasum" "scnrm2" "scopy" "sdot" "sdsdot" "sgbmv" "sgemm" "sgemv"
|
||||||
|
"sger" "snrm2" "srot" "srotg" "srotm" "srotmg" "ssbmv" "sscal" "sspmv"
|
||||||
|
"sspr" "sspr2" "sswap" "ssymm" "ssymv" "ssyr" "ssyr2" "ssyr2k" "ssyrk"
|
||||||
|
"stbmv" "stbsv" "stpmv" "stpsv" "strmm" "strmv" "strsm" "strsv" "xerbla"
|
||||||
|
"xerbla_array" "zaxpy" "zcopy" "zdotc" "zdotu" "zdrot" "zdscal" "zgbmv"
|
||||||
|
"zgemm" "zgemv" "zgerc" "zgeru" "zhbmv" "zhemm" "zhemv" "zher" "zher2"
|
||||||
|
"zher2k" "zherk" "zhpmv" "zhpr" "zhpr2" "zrotg" "zscal" "zswap" "zsymm"
|
||||||
|
"zsyr2k" "zsyrk" "ztbmv" "ztbsv" "ztpmv" "ztpsv" "ztrmm" "ztrmv" "ztrsm"
|
||||||
|
"ztrsv"
|
||||||
|
];
|
||||||
|
|
||||||
|
version = "3";
|
||||||
|
canonicalExtension = if stdenv.hostPlatform.isLinux
|
||||||
|
then "${stdenv.hostPlatform.extensions.sharedLibrary}.${version}"
|
||||||
|
else stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
|
|
||||||
|
|
||||||
|
is64bit = blasProvider.blas64 or false;
|
||||||
|
blasImplementation = lib.getName blasProvider;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
assert is64bit -> (blasImplementation == "openblas" && blasProvider.blas64) || blasImplementation == "mkl";
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "blas";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
|
meta = (blasProvider.meta or {}) // {
|
||||||
|
description = "${lib.getName blasProvider} with just the BLAS C and FORTRAN ABI";
|
||||||
|
};
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit is64bit;
|
||||||
|
provider = blasProvider;
|
||||||
|
implementation = blasImplementation;
|
||||||
|
};
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
dontConfigure = true;
|
||||||
|
unpackPhase = "src=$PWD";
|
||||||
|
|
||||||
|
installPhase = (''
|
||||||
|
mkdir -p $out/lib $dev/include $dev/include/pkgconfig
|
||||||
|
|
||||||
|
libblas="${lib.getLib blasProvider}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
|
||||||
|
if ! [ -e "$libblas" ]; then
|
||||||
|
echo "$libblas does not exist, ${blasProvider.name} does not provide libblas."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
nm -an "$libblas" | cut -f3 -d' ' > symbols
|
||||||
|
for symbol in ${toString blasFortranSymbols}; do
|
||||||
|
grep "^$symbol_$" symbols || { echo "$symbol" was not found in "$libblas"; exit 1; }
|
||||||
|
done
|
||||||
|
|
||||||
|
cp -L "$libblas" $out/lib/libblas${canonicalExtension}
|
||||||
|
chmod +w $out/lib/libblas${canonicalExtension}
|
||||||
|
|
||||||
|
'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then ''
|
||||||
|
patchelf --set-soname libblas${canonicalExtension} $out/lib/libblas${canonicalExtension}
|
||||||
|
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/libblas${canonicalExtension}):${lib.getLib blasProvider}/lib" $out/lib/libblas${canonicalExtension}
|
||||||
|
'' else if stdenv.hostPlatform.isDarwin then ''
|
||||||
|
install_name_tool \
|
||||||
|
-id libblas${canonicalExtension}
|
||||||
|
-add_rpath ${lib.getLib blasProvider}/lib \
|
||||||
|
$out/lib/libblas${canonicalExtension}
|
||||||
|
'' else "") + ''
|
||||||
|
|
||||||
|
if [ "$out/lib/libblas${canonicalExtension}" != "$out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; then
|
||||||
|
ln -s $out/lib/libblas${canonicalExtension} "$out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat <<EOF > $dev/lib/pkgconfig/blas.pc
|
||||||
|
Name: blas
|
||||||
|
Version: ${version}
|
||||||
|
Description: BLAS FORTRAN implementation
|
||||||
|
Libs: -L$out/lib -lblas
|
||||||
|
Cflags: -I$dev/include
|
||||||
|
EOF
|
||||||
|
|
||||||
|
libcblas="${lib.getLib blasProvider}/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
|
||||||
|
if ! [ -e "$libcblas" ]; then
|
||||||
|
echo "$libcblas does not exist, ${blasProvider.name} does not provide libcblas."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -L "$libcblas" $out/lib/libcblas${canonicalExtension}
|
||||||
|
chmod +w $out/lib/libcblas${canonicalExtension}
|
||||||
|
|
||||||
|
'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then ''
|
||||||
|
patchelf --set-soname libcblas${canonicalExtension} $out/lib/libcblas${canonicalExtension}
|
||||||
|
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/libcblas${canonicalExtension}):${lib.getLib blasProvider}/lib" $out/lib/libcblas${canonicalExtension}
|
||||||
|
'' else if stdenv.hostPlatform.isDarwin then ''
|
||||||
|
install_name_tool \
|
||||||
|
-id libcblas${canonicalExtension} \
|
||||||
|
-add_rpath ${lib.getLib blasProvider}/lib \
|
||||||
|
$out/lib/libcblas${canonicalExtension}
|
||||||
|
'' else "") + ''
|
||||||
|
if [ "$out/lib/libcblas${canonicalExtension}" != "$out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; then
|
||||||
|
ln -s $out/lib/libcblas${canonicalExtension} "$out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp ${lib.getDev lapack-reference}/include/cblas{,_mangling}.h $dev/include
|
||||||
|
|
||||||
|
cat <<EOF > $dev/lib/pkgconfig/cblas.pc
|
||||||
|
Name: cblas
|
||||||
|
Version: ${version}
|
||||||
|
Description: BLAS C implementation
|
||||||
|
Cflags: -I$dev/include
|
||||||
|
Libs: -L$out/lib -lcblas
|
||||||
|
EOF
|
||||||
|
'' + stdenv.lib.optionalString (blasImplementation == "mkl") ''
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString is64bit "I"}LP64,GNU' > $out/nix-support/setup-hook
|
||||||
|
'');
|
||||||
|
}
|
111
pkgs/build-support/alternatives/lapack/default.nix
Normal file
111
pkgs/build-support/alternatives/lapack/default.nix
Normal file
|
@ -0,0 +1,111 @@
|
||||||
|
{ lib, stdenv
|
||||||
|
, lapack-reference, openblasCompat, openblas
|
||||||
|
, is64bit ? false
|
||||||
|
, lapackProvider ? if is64bit then openblas else openblasCompat }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
version = "3";
|
||||||
|
canonicalExtension = if stdenv.hostPlatform.isLinux
|
||||||
|
then "${stdenv.hostPlatform.extensions.sharedLibrary}.${version}"
|
||||||
|
else stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
|
|
||||||
|
lapackImplementation = lib.getName lapackProvider;
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
assert is64bit -> (lapackImplementation == "openblas" && lapackProvider.blas64) || lapackImplementation == "mkl";
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "lapack";
|
||||||
|
inherit version;
|
||||||
|
|
||||||
|
outputs = [ "out" "dev" ];
|
||||||
|
|
||||||
|
meta = (lapackProvider.meta or {}) // {
|
||||||
|
description = "${lib.getName lapackProvider} with just the LAPACK C and FORTRAN ABI";
|
||||||
|
};
|
||||||
|
|
||||||
|
passthru = {
|
||||||
|
inherit is64bit;
|
||||||
|
provider = lapackProvider;
|
||||||
|
implementation = lapackImplementation;
|
||||||
|
};
|
||||||
|
|
||||||
|
dontBuild = true;
|
||||||
|
dontConfigure = true;
|
||||||
|
unpackPhase = "src=$PWD";
|
||||||
|
|
||||||
|
installPhase = (''
|
||||||
|
mkdir -p $out/lib $dev/include $dev/lib/pkgconfig
|
||||||
|
|
||||||
|
liblapack="${lib.getLib lapackProvider}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
|
||||||
|
if ! [ -e "$liblapack" ]; then
|
||||||
|
echo "$liblapack does not exist, ${lapackProvider.name} does not provide liblapack."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -L "$liblapack" $out/lib/liblapack${canonicalExtension}
|
||||||
|
chmod +w $out/lib/liblapack${canonicalExtension}
|
||||||
|
|
||||||
|
'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then ''
|
||||||
|
patchelf --set-soname liblapack${canonicalExtension} $out/lib/liblapack${canonicalExtension}
|
||||||
|
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/liblapack${canonicalExtension}):${lapackProvider}/lib" $out/lib/liblapack${canonicalExtension}
|
||||||
|
'' else if stdenv.hostPlatform.isDarwin then ''
|
||||||
|
install_name_tool -id liblapack${canonicalExtension} \
|
||||||
|
-add_rpath ${lib.getLib lapackProvider}/lib \
|
||||||
|
$out/lib/liblapack${canonicalExtension}
|
||||||
|
'' else "") + ''
|
||||||
|
|
||||||
|
if [ "$out/lib/liblapack${canonicalExtension}" != "$out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}" ]; then
|
||||||
|
ln -s $out/lib/liblapack${canonicalExtension} "$out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
install -D ${lib.getDev lapack-reference}/include/lapack.h $dev/include/lapack.h
|
||||||
|
|
||||||
|
cat <<EOF > $dev/lib/pkgconfig/lapack.pc
|
||||||
|
Name: lapack
|
||||||
|
Version: ${version}
|
||||||
|
Description: LAPACK FORTRAN implementation
|
||||||
|
Cflags: -I$dev/include
|
||||||
|
Libs: -L$out/lib -llapack
|
||||||
|
EOF
|
||||||
|
|
||||||
|
liblapacke="${lib.getLib lapackProvider}/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
|
|
||||||
|
if ! [ -e "$liblapacke" ]; then
|
||||||
|
echo "$liblapacke does not exist, ${lapackProvider.name} does not provide liblapacke."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp -L "$liblapacke" $out/lib/liblapacke${canonicalExtension}
|
||||||
|
chmod +w $out/lib/liblapacke${canonicalExtension}
|
||||||
|
|
||||||
|
'' + (if stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf" then ''
|
||||||
|
patchelf --set-soname liblapacke${canonicalExtension} $out/lib/liblapacke${canonicalExtension}
|
||||||
|
patchelf --set-rpath "$(patchelf --print-rpath $out/lib/liblapacke${canonicalExtension}):${lib.getLib lapackProvider}/lib" $out/lib/liblapacke${canonicalExtension}
|
||||||
|
'' else if stdenv.hostPlatform.isDarwin then ''
|
||||||
|
install_name_tool -id liblapacke${canonicalExtension} \
|
||||||
|
-add_rpath ${lib.getLib lapackProvider}/lib \
|
||||||
|
$out/lib/liblapacke${canonicalExtension}
|
||||||
|
'' else "") + ''
|
||||||
|
|
||||||
|
if [ -f "$out/lib/liblapacke.so.3" ]; then
|
||||||
|
ln -s $out/lib/liblapacke.so.3 $out/lib/liblapacke.so
|
||||||
|
fi
|
||||||
|
|
||||||
|
cp ${lib.getDev lapack-reference}/include/lapacke{,_mangling,_config}.h $dev/include
|
||||||
|
|
||||||
|
cat <<EOF > $dev/lib/pkgconfig/lapacke.pc
|
||||||
|
Name: lapacke
|
||||||
|
Version: ${version}
|
||||||
|
Description: LAPACK C implementation
|
||||||
|
Cflags: -I$dev/include
|
||||||
|
Libs: -L$out/lib -llapacke
|
||||||
|
EOF
|
||||||
|
'' + stdenv.lib.optionalString (lapackImplementation == "mkl") ''
|
||||||
|
mkdir -p $out/nix-support
|
||||||
|
echo 'export MKL_INTERFACE_LAYER=${lib.optionalString is64bit "I"}LP64,GNU' > $out/nix-support/setup-hook
|
||||||
|
'');
|
||||||
|
}
|
37
pkgs/build-support/setup-hooks/audit-blas.sh
Normal file
37
pkgs/build-support/setup-hooks/audit-blas.sh
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Ensure that we are always linking against “libblas.so.3” and
|
||||||
|
# “liblapack.so.3”.
|
||||||
|
|
||||||
|
auditBlas() {
|
||||||
|
local dir="$prefix"
|
||||||
|
[ -e "$dir" ] || return 0
|
||||||
|
|
||||||
|
local i
|
||||||
|
while IFS= read -r -d $'\0' i; do
|
||||||
|
if ! isELF "$i"; then continue; fi
|
||||||
|
|
||||||
|
if $OBJDUMP -p "$i" | grep 'NEEDED' | awk '{ print $2; }' | grep -q '\(libmkl_rt.so\|libopenblas.so.0\)'; then
|
||||||
|
echo "$i refers to a specific implementation of BLAS or LAPACK."
|
||||||
|
echo "This prevents users from switching BLAS/LAPACK implementations."
|
||||||
|
echo "Add \`blas' or \`lapack' to buildInputs instead of \`mkl' or \`openblas'."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
(IFS=:
|
||||||
|
for dir in "$(patchelf --print-rpath "$i")"; do
|
||||||
|
if [ -f "$dir/libblas.so.3" ] || [ -f "$dir/libblas.so" ]; then
|
||||||
|
if [ "$dir" != "@blas@/lib" ]; then
|
||||||
|
echo "$dir is not allowed to contain a library named libblas.so.3"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ -f "$dir/liblapack.so.3" ] || [ -f "$dir/liblapack.so" ]; then
|
||||||
|
if [ "$dir" != "@lapack@/lib" ]; then
|
||||||
|
echo "$dir is not allowed to contain a library named liblapack.so.3"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done)
|
||||||
|
done < <(find "$dir" -type f -print0)
|
||||||
|
}
|
||||||
|
|
||||||
|
fixupOutputHooks+=(auditBlas)
|
|
@ -1,7 +1,10 @@
|
||||||
{ llvmPackages, lib, fetchFromGitHub, cmake
|
{ llvmPackages, lib, fetchFromGitHub, cmake
|
||||||
, libpng, libjpeg, mesa, eigen, openblas
|
, libpng, libjpeg, mesa, eigen
|
||||||
|
, openblas, blas, lapack
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "2019_08_27";
|
version = "2019_08_27";
|
||||||
|
|
||||||
|
|
|
@ -7,28 +7,22 @@
|
||||||
# standard library dependencies
|
# standard library dependencies
|
||||||
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
||||||
# linear algebra
|
# linear algebra
|
||||||
, openblas, arpack
|
, blas, lapack, arpack
|
||||||
# Darwin frameworks
|
# Darwin frameworks
|
||||||
, CoreServices, ApplicationServices
|
, CoreServices, ApplicationServices
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
# All dependencies must use the same OpenBLAS.
|
|
||||||
let
|
let
|
||||||
arpack_ = arpack;
|
|
||||||
in
|
|
||||||
let
|
|
||||||
arpack = arpack_.override { inherit openblas; };
|
|
||||||
in
|
|
||||||
|
|
||||||
let
|
|
||||||
majorVersion = "1";
|
majorVersion = "1";
|
||||||
minorVersion = "3";
|
minorVersion = "3";
|
||||||
maintenanceVersion = "1";
|
maintenanceVersion = "1";
|
||||||
src_sha256 = "0q9a7yc3b235psrwl5ghyxgwly25lf8n818l8h6bkf2ymdbsv5p6";
|
src_sha256 = "0q9a7yc3b235psrwl5ghyxgwly25lf8n818l8h6bkf2ymdbsv5p6";
|
||||||
version = "${majorVersion}.${minorVersion}.${maintenanceVersion}";
|
version = "${majorVersion}.${minorVersion}.${maintenanceVersion}";
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "julia";
|
pname = "julia";
|
||||||
|
@ -67,7 +61,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
|
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
|
||||||
pcre2.dev openblas openlibm openspecfun readline utf8proc
|
pcre2.dev blas lapack openlibm openspecfun readline utf8proc
|
||||||
zlib
|
zlib
|
||||||
]
|
]
|
||||||
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
|
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
|
||||||
|
@ -94,13 +88,9 @@ stdenv.mkDerivation rec {
|
||||||
"SHELL=${stdenv.shell}"
|
"SHELL=${stdenv.shell}"
|
||||||
|
|
||||||
"USE_SYSTEM_BLAS=1"
|
"USE_SYSTEM_BLAS=1"
|
||||||
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
|
"USE_BLAS64=${if blas.is64bit then "1" else "0"}"
|
||||||
"LIBBLAS=-lopenblas"
|
|
||||||
"LIBBLASNAME=libopenblas"
|
|
||||||
|
|
||||||
"USE_SYSTEM_LAPACK=1"
|
"USE_SYSTEM_LAPACK=1"
|
||||||
"LIBLAPACK=-lopenblas"
|
|
||||||
"LIBLAPACKNAME=libopenblas"
|
|
||||||
|
|
||||||
"USE_SYSTEM_ARPACK=1"
|
"USE_SYSTEM_ARPACK=1"
|
||||||
"USE_SYSTEM_FFTW=1"
|
"USE_SYSTEM_FFTW=1"
|
||||||
|
@ -123,7 +113,7 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
LD_LIBRARY_PATH = makeLibraryPath [
|
LD_LIBRARY_PATH = makeLibraryPath [
|
||||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
|
arpack fftw fftwSinglePrec gmp libgit2 mpfr blas openlibm
|
||||||
openspecfun pcre2
|
openspecfun pcre2
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -15,20 +15,14 @@
|
||||||
# standard library dependencies
|
# standard library dependencies
|
||||||
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
||||||
# linear algebra
|
# linear algebra
|
||||||
, openblas, arpack
|
, blas, lapack, arpack
|
||||||
# Darwin frameworks
|
# Darwin frameworks
|
||||||
, CoreServices, ApplicationServices
|
, CoreServices, ApplicationServices
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
# All dependencies must use the same OpenBLAS.
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
let
|
|
||||||
arpack_ = arpack;
|
|
||||||
in
|
|
||||||
let
|
|
||||||
arpack = arpack_.override { inherit openblas; };
|
|
||||||
in
|
|
||||||
|
|
||||||
let
|
let
|
||||||
dsfmtVersion = "2.2.3";
|
dsfmtVersion = "2.2.3";
|
||||||
|
@ -118,7 +112,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
|
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
|
||||||
pcre2.dev openblas openlibm openspecfun readline utf8proc
|
pcre2.dev blas lapack openlibm openspecfun readline utf8proc
|
||||||
zlib
|
zlib
|
||||||
]
|
]
|
||||||
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
|
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
|
||||||
|
@ -143,13 +137,9 @@ stdenv.mkDerivation rec {
|
||||||
"SHELL=${stdenv.shell}"
|
"SHELL=${stdenv.shell}"
|
||||||
|
|
||||||
"USE_SYSTEM_BLAS=1"
|
"USE_SYSTEM_BLAS=1"
|
||||||
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
|
"USE_BLAS64=${if blas.is64bit then "1" else "0"}"
|
||||||
"LIBBLAS=-lopenblas"
|
|
||||||
"LIBBLASNAME=libopenblas"
|
|
||||||
|
|
||||||
"USE_SYSTEM_LAPACK=1"
|
"USE_SYSTEM_LAPACK=1"
|
||||||
"LIBLAPACK=-lopenblas"
|
|
||||||
"LIBLAPACKNAME=libopenblas"
|
|
||||||
|
|
||||||
"USE_SYSTEM_ARPACK=1"
|
"USE_SYSTEM_ARPACK=1"
|
||||||
"USE_SYSTEM_FFTW=1"
|
"USE_SYSTEM_FFTW=1"
|
||||||
|
@ -173,7 +163,7 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
LD_LIBRARY_PATH = makeLibraryPath [
|
LD_LIBRARY_PATH = makeLibraryPath [
|
||||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
|
arpack fftw fftwSinglePrec gmp libgit2 mpfr blas lapack openlibm
|
||||||
openspecfun pcre2
|
openspecfun pcre2
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -114,13 +114,8 @@ self: super: {
|
||||||
# Depends on broken "hails" package.
|
# Depends on broken "hails" package.
|
||||||
hails-bin = dontDistribute super.hails-bin;
|
hails-bin = dontDistribute super.hails-bin;
|
||||||
|
|
||||||
# Switch levmar build to openblas.
|
|
||||||
bindings-levmar = overrideCabal super.bindings-levmar (drv: {
|
bindings-levmar = overrideCabal super.bindings-levmar (drv: {
|
||||||
preConfigure = ''
|
extraLibraries = [ pkgs.blas ];
|
||||||
sed -i bindings-levmar.cabal \
|
|
||||||
-e 's,extra-libraries: lapack blas,extra-libraries: openblas,'
|
|
||||||
'';
|
|
||||||
extraLibraries = [ pkgs.openblasCompat ];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
# The Haddock phase fails for one reason or another.
|
# The Haddock phase fails for one reason or another.
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
, zlib
|
, zlib
|
||||||
, curl
|
, curl
|
||||||
, qrupdate
|
, qrupdate
|
||||||
, openblas
|
, blas, lapack
|
||||||
, arpack
|
, arpack
|
||||||
, libwebp
|
, libwebp
|
||||||
, gl2ps
|
, gl2ps
|
||||||
|
@ -53,17 +53,7 @@
|
||||||
, darwin
|
, darwin
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
suitesparseOrig = suitesparse;
|
|
||||||
qrupdateOrig = qrupdate;
|
|
||||||
in
|
|
||||||
# integer width is determined by openblas, so all dependencies must be built
|
|
||||||
# with exactly the same openblas
|
|
||||||
let
|
|
||||||
suitesparse =
|
|
||||||
if suitesparseOrig != null then suitesparseOrig.override { inherit openblas; } else null;
|
|
||||||
qrupdate = if qrupdateOrig != null then qrupdateOrig.override { inherit openblas; } else null;
|
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "5.2.0";
|
version = "5.2.0";
|
||||||
|
@ -85,7 +75,8 @@ stdenv.mkDerivation rec {
|
||||||
fltk
|
fltk
|
||||||
zlib
|
zlib
|
||||||
curl
|
curl
|
||||||
openblas
|
blas
|
||||||
|
lapack
|
||||||
libsndfile
|
libsndfile
|
||||||
fftw
|
fftw
|
||||||
fftwSinglePrec
|
fftwSinglePrec
|
||||||
|
@ -134,15 +125,15 @@ stdenv.mkDerivation rec {
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
# See https://savannah.gnu.org/bugs/?50339
|
# See https://savannah.gnu.org/bugs/?50339
|
||||||
F77_INTEGER_8_FLAG = if openblas.blas64 then "-fdefault-integer-8" else "";
|
F77_INTEGER_8_FLAG = if blas.is64bit then "-fdefault-integer-8" else "";
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-blas=openblas"
|
"--with-blas=blas"
|
||||||
"--with-lapack=openblas"
|
"--with-lapack=lapack"
|
||||||
|
(if blas.is64bit then "--enable-64" else "--disable-64")
|
||||||
]
|
]
|
||||||
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ])
|
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ])
|
||||||
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
|
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
|
||||||
++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ]
|
|
||||||
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
|
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
|
||||||
++ stdenv.lib.optionals enableQt [ "--with-qt=5" ]
|
++ stdenv.lib.optionals enableQt [ "--with-qt=5" ]
|
||||||
++ stdenv.lib.optionals enableJIT [ "--enable-jit" ]
|
++ stdenv.lib.optionals enableJIT [ "--enable-jit" ]
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, cmake, openblasCompat, superlu, hdf5 }:
|
{ stdenv, fetchurl, cmake, blas, lapack, superlu, hdf5 }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "armadillo";
|
pname = "armadillo";
|
||||||
|
@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
buildInputs = [ openblasCompat superlu hdf5 ];
|
buildInputs = [ blas lapack superlu hdf5 ];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DLAPACK_LIBRARY=${openblasCompat}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
"-DLAPACK_LIBRARY=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
"-DDETECT_HDF5=ON"
|
"-DDETECT_HDF5=ON"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,12 @@
|
||||||
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
|
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
|
||||||
, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
|
, opencl-clhpp, ocl-icd, fftw, fftwFloat
|
||||||
, blas, openblas, boost, mesa, libGLU, libGL
|
, blas, lapack, boost, mesa, libGLU, libGL
|
||||||
, freeimage, python, clfft, clblas
|
, freeimage, python, clfft, clblas
|
||||||
, doxygen, buildDocs ? false
|
, doxygen, buildDocs ? false
|
||||||
|
, cudaSupport ? false, cudatoolkit
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
strOnLinux = stdenv.lib.optionalString stdenv.isLinux;
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "arrayfire";
|
pname = "arrayfire";
|
||||||
version = "3.6.4";
|
version = "3.6.4";
|
||||||
|
|
||||||
|
@ -21,8 +19,7 @@ in stdenv.mkDerivation rec {
|
||||||
"-DAF_BUILD_OPENCL=OFF"
|
"-DAF_BUILD_OPENCL=OFF"
|
||||||
"-DAF_BUILD_EXAMPLES=OFF"
|
"-DAF_BUILD_EXAMPLES=OFF"
|
||||||
"-DBUILD_TESTING=OFF"
|
"-DBUILD_TESTING=OFF"
|
||||||
(strOnLinux "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs")
|
] ++ stdenv.lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs";
|
||||||
];
|
|
||||||
|
|
||||||
patches = [ ./no-download.patch ];
|
patches = [ ./no-download.patch ];
|
||||||
|
|
||||||
|
@ -35,7 +32,7 @@ in stdenv.mkDerivation rec {
|
||||||
cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
|
cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
|
||||||
'';
|
'';
|
||||||
|
|
||||||
preBuild = strOnLinux ''
|
preBuild = stdenv.lib.optionalString cudaSupport ''
|
||||||
export CUDA_PATH="${cudatoolkit}"
|
export CUDA_PATH="${cudatoolkit}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -49,13 +46,13 @@ in stdenv.mkDerivation rec {
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
opencl-clhpp fftw fftwFloat
|
opencl-clhpp fftw fftwFloat
|
||||||
mkl
|
blas lapack
|
||||||
openblas
|
|
||||||
libGLU libGL
|
libGLU libGL
|
||||||
mesa freeimage
|
mesa freeimage
|
||||||
boost.out boost.dev
|
boost.out boost.dev
|
||||||
] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ])
|
] ++ (stdenv.lib.optional stdenv.isLinux ocl-icd)
|
||||||
++ (stdenv.lib.optional buildDocs [ doxygen ]);
|
++ (stdenv.lib.optional cudaSupport cudatoolkit)
|
||||||
|
++ (stdenv.lib.optional buildDocs doxygen);
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "A general-purpose library for parallel and massively-parallel computations";
|
description = "A general-purpose library for parallel and massively-parallel computations";
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
{ stdenv, fetchFromGitHub, autoreconfHook, givaro, pkgconfig, blas
|
{ stdenv, fetchFromGitHub, autoreconfHook, givaro, pkgconfig, blas, lapack
|
||||||
, gmpxx
|
, gmpxx
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "fflas-ffpack";
|
pname = "fflas-ffpack";
|
||||||
version = "2.4.3";
|
version = "2.4.3";
|
||||||
|
@ -23,11 +26,11 @@ stdenv.mkDerivation rec {
|
||||||
pkgconfig
|
pkgconfig
|
||||||
] ++ stdenv.lib.optionals doCheck checkInputs;
|
] ++ stdenv.lib.optionals doCheck checkInputs;
|
||||||
|
|
||||||
buildInputs = [ givaro blas ];
|
buildInputs = [ givaro blas lapack ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-blas-libs=-l${blas.linkName}"
|
"--with-blas-libs=-lcblas"
|
||||||
"--with-lapack-libs=-l${blas.linkName}"
|
"--with-lapack-libs=-llapacke"
|
||||||
] ++ stdenv.lib.optionals stdenv.isx86_64 {
|
] ++ stdenv.lib.optionals stdenv.isx86_64 {
|
||||||
# disable SIMD instructions (which are enabled *when available* by default)
|
# disable SIMD instructions (which are enabled *when available* by default)
|
||||||
# for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284)
|
# for now we need to be careful to disable *all* relevant versions of an instruction set explicitly (https://github.com/linbox-team/fflas-ffpack/issues/284)
|
||||||
|
|
|
@ -5,11 +5,11 @@
|
||||||
, mpir
|
, mpir
|
||||||
, mpfr
|
, mpfr
|
||||||
, ntl
|
, ntl
|
||||||
, openblas ? null
|
, openblas ? null, blas, lapack
|
||||||
, withBlas ? true
|
, withBlas ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert withBlas -> openblas != null;
|
assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "flint";
|
pname = "flint";
|
||||||
|
|
|
@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ];
|
nativeBuildInputs = [ autoreconfHook ];
|
||||||
buildInputs = [autoconf automake libtool gmpxx];
|
buildInputs = [autoconf automake libtool];
|
||||||
|
propagatedBuildInputs = [ gmpxx ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--disable-optimization"
|
"--disable-optimization"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
|
{ stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
|
||||||
, openblas, gfortran, openssh, openmpi
|
, blas, gfortran, openssh, openmpi
|
||||||
} :
|
} :
|
||||||
|
|
||||||
let
|
let
|
||||||
|
@ -17,7 +17,7 @@ in stdenv.mkDerivation {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ];
|
nativeBuildInputs = [ autoreconfHook ];
|
||||||
buildInputs = [ openmpi openblas gfortran openssh ];
|
buildInputs = [ openmpi blas gfortran openssh ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
configureFlagsArray+=( "--enable-i8" \
|
configureFlagsArray+=( "--enable-i8" \
|
||||||
|
@ -25,7 +25,7 @@ in stdenv.mkDerivation {
|
||||||
"--with-mpi3" \
|
"--with-mpi3" \
|
||||||
"--enable-eispack" \
|
"--enable-eispack" \
|
||||||
"--enable-underscoring" \
|
"--enable-underscoring" \
|
||||||
"--with-blas8=${openblas}/lib -lopenblas" )
|
"--with-blas8=${blas}/lib -lblas" )
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -38,5 +38,3 @@ in stdenv.mkDerivation {
|
||||||
platforms = platforms.linux;
|
platforms = platforms.linux;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{stdenv, autoreconfHook, fetchurl, gmp, openblas}:
|
{stdenv, autoreconfHook, fetchurl, gmp, blas}:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "iml";
|
pname = "iml";
|
||||||
version = "1.0.5";
|
version = "1.0.5";
|
||||||
|
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
gmp
|
gmp
|
||||||
openblas
|
blas
|
||||||
];
|
];
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoreconfHook
|
autoreconfHook
|
||||||
|
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-gmp-include=${gmp.dev}/include"
|
"--with-gmp-include=${gmp.dev}/include"
|
||||||
"--with-gmp-lib=${gmp}/lib"
|
"--with-gmp-lib=${gmp}/lib"
|
||||||
"--with-cblas=-lopenblas"
|
"--with-cblas=-lblas"
|
||||||
];
|
];
|
||||||
meta = {
|
meta = {
|
||||||
inherit version;
|
inherit version;
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
, lib
|
, lib
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, cmake
|
, cmake
|
||||||
, openblas
|
, blas
|
||||||
# Check Inputs
|
# Check Inputs
|
||||||
, python2
|
, python2
|
||||||
}:
|
}:
|
||||||
|
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
buildInputs = [ openblas ];
|
buildInputs = [ blas ];
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DENABLE_TEST=1"
|
"-DENABLE_TEST=1"
|
||||||
"-DQUICK_TEST=1"
|
"-DQUICK_TEST=1"
|
||||||
|
|
|
@ -4,10 +4,14 @@
|
||||||
, givaro
|
, givaro
|
||||||
, pkgconfig
|
, pkgconfig
|
||||||
, blas
|
, blas
|
||||||
|
, lapack
|
||||||
, fflas-ffpack
|
, fflas-ffpack
|
||||||
, gmpxx
|
, gmpxx
|
||||||
, withSage ? false # sage support
|
, withSage ? false # sage support
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "linbox";
|
pname = "linbox";
|
||||||
version = "1.6.3";
|
version = "1.6.3";
|
||||||
|
@ -33,7 +37,7 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-blas-libs=-l${blas.linkName}"
|
"--with-blas-libs=-lblas"
|
||||||
"--disable-optimization"
|
"--disable-optimization"
|
||||||
] ++ stdenv.lib.optionals stdenv.isx86_64 {
|
] ++ stdenv.lib.optionals stdenv.isx86_64 {
|
||||||
# disable SIMD instructions (which are enabled *when available* by default)
|
# disable SIMD instructions (which are enabled *when available* by default)
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase
|
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase
|
||||||
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
|
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
|
||||||
, enableEigen ? true, eigen
|
, enableEigen ? true, eigen
|
||||||
, enableOpenblas ? true, openblas
|
, enableOpenblas ? true, openblas, blas, lapack
|
||||||
, enableContrib ? true
|
, enableContrib ? true
|
||||||
|
|
||||||
, enableCuda ? (config.cudaSupport or false) &&
|
, enableCuda ? (config.cudaSupport or false) &&
|
||||||
|
@ -35,6 +35,8 @@
|
||||||
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
|
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "3.4.8";
|
version = "3.4.8";
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase
|
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase
|
||||||
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
|
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
|
||||||
, enableEigen ? true, eigen
|
, enableEigen ? true, eigen
|
||||||
, enableOpenblas ? true, openblas
|
, enableOpenblas ? true, openblas, blas, lapack
|
||||||
, enableContrib ? true
|
, enableContrib ? true
|
||||||
|
|
||||||
, enableCuda ? (config.cudaSupport or false) &&
|
, enableCuda ? (config.cudaSupport or false) &&
|
||||||
|
@ -35,6 +35,8 @@
|
||||||
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
|
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "4.1.2";
|
version = "4.1.2";
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, gfortran
|
, gfortran
|
||||||
, openblas
|
, blas
|
||||||
|
, lapack
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "qrupdate-1.1.2";
|
name = "qrupdate-1.1.2";
|
||||||
|
@ -13,11 +14,11 @@ stdenv.mkDerivation {
|
||||||
configurePhase =
|
configurePhase =
|
||||||
''
|
''
|
||||||
export PREFIX=$out
|
export PREFIX=$out
|
||||||
sed -i -e 's,^BLAS=.*,BLAS=-L${openblas}/lib -lopenblas,' \
|
sed -i -e 's,^BLAS=.*,BLAS=-L${blas}/lib -lblas,' \
|
||||||
-e 's,^LAPACK=.*,LAPACK=-L${openblas}/lib -lopenblas,' \
|
-e 's,^LAPACK=.*,LAPACK=-L${lapack}/lib -llapack,' \
|
||||||
Makeconf
|
Makeconf
|
||||||
''
|
''
|
||||||
+ stdenv.lib.optionalString openblas.blas64
|
+ stdenv.lib.optionalString blas.is64bit
|
||||||
''
|
''
|
||||||
sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/'
|
sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/'
|
||||||
'';
|
'';
|
||||||
|
@ -30,7 +31,7 @@ stdenv.mkDerivation {
|
||||||
|
|
||||||
installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
|
installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
|
||||||
|
|
||||||
buildInputs = [ gfortran openblas ];
|
buildInputs = [ gfortran blas lapack ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Library for fast updating of qr and cholesky decompositions";
|
description = "Library for fast updating of qr and cholesky decompositions";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{ stdenv, fetchFromGitHub, cmake
|
{ stdenv, fetchFromGitHub, cmake
|
||||||
, gfortran, openblas, eigen }:
|
, gfortran, blas, lapack, eigen }:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
|
@ -18,15 +18,16 @@ stdenv.mkDerivation {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
buildInputs = [ gfortran openblas eigen ];
|
buildInputs = [ gfortran blas lapack eigen ];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
BLAS_LIBS = "-L${openblas}/lib -lopenblas";
|
BLAS_LIBS = "-L${blas}/lib -lblas";
|
||||||
|
LAPACK_LIBS = "-L${lapack}/lib -llapack";
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DBUILD_SHARED_LIBS=ON"
|
"-DBUILD_SHARED_LIBS=ON"
|
||||||
"-DINTERFACE64=${optionalString openblas.blas64 "1"}"
|
"-DINTERFACE64=${optionalString blas.is64bit "1"}"
|
||||||
];
|
];
|
||||||
|
|
||||||
preCheck = if stdenv.isDarwin then ''
|
preCheck = if stdenv.isDarwin then ''
|
||||||
|
|
|
@ -68,10 +68,4 @@ EOF
|
||||||
homepage = "http://www.netlib.org/blas/";
|
homepage = "http://www.netlib.org/blas/";
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = stdenv.lib.platforms.unix;
|
||||||
};
|
};
|
||||||
|
|
||||||
# We use linkName to pass a different name to --with-blas-libs for
|
|
||||||
# fflas-ffpack and linbox, because we use blas on darwin but openblas
|
|
||||||
# elsewhere.
|
|
||||||
# See see https://github.com/NixOS/nixpkgs/pull/45013.
|
|
||||||
passthru.linkName = "blas";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,5 @@
|
||||||
{ stdenv, fetchFromGitHub, gfortran, suitesparse, openblas }:
|
{ stdenv, fetchFromGitHub, gfortran, suitesparse, blas, lapack }:
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
suitesparse_ = suitesparse;
|
|
||||||
in let
|
|
||||||
# SuiteSparse must use the same openblas
|
|
||||||
suitesparse = suitesparse_.override { inherit openblas; };
|
|
||||||
in stdenv.mkDerivation rec {
|
|
||||||
pname = "cholmod-extra";
|
pname = "cholmod-extra";
|
||||||
version = "1.2.0";
|
version = "1.2.0";
|
||||||
|
|
||||||
|
@ -15,10 +10,10 @@ in stdenv.mkDerivation rec {
|
||||||
sha256 = "0hz1lfp0zaarvl0dv0zgp337hyd8np41kmdpz5rr3fc6yzw7vmkg";
|
sha256 = "0hz1lfp0zaarvl0dv0zgp337hyd8np41kmdpz5rr3fc6yzw7vmkg";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ suitesparse gfortran openblas ];
|
buildInputs = [ suitesparse gfortran blas lapack ];
|
||||||
|
|
||||||
buildFlags = [
|
makeFlags = [
|
||||||
"BLAS=-lopenblas"
|
"BLAS=-lcblas"
|
||||||
];
|
];
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
|
|
|
@ -24,6 +24,8 @@
|
||||||
, suitesparse
|
, suitesparse
|
||||||
, swig
|
, swig
|
||||||
, zlib
|
, zlib
|
||||||
|
, blas
|
||||||
|
, lapack
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
version = "2019.1.0";
|
version = "2019.1.0";
|
||||||
|
@ -176,13 +178,14 @@ let
|
||||||
hdf5
|
hdf5
|
||||||
mpi
|
mpi
|
||||||
numpy
|
numpy
|
||||||
(numpy.blas)
|
blas
|
||||||
|
lapack
|
||||||
ply
|
ply
|
||||||
python
|
python
|
||||||
scotch
|
scotch
|
||||||
six
|
six
|
||||||
sphinx
|
sphinx
|
||||||
(suitesparse.override { openblas = numpy.blas; })
|
suitesparse
|
||||||
swig
|
swig
|
||||||
sympy
|
sympy
|
||||||
ufl
|
ufl
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{ stdenv, fetchurl, unzip, openblas, gfortran }:
|
{ stdenv, fetchurl, unzip, blas, lapack, gfortran }:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "ipopt";
|
pname = "ipopt";
|
||||||
|
@ -12,13 +14,13 @@ stdenv.mkDerivation rec {
|
||||||
CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
|
CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--with-blas-lib=-lopenblas"
|
"--with-blas-lib=-lblas"
|
||||||
"--with-lapack-lib=-lopenblas"
|
"--with-lapack-lib=-llapack"
|
||||||
];
|
];
|
||||||
|
|
||||||
nativeBuildInputs = [ unzip ];
|
nativeBuildInputs = [ unzip ];
|
||||||
|
|
||||||
buildInputs = [ gfortran openblas ];
|
buildInputs = [ gfortran blas lapack ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
gfortran,
|
gfortran,
|
||||||
cmake,
|
cmake,
|
||||||
python2,
|
python2,
|
||||||
shared ? false
|
shared ? true
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
inherit (stdenv.lib) optional;
|
inherit (stdenv.lib) optional;
|
||||||
|
@ -22,16 +22,16 @@ stdenv.mkDerivation {
|
||||||
sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
|
sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ gfortran ];
|
nativeBuildInputs = [ gfortran python2 cmake ];
|
||||||
nativeBuildInputs = [ python2 cmake ];
|
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
||||||
"-DLAPACKE=ON"
|
"-DLAPACKE=ON"
|
||||||
|
"-DCBLAS=ON"
|
||||||
]
|
]
|
||||||
++ (optional shared "-DBUILD_SHARED_LIBS=ON");
|
++ optional shared "-DBUILD_SHARED_LIBS=ON";
|
||||||
|
|
||||||
doCheck = ! shared;
|
doCheck = true;
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv, fetchurl, cmake, gfortran, cudatoolkit, libpthreadstubs, liblapack
|
{ stdenv, fetchurl, cmake, gfortran, cudatoolkit, libpthreadstubs, lapack, blas
|
||||||
, mklSupport ? false, mkl ? null
|
, mklSupport ? false, mkl ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ in stdenv.mkDerivation {
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ gfortran cudatoolkit libpthreadstubs cmake ]
|
buildInputs = [ gfortran cudatoolkit libpthreadstubs cmake ]
|
||||||
++ (if mklSupport then [ mkl ] else [ liblapack ]);
|
++ (if mklSupport then [ mkl ] else [ lapack blas ]);
|
||||||
|
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,14 @@ in stdenvNoCC.mkDerivation {
|
||||||
cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/*.so* $out/lib/
|
cp -r opt/intel/compilers_and_libraries_${version}/linux/compiler/lib/intel64_lin/*.so* $out/lib/
|
||||||
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/*.so* $out/lib/
|
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/*.so* $out/lib/
|
||||||
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/*dynamic*.pc $out/lib/pkgconfig
|
cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/bin/pkgconfig/*dynamic*.pc $out/lib/pkgconfig
|
||||||
'');
|
'') + ''
|
||||||
|
|
||||||
|
# Setup symlinks for blas / lapack
|
||||||
|
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
|
||||||
|
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
|
||||||
|
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
|
||||||
|
ln -s $out/lib/libmkl_rt${stdenvNoCC.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenvNoCC.hostPlatform.extensions.sharedLibrary}
|
||||||
|
'';
|
||||||
|
|
||||||
# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
|
# fixDarwinDylibName fails for libmkl_cdft_core.dylib because the
|
||||||
# larger updated load commands do not fit. Use install_name_tool
|
# larger updated load commands do not fit. Use install_name_tool
|
||||||
|
|
|
@ -176,6 +176,12 @@ Cflags: -I$out/include
|
||||||
Libs: -L$out/lib -lopenblas
|
Libs: -L$out/lib -lopenblas
|
||||||
EOF
|
EOF
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Setup symlinks for blas / lapack
|
||||||
|
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
|
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libcblas${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
|
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
|
ln -s $out/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/liblapacke${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
@ -185,10 +191,4 @@ EOF
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = with maintainers; [ ttuegel ];
|
maintainers = with maintainers; [ ttuegel ];
|
||||||
};
|
};
|
||||||
|
|
||||||
# We use linkName to pass a different name to --with-blas-libs for
|
|
||||||
# fflas-ffpack and linbox, because we use blas on darwin but openblas
|
|
||||||
# elsewhere.
|
|
||||||
# See see https://github.com/NixOS/nixpkgs/pull/45013.
|
|
||||||
passthru.linkName = "openblas";
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{ stdenv , fetchurl , blas , gfortran , liblapack , python }:
|
{ stdenv , fetchurl , blas , gfortran , lapack , python }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "petsc";
|
pname = "petsc";
|
||||||
|
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
||||||
sha256 = "0943bydmsq3sjwj3rxhb8hx58b1fm8vymny731557fs10g5zfbyz";
|
sha256 = "0943bydmsq3sjwj3rxhb8hx58b1fm8vymny731557fs10g5zfbyz";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ blas gfortran.cc.lib liblapack python ];
|
nativeBuildInputs = [ blas gfortran.cc.lib lapack python ];
|
||||||
|
|
||||||
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
substituteInPlace config/install.py \
|
substituteInPlace config/install.py \
|
||||||
|
@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
|
||||||
"--with-cxx=$CXX"
|
"--with-cxx=$CXX"
|
||||||
"--with-fc=0"
|
"--with-fc=0"
|
||||||
"--with-mpi=0"
|
"--with-mpi=0"
|
||||||
"--with-blas-lib=[${blas}/lib/libblas.a,${gfortran.cc.lib}/lib/libgfortran.a]"
|
"--with-blas-lib=[${blas}/lib/libblas.so,${gfortran.cc.lib}/lib/libgfortran.a]"
|
||||||
"--with-lapack-lib=[${liblapack}/lib/liblapack.a,${gfortran.cc.lib}/lib/libgfortran.a]"
|
"--with-lapack-lib=[${lapack}/lib/liblapack.so,${gfortran.cc.lib}/lib/libgfortran.a]"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
{ stdenv, fetchFromGitHub, cmake, openssh
|
{ stdenv, fetchFromGitHub, cmake, openssh
|
||||||
, gfortran, mpi, openblasCompat
|
, gfortran, mpi, blas, lapack
|
||||||
} :
|
} :
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "scalapack";
|
pname = "scalapack";
|
||||||
|
@ -15,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake openssh ];
|
nativeBuildInputs = [ cmake openssh ];
|
||||||
buildInputs = [ mpi gfortran openblasCompat ];
|
buildInputs = [ mpi gfortran blas lapack ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -24,8 +25,8 @@ stdenv.mkDerivation rec {
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
cmakeFlagsArray+=(
|
cmakeFlagsArray+=(
|
||||||
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
|
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
|
||||||
-DLAPACK_LIBRARIES="-lopenblas"
|
-DLAPACK_LIBRARIES="-llapack"
|
||||||
-DBLAS_LIBRARIES="-lopenblas"
|
-DBLAS_LIBRARIES="-lblas"
|
||||||
)
|
)
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{ stdenv, fetchFromGitHub, blas, liblapack, gfortran, fixDarwinDylibNames }:
|
{ stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "scs";
|
pname = "scs";
|
||||||
|
@ -20,7 +22,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||||
|
|
||||||
buildInputs = [ blas liblapack gfortran.cc.lib ];
|
buildInputs = [ blas lapack gfortran.cc.lib ];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ stdenv, fetchurl, gfortran, openblas }:
|
{ stdenv, fetchurl, gfortran, blas, lapack }:
|
||||||
|
|
||||||
let
|
let
|
||||||
int_t = if openblas.blas64 then "int64_t" else "int32_t";
|
int_t = if blas.is64bit then "int64_t" else "int32_t";
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "4.2.1";
|
version = "4.2.1";
|
||||||
|
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ gfortran ];
|
nativeBuildInputs = [ gfortran ];
|
||||||
buildInputs = [ openblas ];
|
buildInputs = [ blas lapack ];
|
||||||
|
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
mkdir -p $out/lib
|
mkdir -p $out/lib
|
||||||
|
@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
|
||||||
"PREFIX=\"$(out)\""
|
"PREFIX=\"$(out)\""
|
||||||
"INSTALL_LIB=$(out)/lib"
|
"INSTALL_LIB=$(out)/lib"
|
||||||
"INSTALL_INCLUDE=$(out)/include"
|
"INSTALL_INCLUDE=$(out)/include"
|
||||||
"BLAS=-lopenblas"
|
"BLAS=-lblas"
|
||||||
"LAPACK="
|
"LAPACK=-llapack"
|
||||||
];
|
];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
{ stdenv, fetchurl, gfortran, openblas
|
{ stdenv, fetchurl, gfortran, blas, lapack
|
||||||
, enableCuda ? false, cudatoolkit
|
, enableCuda ? false, cudatoolkit
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "4.4.4";
|
version = "4.4.4";
|
||||||
name = "suitesparse-${version}";
|
name = "suitesparse-${version}";
|
||||||
|
|
||||||
int_t = if openblas.blas64 then "int64_t" else "int32_t";
|
int_t = if blas.is64bit then "int64_t" else "int32_t";
|
||||||
SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
|
SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
|
@ -51,8 +51,8 @@ stdenv.mkDerivation {
|
||||||
"PREFIX=\"$(out)\""
|
"PREFIX=\"$(out)\""
|
||||||
"INSTALL_LIB=$(out)/lib"
|
"INSTALL_LIB=$(out)/lib"
|
||||||
"INSTALL_INCLUDE=$(out)/include"
|
"INSTALL_INCLUDE=$(out)/include"
|
||||||
"BLAS=-lopenblas"
|
"BLAS=-lblas"
|
||||||
"LAPACK="
|
"LAPACK=-llapack"
|
||||||
];
|
];
|
||||||
|
|
||||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER";
|
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER";
|
||||||
|
@ -64,7 +64,7 @@ stdenv.mkDerivation {
|
||||||
for i in "$out"/lib/lib*.a; do
|
for i in "$out"/lib/lib*.a; do
|
||||||
ar -x $i
|
ar -x $i
|
||||||
done
|
done
|
||||||
${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse${SHLIB_EXT}" -lopenblas ${stdenv.lib.optionalString enableCuda "-lcublas"}
|
${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse${SHLIB_EXT}" -lblas ${stdenv.lib.optionalString enableCuda "-lcublas"}
|
||||||
)
|
)
|
||||||
for i in umfpack cholmod amd camd colamd spqr; do
|
for i in umfpack cholmod amd camd colamd spqr; do
|
||||||
ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT}
|
ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT}
|
||||||
|
@ -88,7 +88,7 @@ stdenv.mkDerivation {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ gfortran ];
|
nativeBuildInputs = [ gfortran ];
|
||||||
buildInputs = [ openblas ];
|
buildInputs = [ blas lapack ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
|
homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, gfortran
|
, gfortran
|
||||||
, openblas
|
, blas, lapack
|
||||||
, metis
|
, metis
|
||||||
, fixDarwinDylibNames
|
, fixDarwinDylibNames
|
||||||
, gnum4
|
, gnum4
|
||||||
|
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
||||||
] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
openblas
|
blas lapack
|
||||||
metis
|
metis
|
||||||
gfortran.cc.lib
|
gfortran.cc.lib
|
||||||
] ++ stdenv.lib.optional enableCuda cudatoolkit;
|
] ++ stdenv.lib.optional enableCuda cudatoolkit;
|
||||||
|
@ -41,10 +41,10 @@ stdenv.mkDerivation rec {
|
||||||
"INSTALL=${placeholder "out"}"
|
"INSTALL=${placeholder "out"}"
|
||||||
"INSTALL_INCLUDE=${placeholder "dev"}/include"
|
"INSTALL_INCLUDE=${placeholder "dev"}/include"
|
||||||
"JOBS=$(NIX_BUILD_CORES)"
|
"JOBS=$(NIX_BUILD_CORES)"
|
||||||
"BLAS=-lopenblas"
|
"BLAS=-lblas"
|
||||||
|
"LAPACK=-llapack"
|
||||||
"MY_METIS_LIB=-lmetis"
|
"MY_METIS_LIB=-lmetis"
|
||||||
"LAPACK="
|
] ++ stdenv.lib.optionals blas.is64bit [
|
||||||
] ++ stdenv.lib.optionals openblas.blas64 [
|
|
||||||
"CFLAGS=-DBLAS64"
|
"CFLAGS=-DBLAS64"
|
||||||
] ++ stdenv.lib.optionals enableCuda [
|
] ++ stdenv.lib.optionals enableCuda [
|
||||||
"CUDA_PATH=${cudatoolkit}"
|
"CUDA_PATH=${cudatoolkit}"
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
{ stdenv, fetchurl, cmake,
|
{ stdenv, fetchurl, cmake,
|
||||||
gfortran, openblasCompat}:
|
gfortran, blas, lapack}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "5.2.1";
|
version = "5.2.1";
|
||||||
|
@ -12,7 +14,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
buildInputs = [ cmake gfortran ];
|
buildInputs = [ cmake gfortran ];
|
||||||
|
|
||||||
propagatedBuildInputs = [ openblasCompat ];
|
propagatedBuildInputs = [ blas ];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
"-DBUILD_SHARED_LIBS=true"
|
"-DBUILD_SHARED_LIBS=true"
|
||||||
|
@ -20,7 +22,6 @@ stdenv.mkDerivation rec {
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
./find-openblas-library.patch
|
|
||||||
./add-superlu-lib-as-dependency-for-the-unit-tests.patch
|
./add-superlu-lib-as-dependency-for-the-unit-tests.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- a/CMakeLists.txt
|
|
||||||
+++ b/CMakeLists.txt
|
|
||||||
@@ -75,6 +75,8 @@ set(CMAKE_C_FLAGS_RELEASE "-O3" CACHE STRING "")
|
|
||||||
######################################################################
|
|
||||||
#
|
|
||||||
#--------------------- BLAS ---------------------
|
|
||||||
+find_package(OpenBLAS)
|
|
||||||
+set(TPL_BLAS_LIBRARIES ${OpenBLAS_LIBRARIES})
|
|
||||||
if(NOT enable_blaslib)
|
|
||||||
if (TPL_BLAS_LIBRARIES)
|
|
||||||
set(BLAS_FOUND TRUE)
|
|
|
@ -4,15 +4,13 @@
|
||||||
, python
|
, python
|
||||||
# GNU Octave needs KLU for ODE solvers
|
# GNU Octave needs KLU for ODE solvers
|
||||||
, suitesparse
|
, suitesparse
|
||||||
, liblapack
|
, blas, lapack
|
||||||
, gfortran
|
, gfortran
|
||||||
, lapackSupport ? true }:
|
, lapackSupport ? true }:
|
||||||
|
|
||||||
let liblapackShared = liblapack.override {
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
shared = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "sundials";
|
pname = "sundials";
|
||||||
version = "2.7.0";
|
version = "2.7.0";
|
||||||
|
|
||||||
|
@ -44,7 +42,7 @@ in stdenv.mkDerivation rec {
|
||||||
"-DKLU_INCLUDE_DIR=${suitesparse}/include"
|
"-DKLU_INCLUDE_DIR=${suitesparse}/include"
|
||||||
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
|
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
|
||||||
"-DLAPACK_ENABLE=ON"
|
"-DLAPACK_ENABLE=ON"
|
||||||
"-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
"-DLAPACK_LIBRARIES=${lapack}/lib/lapack${stdenv.hostPlatform.extensions.sharedLibrary};${blas}/lib/blas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
];
|
];
|
||||||
|
|
||||||
# flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3
|
# flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3
|
||||||
|
|
|
@ -2,17 +2,18 @@
|
||||||
, cmake
|
, cmake
|
||||||
, fetchurl
|
, fetchurl
|
||||||
, python
|
, python
|
||||||
, openblas
|
, blas
|
||||||
|
, lapack
|
||||||
, gfortran
|
, gfortran
|
||||||
, lapackSupport ? true }:
|
, lapackSupport ? true }:
|
||||||
|
|
||||||
let openblas32 = openblas.override { blas64 = false; };
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
in stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "sundials";
|
pname = "sundials";
|
||||||
version = "5.1.0";
|
version = "5.1.0";
|
||||||
|
|
||||||
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran openblas32 ];
|
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran blas lapack ];
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
|
@ -33,7 +34,7 @@ in stdenv.mkDerivation rec {
|
||||||
] ++ stdenv.lib.optionals (lapackSupport) [
|
] ++ stdenv.lib.optionals (lapackSupport) [
|
||||||
"-DSUNDIALS_INDEX_TYPE=int32_t"
|
"-DSUNDIALS_INDEX_TYPE=int32_t"
|
||||||
"-DLAPACK_ENABLE=ON"
|
"-DLAPACK_ENABLE=ON"
|
||||||
"-DLAPACK_LIBRARIES=${openblas32}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
"-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
{ stdenv, fetchFromGitHub, darwin, ocaml, findlib, dune, base, stdio, liblapack, blas }:
|
{ stdenv, fetchFromGitHub, darwin, ocaml, findlib, dune, base, stdio, lapack, blas }:
|
||||||
|
|
||||||
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.05.0";
|
assert stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.05.0";
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "ocaml${ocaml.version}-lacaml";
|
pname = "ocaml${ocaml.version}-lacaml";
|
||||||
|
@ -14,7 +15,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ ocaml findlib dune base stdio ];
|
buildInputs = [ ocaml findlib dune base stdio ];
|
||||||
propagatedBuildInputs = [ liblapack blas ] ++
|
propagatedBuildInputs = [ lapack blas ] ++
|
||||||
stdenv.lib.optionals stdenv.isDarwin
|
stdenv.lib.optionals stdenv.isDarwin
|
||||||
[ darwin.apple_sdk.frameworks.Accelerate ];
|
[ darwin.apple_sdk.frameworks.Accelerate ];
|
||||||
|
|
||||||
|
|
|
@ -6,11 +6,14 @@
|
||||||
, eigen
|
, eigen
|
||||||
, stdio
|
, stdio
|
||||||
, stdlib-shims
|
, stdlib-shims
|
||||||
, openblasCompat
|
, openblas, blas, lapack
|
||||||
, owl-base
|
, owl-base
|
||||||
, npy
|
, npy
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||||
|
|
||||||
buildDunePackage rec {
|
buildDunePackage rec {
|
||||||
pname = "owl";
|
pname = "owl";
|
||||||
|
|
||||||
|
@ -19,7 +22,7 @@ buildDunePackage rec {
|
||||||
checkInputs = [ alcotest ];
|
checkInputs = [ alcotest ];
|
||||||
buildInputs = [ dune-configurator ];
|
buildInputs = [ dune-configurator ];
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
eigen stdio stdlib-shims openblasCompat owl-base npy
|
eigen stdio stdlib-shims openblas owl-base npy
|
||||||
];
|
];
|
||||||
|
|
||||||
doCheck = !stdenv.isDarwin; # https://github.com/owlbarn/owl/issues/462
|
doCheck = !stdenv.isDarwin; # https://github.com/owlbarn/owl/issues/462
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
, fetchPypi
|
, fetchPypi
|
||||||
, isPyPy
|
, isPyPy
|
||||||
, python
|
, python
|
||||||
, openblasCompat # build segfaults with regular openblas
|
, blas, lapack # build segfaults with 64-bit blas
|
||||||
, suitesparse
|
, suitesparse
|
||||||
, glpk ? null
|
, glpk ? null
|
||||||
, gsl ? null
|
, gsl ? null
|
||||||
|
@ -14,6 +14,8 @@
|
||||||
, withFftw ? true
|
, withFftw ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "cvxopt";
|
pname = "cvxopt";
|
||||||
version = "1.2.4";
|
version = "1.2.4";
|
||||||
|
@ -25,12 +27,13 @@ buildPythonPackage rec {
|
||||||
sha256 = "1h9g79gxpgpy6xciqyypihw5q4ngp322lpkka1nkwk0ysybfsp7s";
|
sha256 = "1h9g79gxpgpy6xciqyypihw5q4ngp322lpkka1nkwk0ysybfsp7s";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
buildInputs = [ blas lapack ];
|
||||||
|
|
||||||
# similar to Gsl, glpk, fftw there is also a dsdp interface
|
# similar to Gsl, glpk, fftw there is also a dsdp interface
|
||||||
# but dsdp is not yet packaged in nixpkgs
|
# but dsdp is not yet packaged in nixpkgs
|
||||||
preConfigure = ''
|
preConfigure = ''
|
||||||
export CVXOPT_BLAS_LIB_DIR=${openblasCompat}/lib
|
export CVXOPT_BLAS_LIB=blas
|
||||||
export CVXOPT_BLAS_LIB=openblas
|
export CVXOPT_LAPACK_LIB=lapack
|
||||||
export CVXOPT_LAPACK_LIB=openblas
|
|
||||||
export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib
|
export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib
|
||||||
export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include
|
export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include
|
||||||
'' + lib.optionalString withGsl ''
|
'' + lib.optionalString withGsl ''
|
||||||
|
|
|
@ -5,21 +5,23 @@
|
||||||
, gfortran
|
, gfortran
|
||||||
, pytest
|
, pytest
|
||||||
, blas
|
, blas
|
||||||
|
, lapack
|
||||||
, writeTextFile
|
, writeTextFile
|
||||||
, isPyPy
|
, isPyPy
|
||||||
, cython
|
, cython
|
||||||
, setuptoolsBuildHook
|
, setuptoolsBuildHook
|
||||||
}:
|
}:
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
let
|
let
|
||||||
blasImplementation = lib.nameFromURL blas.name "-";
|
|
||||||
cfg = writeTextFile {
|
cfg = writeTextFile {
|
||||||
name = "site.cfg";
|
name = "site.cfg";
|
||||||
text = (lib.generators.toINI {} {
|
text = (lib.generators.toINI {} {
|
||||||
${blasImplementation} = {
|
${blas.implementation} = {
|
||||||
include_dirs = "${blas}/include";
|
include_dirs = "${blas}/include:${lapack}/include";
|
||||||
library_dirs = "${blas}/lib";
|
library_dirs = "${blas}/lib:${lapack}/lib";
|
||||||
} // lib.optionalAttrs (blasImplementation == "mkl") {
|
} // lib.optionalAttrs (blas.implementation == "mkl") {
|
||||||
mkl_libs = "mkl_rt";
|
mkl_libs = "mkl_rt";
|
||||||
lapack_libs = "";
|
lapack_libs = "";
|
||||||
};
|
};
|
||||||
|
@ -37,7 +39,7 @@ in buildPythonPackage rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
|
nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
|
||||||
buildInputs = [ blas ];
|
buildInputs = [ blas lapack ];
|
||||||
|
|
||||||
patches = lib.optionals python.hasDistutilsCxxPatch [
|
patches = lib.optionals python.hasDistutilsCxxPatch [
|
||||||
# We patch cpython/distutils to fix https://bugs.python.org/issue1222585
|
# We patch cpython/distutils to fix https://bugs.python.org/issue1222585
|
||||||
|
@ -68,8 +70,10 @@ in buildPythonPackage rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
blas = blas;
|
# just for backwards compatibility
|
||||||
inherit blasImplementation cfg;
|
blas = blas.provider;
|
||||||
|
blasImplementation = blas.implementation;
|
||||||
|
inherit cfg;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Disable test
|
# Disable test
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
{ lib
|
{ lib
|
||||||
, blas
|
, blas
|
||||||
|
, lapack
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, cffi
|
, cffi
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, liblapack
|
|
||||||
, nose
|
, nose
|
||||||
, numpy
|
, numpy
|
||||||
, openblas
|
|
||||||
, useOpenblas ? true
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildPythonPackage {
|
buildPythonPackage {
|
||||||
|
@ -21,8 +19,6 @@ buildPythonPackage {
|
||||||
sha256 = "0mlrjbb5rw78dgijkr3bspmsskk6jqs9y7xpsgs35i46dvb327q5";
|
sha256 = "0mlrjbb5rw78dgijkr3bspmsskk6jqs9y7xpsgs35i46dvb327q5";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = lib.optional useOpenblas ./use-openblas.patch;
|
|
||||||
|
|
||||||
checkInputs = [
|
checkInputs = [
|
||||||
nose
|
nose
|
||||||
];
|
];
|
||||||
|
@ -32,12 +28,7 @@ buildPythonPackage {
|
||||||
cffi
|
cffi
|
||||||
];
|
];
|
||||||
|
|
||||||
buildInputs = (
|
buildInputs = [ blas lapack ];
|
||||||
if useOpenblas then
|
|
||||||
[ openblas ]
|
|
||||||
else
|
|
||||||
[ blas liblapack ]
|
|
||||||
);
|
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
index f100b35..448bbaf 100644
|
|
||||||
--- a/prox_tv/prox_tv_build.py
|
|
||||||
+++ b/prox_tv/prox_tv_build.py
|
|
||||||
@@ -109,6 +109,6 @@ ffi.set_source(
|
|
||||||
define_macros=[('NOMATLAB', 1)],
|
|
||||||
extra_compile_args=extra_compile_args,
|
|
||||||
extra_link_args=extra_link_args,
|
|
||||||
- libraries=['blas', 'lapack'],
|
|
||||||
+ libraries=['openblas'],
|
|
||||||
include_dirs=['/usr/include']
|
|
||||||
)
|
|
|
@ -3,7 +3,8 @@
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, numpy
|
, numpy
|
||||||
, setuptools
|
, setuptools
|
||||||
, liblapack
|
, blas
|
||||||
|
, lapack
|
||||||
, isPy27
|
, isPy27
|
||||||
, python
|
, python
|
||||||
}:
|
}:
|
||||||
|
@ -24,8 +25,8 @@ buildPythonPackage {
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
numpy
|
numpy
|
||||||
numpy.blas
|
blas
|
||||||
liblapack
|
lapack
|
||||||
];
|
];
|
||||||
|
|
||||||
# Include patches from working version of PySparse 1.3-dev in
|
# Include patches from working version of PySparse 1.3-dev in
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
, buildPythonPackage
|
, buildPythonPackage
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, blas
|
, blas
|
||||||
, liblapack
|
, lapack
|
||||||
, numpy
|
, numpy
|
||||||
, scipy
|
, scipy
|
||||||
, scs
|
, scs
|
||||||
|
@ -26,7 +26,7 @@ buildPythonPackage rec {
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
liblapack
|
lapack
|
||||||
blas
|
blas
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -252,7 +252,7 @@ let
|
||||||
data_table = [pkgs.zlib.dev] ++ lib.optional stdenv.isDarwin pkgs.llvmPackages.openmp;
|
data_table = [pkgs.zlib.dev] ++ lib.optional stdenv.isDarwin pkgs.llvmPackages.openmp;
|
||||||
devEMF = [ pkgs.xorg.libXft.dev pkgs.x11 ];
|
devEMF = [ pkgs.xorg.libXft.dev pkgs.x11 ];
|
||||||
diversitree = [ pkgs.gsl_1 pkgs.fftw ];
|
diversitree = [ pkgs.gsl_1 pkgs.fftw ];
|
||||||
EMCluster = [ pkgs.liblapack ];
|
EMCluster = [ pkgs.lapack ];
|
||||||
fftw = [ pkgs.fftw.dev ];
|
fftw = [ pkgs.fftw.dev ];
|
||||||
fftwtools = [ pkgs.fftw.dev ];
|
fftwtools = [ pkgs.fftw.dev ];
|
||||||
Formula = [ pkgs.gmp ];
|
Formula = [ pkgs.gmp ];
|
||||||
|
@ -808,11 +808,11 @@ let
|
||||||
});
|
});
|
||||||
|
|
||||||
slfm = old.slfm.overrideDerivation (attrs: {
|
slfm = old.slfm.overrideDerivation (attrs: {
|
||||||
PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas";
|
PKG_LIBS = "-L${pkgs.blas}/lib -lblas -L${pkgs.lapack}/lib -llapack";
|
||||||
});
|
});
|
||||||
|
|
||||||
SamplerCompare = old.SamplerCompare.overrideDerivation (attrs: {
|
SamplerCompare = old.SamplerCompare.overrideDerivation (attrs: {
|
||||||
PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas";
|
PKG_LIBS = "-L${pkgs.blas}/lib -lblas -L${pkgs.lapack}/lib -llapack";
|
||||||
});
|
});
|
||||||
|
|
||||||
EMCluster = old.EMCluster.overrideDerivation (attrs: {
|
EMCluster = old.EMCluster.overrideDerivation (attrs: {
|
||||||
|
|
|
@ -275,20 +275,15 @@ self: super:
|
||||||
old:
|
old:
|
||||||
let
|
let
|
||||||
blas = old.passthru.args.blas or pkgs.openblasCompat;
|
blas = old.passthru.args.blas or pkgs.openblasCompat;
|
||||||
blasImplementation = lib.nameFromURL blas.name "-";
|
lapack = old.passthru.args.lapack or pkgs.openblasCompat;
|
||||||
cfg = pkgs.writeTextFile {
|
cfg = pkgs.writeTextFile {
|
||||||
name = "site.cfg";
|
name = "site.cfg";
|
||||||
text = (
|
text = (lib.generators.toINI {} {
|
||||||
lib.generators.toINI {} {
|
${blas.implementation} = {
|
||||||
${blasImplementation} = {
|
include_dirs = "${blas}/include:${lapack}/include";
|
||||||
include_dirs = "${blas}/include";
|
library_dirs = "${blas}/lib:${lapack}/lib";
|
||||||
library_dirs = "${blas}/lib";
|
};
|
||||||
} // lib.optionalAttrs (blasImplementation == "mkl") {
|
});
|
||||||
mkl_libs = "mkl_rt";
|
|
||||||
lapack_libs = "";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
@ -299,8 +294,8 @@ self: super:
|
||||||
ln -s ${cfg} site.cfg
|
ln -s ${cfg} site.cfg
|
||||||
'';
|
'';
|
||||||
passthru = old.passthru // {
|
passthru = old.passthru // {
|
||||||
blas = blas;
|
blsaImplementation = blas.implementation;
|
||||||
inherit blasImplementation cfg;
|
inherit blas cfg;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{ stdenv, lib, fetchFromGitHub, cmake, perl
|
{ stdenv, lib, fetchFromGitHub, cmake, perl
|
||||||
, glib, luajit, openssl, pcre, pkgconfig, sqlite, ragel, icu
|
, glib, luajit, openssl, pcre, pkgconfig, sqlite, ragel, icu
|
||||||
, hyperscan, jemalloc, openblas, lua, libsodium
|
, hyperscan, jemalloc, blas, lapack, lua, libsodium
|
||||||
, withBlas ? true
|
, withBlas ? true
|
||||||
, withHyperscan ? stdenv.isx86_64
|
, withHyperscan ? stdenv.isx86_64
|
||||||
, withLuaJIT ? stdenv.isx86_64
|
, withLuaJIT ? stdenv.isx86_64
|
||||||
|
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
|
||||||
nativeBuildInputs = [ cmake pkgconfig perl ];
|
nativeBuildInputs = [ cmake pkgconfig perl ];
|
||||||
buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ]
|
buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ]
|
||||||
++ lib.optional withHyperscan hyperscan
|
++ lib.optional withHyperscan hyperscan
|
||||||
++ lib.optional withBlas openblas
|
++ lib.optionals withBlas [ blas lapack ]
|
||||||
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
|
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
{ stdenv, fetchurl, openblasCompat, mpi } :
|
{ stdenv, fetchurl, blas, lapack, mpi } :
|
||||||
|
|
||||||
|
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "hpl";
|
pname = "hpl";
|
||||||
|
@ -18,7 +20,7 @@ stdenv.mkDerivation rec {
|
||||||
install -D testing/ptest/HPL.dat $out/share/hpl/HPL.dat
|
install -D testing/ptest/HPL.dat $out/share/hpl/HPL.dat
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = [ openblasCompat mpi ];
|
buildInputs = [ blas lapack mpi ];
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Portable Implementation of the Linpack Benchmark for Distributed-Memory Computers";
|
description = "Portable Implementation of the Linpack Benchmark for Distributed-Memory Computers";
|
||||||
|
@ -28,4 +30,3 @@ stdenv.mkDerivation rec {
|
||||||
maintainers = [ maintainers.markuskowa ];
|
maintainers = [ maintainers.markuskowa ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -237,7 +237,7 @@ mapAliases ({
|
||||||
libGL_driver = mesa.drivers;
|
libGL_driver = mesa.drivers;
|
||||||
libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # added 2018-03-14
|
libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # added 2018-03-14
|
||||||
libjson_rpc_cpp = libjson-rpc-cpp; # added 2017-02-28
|
libjson_rpc_cpp = libjson-rpc-cpp; # added 2017-02-28
|
||||||
liblapackWithoutAtlas = liblapack; # added 2018-11-05
|
liblapackWithoutAtlas = lapack-reference; # added 2018-11-05
|
||||||
liblrdf = lrdf; # added 2018-04-25
|
liblrdf = lrdf; # added 2018-04-25
|
||||||
libqrencode = qrencode; # added 2019-01-01
|
libqrencode = qrencode; # added 2019-01-01
|
||||||
librdf = lrdf; # added 2020-03-22
|
librdf = lrdf; # added 2020-03-22
|
||||||
|
|
|
@ -104,6 +104,10 @@ in
|
||||||
|
|
||||||
### BUILD SUPPORT
|
### BUILD SUPPORT
|
||||||
|
|
||||||
|
auditBlasHook = makeSetupHook
|
||||||
|
{ name = "auto-blas-hook"; deps = [ blas lapack ]; }
|
||||||
|
../build-support/setup-hooks/audit-blas.sh;
|
||||||
|
|
||||||
autoreconfHook = makeSetupHook
|
autoreconfHook = makeSetupHook
|
||||||
{ deps = [ autoconf automake gettext libtool ]; }
|
{ deps = [ autoconf automake gettext libtool ]; }
|
||||||
../build-support/setup-hooks/autoreconf.sh;
|
../build-support/setup-hooks/autoreconf.sh;
|
||||||
|
@ -8702,25 +8706,21 @@ in
|
||||||
|
|
||||||
julia_07 = callPackage ../development/compilers/julia/0.7.nix {
|
julia_07 = callPackage ../development/compilers/julia/0.7.nix {
|
||||||
gmp = gmp6;
|
gmp = gmp6;
|
||||||
openblas = openblasCompat;
|
|
||||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||||
};
|
};
|
||||||
|
|
||||||
julia_10 = callPackage ../development/compilers/julia/1.0.nix {
|
julia_10 = callPackage ../development/compilers/julia/1.0.nix {
|
||||||
gmp = gmp6;
|
gmp = gmp6;
|
||||||
openblas = openblasCompat;
|
|
||||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||||
};
|
};
|
||||||
|
|
||||||
julia_11 = callPackage ../development/compilers/julia/1.1.nix {
|
julia_11 = callPackage ../development/compilers/julia/1.1.nix {
|
||||||
gmp = gmp6;
|
gmp = gmp6;
|
||||||
openblas = openblasCompat;
|
|
||||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||||
};
|
};
|
||||||
|
|
||||||
julia_13 = callPackage ../development/compilers/julia/1.3.nix {
|
julia_13 = callPackage ../development/compilers/julia/1.3.nix {
|
||||||
gmp = gmp6;
|
gmp = gmp6;
|
||||||
openblas = openblasCompat;
|
|
||||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -9404,16 +9404,13 @@ in
|
||||||
|
|
||||||
octave = callPackage ../development/interpreters/octave {
|
octave = callPackage ../development/interpreters/octave {
|
||||||
python = python3;
|
python = python3;
|
||||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
|
||||||
};
|
};
|
||||||
octave-jit = callPackage ../development/interpreters/octave {
|
octave-jit = callPackage ../development/interpreters/octave {
|
||||||
python = python3;
|
python = python3;
|
||||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
|
||||||
enableJIT = true;
|
enableJIT = true;
|
||||||
};
|
};
|
||||||
octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave {
|
octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave {
|
||||||
python = python3;
|
python = python3;
|
||||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
|
||||||
enableQt = true;
|
enableQt = true;
|
||||||
overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
|
overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
|
||||||
}));
|
}));
|
||||||
|
@ -11481,20 +11478,11 @@ in
|
||||||
|
|
||||||
ffcast = callPackage ../tools/X11/ffcast { };
|
ffcast = callPackage ../tools/X11/ffcast { };
|
||||||
|
|
||||||
fflas-ffpack = callPackage ../development/libraries/fflas-ffpack {
|
fflas-ffpack = callPackage ../development/libraries/fflas-ffpack { };
|
||||||
# We need to use blas instead of openblas on darwin,
|
|
||||||
# see https://github.com/NixOS/nixpkgs/pull/45013.
|
|
||||||
blas = if stdenv.isDarwin then blas else openblas;
|
|
||||||
};
|
|
||||||
|
|
||||||
forge = callPackage ../development/libraries/forge { };
|
forge = callPackage ../development/libraries/forge { };
|
||||||
|
|
||||||
linbox = callPackage ../development/libraries/linbox {
|
linbox = callPackage ../development/libraries/linbox { };
|
||||||
# We need to use blas instead of openblas on darwin, see
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/45013 and
|
|
||||||
# https://github.com/NixOS/nixpkgs/pull/45015.
|
|
||||||
blas = if stdenv.isDarwin then blas else openblas;
|
|
||||||
};
|
|
||||||
|
|
||||||
ffmpeg_2_8 = callPackage ../development/libraries/ffmpeg/2.8.nix {
|
ffmpeg_2_8 = callPackage ../development/libraries/ffmpeg/2.8.nix {
|
||||||
inherit (darwin.apple_sdk.frameworks) Cocoa;
|
inherit (darwin.apple_sdk.frameworks) Cocoa;
|
||||||
|
@ -15263,7 +15251,6 @@ in
|
||||||
texLive = texlive.combine {
|
texLive = texlive.combine {
|
||||||
inherit (texlive) scheme-small inconsolata helvetic texinfo fancyvrb cm-super;
|
inherit (texlive) scheme-small inconsolata helvetic texinfo fancyvrb cm-super;
|
||||||
};
|
};
|
||||||
openblas = openblasCompat;
|
|
||||||
withRecommendedPackages = false;
|
withRecommendedPackages = false;
|
||||||
inherit (darwin.apple_sdk.frameworks) Cocoa Foundation;
|
inherit (darwin.apple_sdk.frameworks) Cocoa Foundation;
|
||||||
inherit (darwin) libobjc;
|
inherit (darwin) libobjc;
|
||||||
|
@ -24202,7 +24189,7 @@ in
|
||||||
|
|
||||||
molden = callPackage ../applications/science/chemistry/molden { };
|
molden = callPackage ../applications/science/chemistry/molden { };
|
||||||
|
|
||||||
octopus = callPackage ../applications/science/chemistry/octopus { openblas=openblasCompat; };
|
octopus = callPackage ../applications/science/chemistry/octopus { };
|
||||||
|
|
||||||
openmolcas = callPackage ../applications/science/chemistry/openmolcas { };
|
openmolcas = callPackage ../applications/science/chemistry/openmolcas { };
|
||||||
|
|
||||||
|
@ -24430,7 +24417,9 @@ in
|
||||||
|
|
||||||
arpack = callPackage ../development/libraries/science/math/arpack { };
|
arpack = callPackage ../development/libraries/science/math/arpack { };
|
||||||
|
|
||||||
blas = callPackage ../development/libraries/science/math/blas { };
|
blas = callPackage ../build-support/alternatives/blas { };
|
||||||
|
|
||||||
|
blas-reference = callPackage ../development/libraries/science/math/blas { };
|
||||||
|
|
||||||
brial = callPackage ../development/libraries/science/math/brial { };
|
brial = callPackage ../development/libraries/science/math/brial { };
|
||||||
|
|
||||||
|
@ -24450,12 +24439,15 @@ in
|
||||||
|
|
||||||
jags = callPackage ../applications/science/math/jags { };
|
jags = callPackage ../applications/science/math/jags { };
|
||||||
|
|
||||||
|
lapack = callPackage ../build-support/alternatives/lapack { };
|
||||||
|
|
||||||
|
lapack-reference = callPackage ../development/libraries/science/math/liblapack { };
|
||||||
|
liblapack = lapack-reference;
|
||||||
|
|
||||||
libbraiding = callPackage ../development/libraries/science/math/libbraiding { };
|
libbraiding = callPackage ../development/libraries/science/math/libbraiding { };
|
||||||
|
|
||||||
libhomfly = callPackage ../development/libraries/science/math/libhomfly { };
|
libhomfly = callPackage ../development/libraries/science/math/libhomfly { };
|
||||||
|
|
||||||
liblapack = callPackage ../development/libraries/science/math/liblapack {};
|
|
||||||
|
|
||||||
liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { };
|
liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { };
|
||||||
|
|
||||||
lrs = callPackage ../development/libraries/science/math/lrs { };
|
lrs = callPackage ../development/libraries/science/math/lrs { };
|
||||||
|
@ -24538,7 +24530,7 @@ in
|
||||||
|
|
||||||
sympow = callPackage ../development/libraries/science/math/sympow { };
|
sympow = callPackage ../development/libraries/science/math/sympow { };
|
||||||
|
|
||||||
ipopt = callPackage ../development/libraries/science/math/ipopt { openblas = openblasCompat; };
|
ipopt = callPackage ../development/libraries/science/math/ipopt { };
|
||||||
|
|
||||||
gmsh = callPackage ../applications/science/math/gmsh { };
|
gmsh = callPackage ../applications/science/math/gmsh { };
|
||||||
|
|
||||||
|
|
|
@ -4667,9 +4667,7 @@ in {
|
||||||
Nuitka = callPackage ../development/python-modules/nuitka { };
|
Nuitka = callPackage ../development/python-modules/nuitka { };
|
||||||
|
|
||||||
numpy = let
|
numpy = let
|
||||||
numpy_ = callPackage ../development/python-modules/numpy {
|
numpy_ = callPackage ../development/python-modules/numpy { };
|
||||||
blas = pkgs.openblasCompat;
|
|
||||||
};
|
|
||||||
numpy_2 = numpy_.overridePythonAttrs(oldAttrs: rec {
|
numpy_2 = numpy_.overridePythonAttrs(oldAttrs: rec {
|
||||||
version = "1.16.5";
|
version = "1.16.5";
|
||||||
src = oldAttrs.src.override {
|
src = oldAttrs.src.override {
|
||||||
|
@ -4952,11 +4950,7 @@ in {
|
||||||
|
|
||||||
promise = callPackage ../development/python-modules/promise { };
|
promise = callPackage ../development/python-modules/promise { };
|
||||||
|
|
||||||
prox-tv = callPackage ../development/python-modules/prox-tv {
|
prox-tv = callPackage ../development/python-modules/prox-tv { };
|
||||||
# We need to use blas instead of openblas on darwin,
|
|
||||||
# see https://github.com/NixOS/nixpkgs/pull/45013.
|
|
||||||
useOpenblas = ! stdenv.isDarwin;
|
|
||||||
};
|
|
||||||
|
|
||||||
pvlib = callPackage ../development/python-modules/pvlib { };
|
pvlib = callPackage ../development/python-modules/pvlib { };
|
||||||
|
|
||||||
|
|
91
pkgs/top-level/release-alternatives.nix
Normal file
91
pkgs/top-level/release-alternatives.nix
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
{ pkgsFun ? import ../..
|
||||||
|
, lib ? import ../../lib
|
||||||
|
, supportedSystems ? ["x86_64-linux"]
|
||||||
|
, allowUnfree ? false }:
|
||||||
|
|
||||||
|
let
|
||||||
|
|
||||||
|
# called BLAS here, but also tests LAPACK
|
||||||
|
blasUsers = [
|
||||||
|
# "julia_07" "julia_10" "julia_11" "julia_13" "octave" "octaveFull"
|
||||||
|
"fflas-ffpack" "linbox" "R" "ipopt" "hpl" "rspamd" "octopus"
|
||||||
|
"sundials" "sundials_2" "superlu" "suitesparse_5_3" "suitesparse_4_4"
|
||||||
|
"suitesparse_4_2" "scs" "scalapack" "petsc" "cholmod-extra"
|
||||||
|
"arpack" "qrupdate" "libcint" "iml" "globalarrays" "arrayfire" "armadillo"
|
||||||
|
"xfitter" "lammps" "plink-ng" "quantum-espresso" "siesta"
|
||||||
|
"siesta-mpi" "shogun" "calculix" "csdp" "getdp" "giac" "gmsh" "jags"
|
||||||
|
"lammps" "lammps-mpi"
|
||||||
|
|
||||||
|
# requires openblas
|
||||||
|
# "caffe" "mxnet" "flint" "sage" "sageWithDoc"
|
||||||
|
|
||||||
|
# broken
|
||||||
|
# "gnss-sdr" "octave-jit" "openmodelica" "torch"
|
||||||
|
|
||||||
|
# subpackages
|
||||||
|
["pythonPackages" "numpy"] ["pythonPackages" "prox-tv"] ["pythonPackages" "scs"]
|
||||||
|
["pythonPackages" "pysparse"] ["pythonPackages" "cvxopt"]
|
||||||
|
# ["pythonPackages" "fenics"]
|
||||||
|
["rPackages" "slfm"] ["rPackages" "SamplerCompare"]
|
||||||
|
# ["rPackages" "EMCluster"]
|
||||||
|
# ["ocamlPackages" "lacaml"]
|
||||||
|
# ["ocamlPackages" "owl"]
|
||||||
|
["haskellPackages" "bindings-levmar"]
|
||||||
|
] ++ lib.optionals allowUnfree [ "magma" ];
|
||||||
|
blas64Users = [
|
||||||
|
"rspamd" "suitesparse_5_3" "suitesparse_4_4"
|
||||||
|
"suitesparse_4_2" "petsc" "cholmod-extra"
|
||||||
|
"arpack" "qrupdate" "iml" "globalarrays" "arrayfire"
|
||||||
|
"xfitter" "lammps" "plink-ng" "quantum-espresso"
|
||||||
|
"calculix" "csdp" "getdp" "jags"
|
||||||
|
"lammps" "lammps-mpi"
|
||||||
|
# ["ocamlPackages" "lacaml"]
|
||||||
|
["haskellPackages" "bindings-levmar"]
|
||||||
|
] ++ lib.optionals allowUnfree [ "magma" ];
|
||||||
|
blasProviders = system: [ "openblasCompat" "lapack-reference" "openblas" ]
|
||||||
|
++ lib.optionals (allowUnfree && system.isx86) ["mkl" "mkl64"];
|
||||||
|
|
||||||
|
blas64Providers = [ "mkl64" "openblas"];
|
||||||
|
|
||||||
|
mapListToAttrs = xs: f: builtins.listToAttrs (map (name: {
|
||||||
|
name = if builtins.isList name
|
||||||
|
then builtins.elemAt name (builtins.length name - 1)
|
||||||
|
else name;
|
||||||
|
value = f name;
|
||||||
|
}) xs);
|
||||||
|
|
||||||
|
in
|
||||||
|
|
||||||
|
{
|
||||||
|
blas = mapListToAttrs supportedSystems (system': let system = lib.systems.elaborate { system = system'; };
|
||||||
|
in mapListToAttrs (blasProviders system) (provider: let
|
||||||
|
is64bit = builtins.elem provider (["mkl64"] ++ lib.optional system.is64bit "openblas");
|
||||||
|
pkgs = pkgsFun {
|
||||||
|
config = { inherit allowUnfree; };
|
||||||
|
system = system';
|
||||||
|
overlays = [(self: super: {
|
||||||
|
lapack = super.lapack.override {
|
||||||
|
lapackProvider = if provider == "mkl64"
|
||||||
|
then super.mkl
|
||||||
|
else builtins.getAttr provider super;
|
||||||
|
inherit is64bit;
|
||||||
|
};
|
||||||
|
blas = super.blas.override {
|
||||||
|
blasProvider = if provider == "mkl64"
|
||||||
|
then super.mkl
|
||||||
|
else builtins.getAttr provider super;
|
||||||
|
inherit is64bit;
|
||||||
|
};
|
||||||
|
})];
|
||||||
|
};
|
||||||
|
in mapListToAttrs (if builtins.elem provider blas64Providers
|
||||||
|
then blas64Users else blasUsers)
|
||||||
|
(attr: if builtins.isList attr
|
||||||
|
then lib.getAttrFromPath attr pkgs
|
||||||
|
else builtins.getAttr attr pkgs)
|
||||||
|
|
||||||
|
// { recurseForDerivations = true; })
|
||||||
|
// { recurseForDerivations = true; })
|
||||||
|
// { recurseForDerivations = true; };
|
||||||
|
recurseForDerivations = true;
|
||||||
|
}
|
|
@ -78,9 +78,9 @@ with import ./release-lib.nix { inherit supportedSystems; };
|
||||||
kvm = linux;
|
kvm = linux;
|
||||||
qemu = linux;
|
qemu = linux;
|
||||||
qemu_kvm = linux;
|
qemu_kvm = linux;
|
||||||
|
lapack-reference = linux;
|
||||||
less = all;
|
less = all;
|
||||||
lftp = all;
|
lftp = all;
|
||||||
liblapack = linux;
|
|
||||||
libtool = all;
|
libtool = all;
|
||||||
libtool_2 = all;
|
libtool_2 = all;
|
||||||
libxml2 = all;
|
libxml2 = all;
|
||||||
|
|
Loading…
Reference in a new issue