mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-23 04:25:14 +00:00
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
|
||||
, uhd
|
||||
, log4cpp
|
||||
, openblas
|
||||
, blas, lapack
|
||||
, matio
|
||||
, pugixml
|
||||
, protobuf
|
||||
@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
|
||||
# nothing to be gained by leaving it out.
|
||||
uhd
|
||||
log4cpp
|
||||
openblas
|
||||
blas lapack
|
||||
matio
|
||||
pugixml
|
||||
protobuf
|
||||
@ -63,8 +63,8 @@ stdenv.mkDerivation rec {
|
||||
# armadillo is built using both, so skip checking for them.
|
||||
"-DBLAS=YES"
|
||||
"-DLAPACK=YES"
|
||||
"-DBLAS_LIBRARIES=-lopenblas"
|
||||
"-DLAPACK_LIBRARIES=-lopenblas"
|
||||
"-DBLAS_LIBRARIES=-lblas"
|
||||
"-DLAPACK_LIBRARIES=-llapack"
|
||||
|
||||
# Similarly, it doesn't actually use gfortran despite checking for
|
||||
# its presence.
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchFromGitHub, zlib, openblas, darwin}:
|
||||
{ stdenv, fetchFromGitHub, zlib, blas, lapack, darwin}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "plink-ng";
|
||||
@ -11,14 +11,20 @@ stdenv.mkDerivation rec {
|
||||
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
|
||||
${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 = ''
|
||||
mkdir -p $out/bin
|
||||
cp plink $out/bin
|
||||
@ -31,4 +37,3 @@ stdenv.mkDerivation rec {
|
||||
platforms = stdenv.lib.platforms.linux;
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,9 @@
|
||||
{ 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 {
|
||||
pname = "octopus";
|
||||
version = "9.2";
|
||||
@ -14,12 +16,12 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ perl procps autoreconfHook ];
|
||||
buildInputs = [ libyaml gfortran libxc openblas gsl fftw netcdf arpack ];
|
||||
buildInputs = [ libyaml gfortran libxc blas lapack gsl fftw netcdf arpack ];
|
||||
|
||||
configureFlags = [
|
||||
"--with-yaml-prefix=${libyaml}"
|
||||
"--with-blas=-lopenblas"
|
||||
"--with-lapack=-lopenblas"
|
||||
"--with-blas=-lblas"
|
||||
"--with-lapack=-llapack"
|
||||
"--with-fftw-prefix=${fftw.dev}"
|
||||
"--with-gsl-prefix=${gsl}"
|
||||
"--with-libxc-prefix=${libxc}"
|
||||
|
@ -1,9 +1,11 @@
|
||||
{ stdenv, fetchFromGitLab, cmake, gfortran, perl
|
||||
, openblas, hdf5-cpp, python3, texlive
|
||||
, openblas, blas, lapack, hdf5-cpp, python3, texlive
|
||||
, armadillo, openmpi, globalarrays, openssh
|
||||
, makeWrapper, fetchpatch
|
||||
} :
|
||||
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
let
|
||||
version = "19.11";
|
||||
gitLabRev = "v${version}";
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchurl
|
||||
, gfortran, fftw, openblas
|
||||
, gfortran, fftw, blas, lapack
|
||||
, mpi ? null
|
||||
}:
|
||||
|
||||
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
|
||||
patchShebangs configure
|
||||
'';
|
||||
|
||||
buildInputs = [ fftw openblas gfortran ]
|
||||
buildInputs = [ fftw blas lapack gfortran ]
|
||||
++ (stdenv.lib.optionals (mpi != null) [ mpi ]);
|
||||
|
||||
configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchurl
|
||||
, gfortran, openblas
|
||||
, gfortran, blas, lapack
|
||||
, mpi ? null, scalapack
|
||||
}:
|
||||
|
||||
@ -16,7 +16,7 @@ stdenv.mkDerivation {
|
||||
inherit mpi;
|
||||
};
|
||||
|
||||
buildInputs = [ openblas gfortran ]
|
||||
buildInputs = [ blas lapack gfortran ]
|
||||
++ (stdenv.lib.optionals (mpi != null) [ mpi scalapack ]);
|
||||
|
||||
enableParallelBuilding = true;
|
||||
@ -33,11 +33,11 @@ stdenv.mkDerivation {
|
||||
makeFlagsArray=(
|
||||
CC="mpicc" FC="mpifort"
|
||||
FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
|
||||
COMP_LIBS="" LIBS="-lopenblas -lscalapack"
|
||||
COMP_LIBS="" LIBS="-lblas -llapack -lscalapack"
|
||||
);
|
||||
'' else ''
|
||||
makeFlagsArray=(
|
||||
COMP_LIBS="" LIBS="-lopenblas"
|
||||
COMP_LIBS="" LIBS="-lblas -llapack"
|
||||
);
|
||||
'';
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
# data, compression
|
||||
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
|
||||
# maths
|
||||
, openblasCompat, eigen, nlopt, lp_solve, colpack, liblapack, glpk
|
||||
, blas, lapack, eigen, nlopt, lp_solve, colpack, glpk
|
||||
# libraries
|
||||
, libarchive, libxml2
|
||||
# extra support
|
||||
@ -13,6 +13,8 @@
|
||||
assert pythonSupport -> pythonPackages != null;
|
||||
assert opencvSupport -> opencv != null;
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
let
|
||||
pname = "shogun";
|
||||
version = "6.1.4";
|
||||
@ -64,8 +66,8 @@ stdenv.mkDerivation rec {
|
||||
CCACHE_DIR=".ccache";
|
||||
|
||||
buildInputs = with lib; [
|
||||
openblasCompat bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
|
||||
protobuf nlopt snappy swig (libarchive.dev) libxml2 liblapack glpk
|
||||
blas lapack bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
|
||||
protobuf nlopt snappy swig (libarchive.dev) libxml2 lapack glpk
|
||||
]
|
||||
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
|
||||
++ optional (opencvSupport) opencv;
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
|
||||
, 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
|
||||
, withRecommendedPackages ? true
|
||||
, enableStrictBarrier ? false
|
||||
@ -9,6 +9,8 @@
|
||||
, static ? false
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "R-3.6.3";
|
||||
|
||||
@ -22,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [
|
||||
bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
|
||||
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 ];
|
||||
|
||||
patches = [
|
||||
@ -43,8 +45,8 @@ stdenv.mkDerivation rec {
|
||||
configureFlagsArray=(
|
||||
--disable-lto
|
||||
--with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
|
||||
--with-blas="-L${openblas}/lib -lopenblas"
|
||||
--with-lapack="-L${openblas}/lib -lopenblas"
|
||||
--with-blas="-L${blas}/lib -lblas"
|
||||
--with-lapack="-L${lapack}/lib -llapack"
|
||||
--with-readline
|
||||
--with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh"
|
||||
--with-cairo
|
||||
|
@ -9,7 +9,7 @@
|
||||
, opencv3
|
||||
, protobuf
|
||||
, doxygen
|
||||
, openblas
|
||||
, blas
|
||||
, Accelerate, CoreGraphics, CoreVideo
|
||||
, lmdbSupport ? true, lmdb
|
||||
, leveldbSupport ? true, leveldb, snappy
|
||||
@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
|
||||
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
|
||||
++ ["-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 cudnnSupport cudnn
|
||||
++ lib.optional lmdbSupport lmdb
|
||||
|
@ -15,7 +15,7 @@ index 9cab2fc..6e977b8 100755
|
||||
OCCXMAIN = $(SCCXMAIN:.c=.o)
|
||||
|
||||
-DIR=../../../SPOOLES.2.2
|
||||
+LIBS = -lpthread -lm -lc -lspooles -larpack -lopenblas
|
||||
+LIBS = -lpthread -lm -lc -lspooles -larpack -lblas -llapack
|
||||
|
||||
-LIBS = \
|
||||
- $(DIR)/spooles.a \
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, gfortran, arpack, spooles, openblas }:
|
||||
{ stdenv, fetchurl, gfortran, arpack, spooles, blas, lapack }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "calculix";
|
||||
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
|
||||
buildInputs = [ arpack spooles openblas ];
|
||||
buildInputs = [ arpack spooles blas lapack ];
|
||||
|
||||
NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles";
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
{ lib, stdenv, fetchgit, fetchFromGitHub, cmake
|
||||
, openblas, opencv3, libzip, boost, protobuf, openmpi
|
||||
, openblas, blas, lapack, opencv3, libzip, boost, protobuf, openmpi
|
||||
, onebitSGDSupport ? false
|
||||
, cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
|
||||
, cudnnSupport ? cudaSupport, cudnn
|
||||
}:
|
||||
|
||||
assert cudnnSupport -> cudaSupport;
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
let
|
||||
# Old specific version required for CNTK.
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ lib, stdenv, fetchurl, blas, gfortran, liblapack }:
|
||||
{ lib, stdenv, fetchurl, blas, gfortran, lapack }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "csdp-6.1.1";
|
||||
@ -8,7 +8,7 @@ stdenv.mkDerivation {
|
||||
sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05";
|
||||
};
|
||||
|
||||
buildInputs = [ blas gfortran.cc.lib liblapack ];
|
||||
buildInputs = [ blas gfortran.cc.lib lapack ];
|
||||
|
||||
postPatch = ''
|
||||
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 {
|
||||
name = "getdp-${version}";
|
||||
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake gfortran ];
|
||||
buildInputs = [ openblas openmpi petsc python3 ];
|
||||
buildInputs = [ blas lapack openmpi petsc python3 ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A General Environment for the Treatment of Discrete Problems";
|
||||
|
@ -1,10 +1,11 @@
|
||||
{ stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, liblapack
|
||||
, gmp, mpfr, pari, ntl, gsl, blas, mpfi, ecm, glpk, nauty
|
||||
{ stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, lapack, blas
|
||||
, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
|
||||
, readline, gettext, libpng, libao, gfortran, perl
|
||||
, enableGUI ? false, libGL ? null, libGLU ? null, xorg ? null, fltk ? null
|
||||
}:
|
||||
|
||||
assert enableGUI -> libGLU != null && libGL != null && xorg != null && fltk != null;
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
|
||||
@ -41,7 +42,7 @@ stdenv.mkDerivation rec {
|
||||
# gfortran.cc default output contains static libraries compiled without -fPIC
|
||||
# we want libgfortran.so.3 instead
|
||||
(stdenv.lib.getLib gfortran.cc)
|
||||
liblapack
|
||||
lapack blas
|
||||
] ++ stdenv.lib.optionals enableGUI [
|
||||
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 }:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gmsh";
|
||||
version = "4.5.6";
|
||||
@ -10,7 +12,7 @@ stdenv.mkDerivation rec {
|
||||
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
|
||||
xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE
|
||||
opencascade-occt
|
||||
|
@ -1,4 +1,4 @@
|
||||
{stdenv, fetchurl, gfortran, openblas}:
|
||||
{stdenv, fetchurl, gfortran, blas, lapack}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "JAGS-4.3.0";
|
||||
@ -6,8 +6,8 @@ stdenv.mkDerivation rec {
|
||||
url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
|
||||
sha256 = "1z3icccg2ic56vmhyrpinlsvpq7kcaflk1731rgpvz9bk1bxvica";
|
||||
};
|
||||
buildInputs = [gfortran openblas];
|
||||
configureFlags = [ "--with-blas=-lopenblas" "--with-lapack=-lopenblas" ];
|
||||
buildInputs = [gfortran blas lapack];
|
||||
configureFlags = [ "--with-blas=-lblas" "--with-lapack=-llapack" ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Just Another Gibbs Sampler";
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ config, stdenv, lib, fetchurl, bash, cmake
|
||||
, opencv3, gtest, openblas, liblapack, perl
|
||||
, opencv3, gtest, blas, perl
|
||||
, cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11
|
||||
, cudnnSupport ? cudaSupport, cudnn
|
||||
}:
|
||||
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ cmake perl ];
|
||||
|
||||
buildInputs = [ opencv3 gtest openblas liblapack ]
|
||||
buildInputs = [ opencv3 gtest blas ]
|
||||
++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
|
||||
++ lib.optional cudnnSupport cudnn;
|
||||
|
||||
@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
|
||||
substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
|
||||
--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
|
||||
rm -rf 3rdparty/openmp
|
||||
'';
|
||||
|
@ -41,7 +41,8 @@
|
||||
, lcalc
|
||||
, rubiks
|
||||
, flintqs
|
||||
, openblasCompat
|
||||
, blas
|
||||
, lapack
|
||||
, flint
|
||||
, gmp
|
||||
, mpfr
|
||||
@ -53,6 +54,8 @@
|
||||
, less
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
# 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
|
||||
# dependencies.
|
||||
@ -114,7 +117,7 @@ writeTextFile rec {
|
||||
# testsuite instead, but since all the packages are also runtime
|
||||
# dependencies it doesn't really hurt to include them here.
|
||||
singular
|
||||
openblasCompat
|
||||
blas lapack
|
||||
fflas-ffpack givaro
|
||||
gd
|
||||
libpng zlib
|
||||
|
@ -2,7 +2,8 @@
|
||||
, lib
|
||||
, makeWrapper
|
||||
, sage-env
|
||||
, openblasCompat
|
||||
, blas
|
||||
, lapack
|
||||
, pkg-config
|
||||
, three
|
||||
, singular
|
||||
@ -21,6 +22,9 @@
|
||||
, pythonEnv
|
||||
}:
|
||||
|
||||
# lots of segfaults with (64 bit) blas
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
# Wrapper that combined `sagelib` with `sage-env` to produce an actually
|
||||
# executable sage. No tests are run yet and no documentation is built.
|
||||
|
||||
@ -29,7 +33,7 @@ let
|
||||
pythonEnv # for patchShebangs
|
||||
makeWrapper
|
||||
pkg-config
|
||||
openblasCompat # lots of segfaults with regular (64 bit) openblas
|
||||
blas lapack
|
||||
singular
|
||||
three
|
||||
pynac
|
||||
|
@ -3,7 +3,8 @@
|
||||
, perl
|
||||
, buildPythonPackage
|
||||
, arb
|
||||
, openblasCompat
|
||||
, blas
|
||||
, lapack
|
||||
, brial
|
||||
, cliquer
|
||||
, cypari2
|
||||
@ -52,6 +53,8 @@
|
||||
, pplpy
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
# 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
|
||||
# find many of its dependencies without `sage-env`, will not be tested without
|
||||
@ -103,7 +106,8 @@ buildPythonPackage rec {
|
||||
m4rie
|
||||
mpfi
|
||||
ntl
|
||||
openblasCompat
|
||||
blas
|
||||
lapack
|
||||
pari
|
||||
planarity
|
||||
ppl
|
||||
|
@ -1,5 +1,5 @@
|
||||
{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,
|
||||
doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
|
||||
|
||||
@ -15,7 +15,7 @@ stdenv.mkDerivation {
|
||||
src = fetchgit (import ./src-main.nix);
|
||||
|
||||
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
|
||||
doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu
|
||||
git gtk2 makeWrapper];
|
||||
@ -40,7 +40,7 @@ stdenv.mkDerivation {
|
||||
for e in $(cd $out/bin && ls); do
|
||||
wrapProgram $out/bin/$e \
|
||||
--prefix PATH : "${gnumake}/bin" \
|
||||
--prefix LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ liblapack blas ]}"
|
||||
--prefix LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ lapack blas ]}"
|
||||
done
|
||||
'';
|
||||
|
||||
@ -53,5 +53,3 @@ stdenv.mkDerivation {
|
||||
broken = true;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchFromGitHub
|
||||
, libpng, gzip, fftw, openblas
|
||||
, libpng, gzip, fftw, blas, lapack
|
||||
, mpi ? null
|
||||
}:
|
||||
let packages = [
|
||||
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
||||
inherit packages;
|
||||
};
|
||||
|
||||
buildInputs = [ fftw libpng openblas gzip ]
|
||||
buildInputs = [ fftw libpng blas lapack gzip ]
|
||||
++ (stdenv.lib.optionals withMPI [ mpi ]);
|
||||
|
||||
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 {
|
||||
pname = "xfitter";
|
||||
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = [ gfortran which ];
|
||||
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
|
||||
++ 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
|
||||
, libpng, libjpeg, mesa, eigen, openblas
|
||||
, libpng, libjpeg, mesa, eigen
|
||||
, openblas, blas, lapack
|
||||
}:
|
||||
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
let
|
||||
version = "2019_08_27";
|
||||
|
||||
|
@ -7,28 +7,22 @@
|
||||
# standard library dependencies
|
||||
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
||||
# linear algebra
|
||||
, openblas, arpack
|
||||
, blas, lapack, arpack
|
||||
# Darwin frameworks
|
||||
, CoreServices, ApplicationServices
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
# All dependencies must use the same OpenBLAS.
|
||||
let
|
||||
arpack_ = arpack;
|
||||
in
|
||||
let
|
||||
arpack = arpack_.override { inherit openblas; };
|
||||
in
|
||||
|
||||
let
|
||||
majorVersion = "1";
|
||||
minorVersion = "3";
|
||||
maintenanceVersion = "1";
|
||||
src_sha256 = "0q9a7yc3b235psrwl5ghyxgwly25lf8n818l8h6bkf2ymdbsv5p6";
|
||||
version = "${majorVersion}.${minorVersion}.${maintenanceVersion}";
|
||||
in
|
||||
in
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "julia";
|
||||
@ -67,7 +61,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [
|
||||
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
|
||||
pcre2.dev openblas openlibm openspecfun readline utf8proc
|
||||
pcre2.dev blas lapack openlibm openspecfun readline utf8proc
|
||||
zlib
|
||||
]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
|
||||
@ -94,13 +88,9 @@ stdenv.mkDerivation rec {
|
||||
"SHELL=${stdenv.shell}"
|
||||
|
||||
"USE_SYSTEM_BLAS=1"
|
||||
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
|
||||
"LIBBLAS=-lopenblas"
|
||||
"LIBBLASNAME=libopenblas"
|
||||
"USE_BLAS64=${if blas.is64bit then "1" else "0"}"
|
||||
|
||||
"USE_SYSTEM_LAPACK=1"
|
||||
"LIBLAPACK=-lopenblas"
|
||||
"LIBLAPACKNAME=libopenblas"
|
||||
|
||||
"USE_SYSTEM_ARPACK=1"
|
||||
"USE_SYSTEM_FFTW=1"
|
||||
@ -123,7 +113,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
LD_LIBRARY_PATH = makeLibraryPath [
|
||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
|
||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr blas openlibm
|
||||
openspecfun pcre2
|
||||
];
|
||||
|
||||
|
@ -15,20 +15,14 @@
|
||||
# standard library dependencies
|
||||
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
|
||||
# linear algebra
|
||||
, openblas, arpack
|
||||
, blas, lapack, arpack
|
||||
# Darwin frameworks
|
||||
, CoreServices, ApplicationServices
|
||||
}:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
# All dependencies must use the same OpenBLAS.
|
||||
let
|
||||
arpack_ = arpack;
|
||||
in
|
||||
let
|
||||
arpack = arpack_.override { inherit openblas; };
|
||||
in
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
let
|
||||
dsfmtVersion = "2.2.3";
|
||||
@ -118,7 +112,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [
|
||||
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
|
||||
pcre2.dev openblas openlibm openspecfun readline utf8proc
|
||||
pcre2.dev blas lapack openlibm openspecfun readline utf8proc
|
||||
zlib
|
||||
]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
|
||||
@ -143,13 +137,9 @@ stdenv.mkDerivation rec {
|
||||
"SHELL=${stdenv.shell}"
|
||||
|
||||
"USE_SYSTEM_BLAS=1"
|
||||
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}"
|
||||
"LIBBLAS=-lopenblas"
|
||||
"LIBBLASNAME=libopenblas"
|
||||
"USE_BLAS64=${if blas.is64bit then "1" else "0"}"
|
||||
|
||||
"USE_SYSTEM_LAPACK=1"
|
||||
"LIBLAPACK=-lopenblas"
|
||||
"LIBLAPACKNAME=libopenblas"
|
||||
|
||||
"USE_SYSTEM_ARPACK=1"
|
||||
"USE_SYSTEM_FFTW=1"
|
||||
@ -173,7 +163,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
LD_LIBRARY_PATH = makeLibraryPath [
|
||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm
|
||||
arpack fftw fftwSinglePrec gmp libgit2 mpfr blas lapack openlibm
|
||||
openspecfun pcre2
|
||||
];
|
||||
|
||||
|
@ -114,13 +114,8 @@ self: super: {
|
||||
# Depends on broken "hails" package.
|
||||
hails-bin = dontDistribute super.hails-bin;
|
||||
|
||||
# Switch levmar build to openblas.
|
||||
bindings-levmar = overrideCabal super.bindings-levmar (drv: {
|
||||
preConfigure = ''
|
||||
sed -i bindings-levmar.cabal \
|
||||
-e 's,extra-libraries: lapack blas,extra-libraries: openblas,'
|
||||
'';
|
||||
extraLibraries = [ pkgs.openblasCompat ];
|
||||
extraLibraries = [ pkgs.blas ];
|
||||
});
|
||||
|
||||
# The Haddock phase fails for one reason or another.
|
||||
|
@ -21,7 +21,7 @@
|
||||
, zlib
|
||||
, curl
|
||||
, qrupdate
|
||||
, openblas
|
||||
, blas, lapack
|
||||
, arpack
|
||||
, libwebp
|
||||
, gl2ps
|
||||
@ -53,17 +53,7 @@
|
||||
, darwin
|
||||
}:
|
||||
|
||||
let
|
||||
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
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "5.2.0";
|
||||
@ -85,7 +75,8 @@ stdenv.mkDerivation rec {
|
||||
fltk
|
||||
zlib
|
||||
curl
|
||||
openblas
|
||||
blas
|
||||
lapack
|
||||
libsndfile
|
||||
fftw
|
||||
fftwSinglePrec
|
||||
@ -134,15 +125,15 @@ stdenv.mkDerivation rec {
|
||||
enableParallelBuilding = true;
|
||||
|
||||
# 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 = [
|
||||
"--with-blas=openblas"
|
||||
"--with-lapack=openblas"
|
||||
"--with-blas=blas"
|
||||
"--with-lapack=lapack"
|
||||
(if blas.is64bit then "--enable-64" else "--disable-64")
|
||||
]
|
||||
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ])
|
||||
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
|
||||
++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ]
|
||||
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
|
||||
++ stdenv.lib.optionals enableQt [ "--with-qt=5" ]
|
||||
++ 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 {
|
||||
pname = "armadillo";
|
||||
@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ openblasCompat superlu hdf5 ];
|
||||
buildInputs = [ blas lapack superlu hdf5 ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DLAPACK_LIBRARY=${openblasCompat}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
"-DLAPACK_LIBRARY=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
"-DDETECT_HDF5=ON"
|
||||
];
|
||||
|
||||
|
@ -1,14 +1,12 @@
|
||||
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
|
||||
, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
|
||||
, blas, openblas, boost, mesa, libGLU, libGL
|
||||
, opencl-clhpp, ocl-icd, fftw, fftwFloat
|
||||
, blas, lapack, boost, mesa, libGLU, libGL
|
||||
, freeimage, python, clfft, clblas
|
||||
, doxygen, buildDocs ? false
|
||||
, cudaSupport ? false, cudatoolkit
|
||||
}:
|
||||
|
||||
let
|
||||
strOnLinux = stdenv.lib.optionalString stdenv.isLinux;
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "arrayfire";
|
||||
version = "3.6.4";
|
||||
|
||||
@ -21,8 +19,7 @@ in stdenv.mkDerivation rec {
|
||||
"-DAF_BUILD_OPENCL=OFF"
|
||||
"-DAF_BUILD_EXAMPLES=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 ];
|
||||
|
||||
@ -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
|
||||
'';
|
||||
|
||||
preBuild = strOnLinux ''
|
||||
preBuild = stdenv.lib.optionalString cudaSupport ''
|
||||
export CUDA_PATH="${cudatoolkit}"
|
||||
'';
|
||||
|
||||
@ -49,13 +46,13 @@ in stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [
|
||||
opencl-clhpp fftw fftwFloat
|
||||
mkl
|
||||
openblas
|
||||
blas lapack
|
||||
libGLU libGL
|
||||
mesa freeimage
|
||||
boost.out boost.dev
|
||||
] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ])
|
||||
++ (stdenv.lib.optional buildDocs [ doxygen ]);
|
||||
] ++ (stdenv.lib.optional stdenv.isLinux ocl-icd)
|
||||
++ (stdenv.lib.optional cudaSupport cudatoolkit)
|
||||
++ (stdenv.lib.optional buildDocs doxygen);
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
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
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "fflas-ffpack";
|
||||
version = "2.4.3";
|
||||
@ -23,11 +26,11 @@ stdenv.mkDerivation rec {
|
||||
pkgconfig
|
||||
] ++ stdenv.lib.optionals doCheck checkInputs;
|
||||
|
||||
buildInputs = [ givaro blas ];
|
||||
buildInputs = [ givaro blas lapack ];
|
||||
|
||||
configureFlags = [
|
||||
"--with-blas-libs=-l${blas.linkName}"
|
||||
"--with-lapack-libs=-l${blas.linkName}"
|
||||
"--with-blas-libs=-lcblas"
|
||||
"--with-lapack-libs=-llapacke"
|
||||
] ++ stdenv.lib.optionals stdenv.isx86_64 {
|
||||
# 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)
|
||||
|
@ -5,11 +5,11 @@
|
||||
, mpir
|
||||
, mpfr
|
||||
, ntl
|
||||
, openblas ? null
|
||||
, openblas ? null, blas, lapack
|
||||
, withBlas ? true
|
||||
}:
|
||||
|
||||
assert withBlas -> openblas != null;
|
||||
assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "flint";
|
||||
|
@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
|
||||
enableParallelBuilding = true;
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
buildInputs = [autoconf automake libtool gmpxx];
|
||||
buildInputs = [autoconf automake libtool];
|
||||
propagatedBuildInputs = [ gmpxx ];
|
||||
|
||||
configureFlags = [
|
||||
"--disable-optimization"
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
|
||||
, openblas, gfortran, openssh, openmpi
|
||||
, blas, gfortran, openssh, openmpi
|
||||
} :
|
||||
|
||||
let
|
||||
@ -17,7 +17,7 @@ in stdenv.mkDerivation {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ autoreconfHook ];
|
||||
buildInputs = [ openmpi openblas gfortran openssh ];
|
||||
buildInputs = [ openmpi blas gfortran openssh ];
|
||||
|
||||
preConfigure = ''
|
||||
configureFlagsArray+=( "--enable-i8" \
|
||||
@ -25,7 +25,7 @@ in stdenv.mkDerivation {
|
||||
"--with-mpi3" \
|
||||
"--enable-eispack" \
|
||||
"--enable-underscoring" \
|
||||
"--with-blas8=${openblas}/lib -lopenblas" )
|
||||
"--with-blas8=${blas}/lib -lblas" )
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
@ -38,5 +38,3 @@ in stdenv.mkDerivation {
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{stdenv, autoreconfHook, fetchurl, gmp, openblas}:
|
||||
{stdenv, autoreconfHook, fetchurl, gmp, blas}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "iml";
|
||||
version = "1.0.5";
|
||||
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
buildInputs = [
|
||||
gmp
|
||||
openblas
|
||||
blas
|
||||
];
|
||||
nativeBuildInputs = [
|
||||
autoreconfHook
|
||||
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||
configureFlags = [
|
||||
"--with-gmp-include=${gmp.dev}/include"
|
||||
"--with-gmp-lib=${gmp}/lib"
|
||||
"--with-cblas=-lopenblas"
|
||||
"--with-cblas=-lblas"
|
||||
];
|
||||
meta = {
|
||||
inherit version;
|
||||
|
@ -2,7 +2,7 @@
|
||||
, lib
|
||||
, fetchFromGitHub
|
||||
, cmake
|
||||
, openblas
|
||||
, blas
|
||||
# Check Inputs
|
||||
, python2
|
||||
}:
|
||||
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ openblas ];
|
||||
buildInputs = [ blas ];
|
||||
cmakeFlags = [
|
||||
"-DENABLE_TEST=1"
|
||||
"-DQUICK_TEST=1"
|
||||
|
@ -4,10 +4,14 @@
|
||||
, givaro
|
||||
, pkgconfig
|
||||
, blas
|
||||
, lapack
|
||||
, fflas-ffpack
|
||||
, gmpxx
|
||||
, withSage ? false # sage support
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "linbox";
|
||||
version = "1.6.3";
|
||||
@ -33,7 +37,7 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
configureFlags = [
|
||||
"--with-blas-libs=-l${blas.linkName}"
|
||||
"--with-blas-libs=-lblas"
|
||||
"--disable-optimization"
|
||||
] ++ stdenv.lib.optionals stdenv.isx86_64 {
|
||||
# disable SIMD instructions (which are enabled *when available* by default)
|
||||
|
@ -11,7 +11,7 @@
|
||||
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase
|
||||
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
|
||||
, enableEigen ? true, eigen
|
||||
, enableOpenblas ? true, openblas
|
||||
, enableOpenblas ? true, openblas, blas, lapack
|
||||
, enableContrib ? true
|
||||
|
||||
, enableCuda ? (config.cudaSupport or false) &&
|
||||
@ -35,6 +35,8 @@
|
||||
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
|
||||
}:
|
||||
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
let
|
||||
version = "3.4.8";
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase
|
||||
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
|
||||
, enableEigen ? true, eigen
|
||||
, enableOpenblas ? true, openblas
|
||||
, enableOpenblas ? true, openblas, blas, lapack
|
||||
, enableContrib ? true
|
||||
|
||||
, enableCuda ? (config.cudaSupport or false) &&
|
||||
@ -35,6 +35,8 @@
|
||||
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
|
||||
}:
|
||||
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
let
|
||||
version = "4.1.2";
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
{ stdenv
|
||||
, fetchurl
|
||||
, gfortran
|
||||
, openblas
|
||||
, blas
|
||||
, lapack
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
name = "qrupdate-1.1.2";
|
||||
@ -13,11 +14,11 @@ stdenv.mkDerivation {
|
||||
configurePhase =
|
||||
''
|
||||
export PREFIX=$out
|
||||
sed -i -e 's,^BLAS=.*,BLAS=-L${openblas}/lib -lopenblas,' \
|
||||
-e 's,^LAPACK=.*,LAPACK=-L${openblas}/lib -lopenblas,' \
|
||||
sed -i -e 's,^BLAS=.*,BLAS=-L${blas}/lib -lblas,' \
|
||||
-e 's,^LAPACK=.*,LAPACK=-L${lapack}/lib -llapack,' \
|
||||
Makeconf
|
||||
''
|
||||
+ stdenv.lib.optionalString openblas.blas64
|
||||
+ stdenv.lib.optionalString blas.is64bit
|
||||
''
|
||||
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" ];
|
||||
|
||||
buildInputs = [ gfortran openblas ];
|
||||
buildInputs = [ gfortran blas lapack ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Library for fast updating of qr and cholesky decompositions";
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ stdenv, fetchFromGitHub, cmake
|
||||
, gfortran, openblas, eigen }:
|
||||
, gfortran, blas, lapack, eigen }:
|
||||
|
||||
with stdenv.lib;
|
||||
|
||||
@ -18,15 +18,16 @@ stdenv.mkDerivation {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake ];
|
||||
buildInputs = [ gfortran openblas eigen ];
|
||||
buildInputs = [ gfortran blas lapack eigen ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
BLAS_LIBS = "-L${openblas}/lib -lopenblas";
|
||||
BLAS_LIBS = "-L${blas}/lib -lblas";
|
||||
LAPACK_LIBS = "-L${lapack}/lib -llapack";
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
"-DINTERFACE64=${optionalString openblas.blas64 "1"}"
|
||||
"-DINTERFACE64=${optionalString blas.is64bit "1"}"
|
||||
];
|
||||
|
||||
preCheck = if stdenv.isDarwin then ''
|
||||
|
@ -68,10 +68,4 @@ EOF
|
||||
homepage = "http://www.netlib.org/blas/";
|
||||
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 }:
|
||||
let
|
||||
suitesparse_ = suitesparse;
|
||||
in let
|
||||
# SuiteSparse must use the same openblas
|
||||
suitesparse = suitesparse_.override { inherit openblas; };
|
||||
in stdenv.mkDerivation rec {
|
||||
{ stdenv, fetchFromGitHub, gfortran, suitesparse, blas, lapack }:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "cholmod-extra";
|
||||
version = "1.2.0";
|
||||
|
||||
@ -15,10 +10,10 @@ in stdenv.mkDerivation rec {
|
||||
sha256 = "0hz1lfp0zaarvl0dv0zgp337hyd8np41kmdpz5rr3fc6yzw7vmkg";
|
||||
};
|
||||
|
||||
buildInputs = [ suitesparse gfortran openblas ];
|
||||
buildInputs = [ suitesparse gfortran blas lapack ];
|
||||
|
||||
buildFlags = [
|
||||
"BLAS=-lopenblas"
|
||||
makeFlags = [
|
||||
"BLAS=-lcblas"
|
||||
];
|
||||
|
||||
installFlags = [
|
||||
|
@ -24,6 +24,8 @@
|
||||
, suitesparse
|
||||
, swig
|
||||
, zlib
|
||||
, blas
|
||||
, lapack
|
||||
}:
|
||||
let
|
||||
version = "2019.1.0";
|
||||
@ -176,13 +178,14 @@ let
|
||||
hdf5
|
||||
mpi
|
||||
numpy
|
||||
(numpy.blas)
|
||||
blas
|
||||
lapack
|
||||
ply
|
||||
python
|
||||
scotch
|
||||
six
|
||||
sphinx
|
||||
(suitesparse.override { openblas = numpy.blas; })
|
||||
suitesparse
|
||||
swig
|
||||
sympy
|
||||
ufl
|
||||
|
@ -1,4 +1,6 @@
|
||||
{ stdenv, fetchurl, unzip, openblas, gfortran }:
|
||||
{ stdenv, fetchurl, unzip, blas, lapack, gfortran }:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ipopt";
|
||||
@ -12,13 +14,13 @@ stdenv.mkDerivation rec {
|
||||
CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
|
||||
|
||||
configureFlags = [
|
||||
"--with-blas-lib=-lopenblas"
|
||||
"--with-lapack-lib=-lopenblas"
|
||||
"--with-blas-lib=-lblas"
|
||||
"--with-lapack-lib=-llapack"
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ unzip ];
|
||||
|
||||
buildInputs = [ gfortran openblas ];
|
||||
buildInputs = [ gfortran blas lapack ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
gfortran,
|
||||
cmake,
|
||||
python2,
|
||||
shared ? false
|
||||
shared ? true
|
||||
}:
|
||||
let
|
||||
inherit (stdenv.lib) optional;
|
||||
@ -22,16 +22,16 @@ stdenv.mkDerivation {
|
||||
sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
|
||||
};
|
||||
|
||||
buildInputs = [ gfortran ];
|
||||
nativeBuildInputs = [ python2 cmake ];
|
||||
nativeBuildInputs = [ gfortran python2 cmake ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_Fortran_FLAGS=-fPIC"
|
||||
"-DLAPACKE=ON"
|
||||
"-DCBLAS=ON"
|
||||
]
|
||||
++ (optional shared "-DBUILD_SHARED_LIBS=ON");
|
||||
++ optional shared "-DBUILD_SHARED_LIBS=ON";
|
||||
|
||||
doCheck = ! shared;
|
||||
doCheck = 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
|
||||
}:
|
||||
|
||||
@ -18,7 +18,7 @@ in stdenv.mkDerivation {
|
||||
};
|
||||
|
||||
buildInputs = [ gfortran cudatoolkit libpthreadstubs cmake ]
|
||||
++ (if mklSupport then [ mkl ] else [ liblapack ]);
|
||||
++ (if mklSupport then [ mkl ] else [ lapack blas ]);
|
||||
|
||||
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/mkl/lib/intel64_lin/*.so* $out/lib/
|
||||
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
|
||||
# larger updated load commands do not fit. Use install_name_tool
|
||||
|
@ -176,6 +176,12 @@ Cflags: -I$out/include
|
||||
Libs: -L$out/lib -lopenblas
|
||||
EOF
|
||||
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; {
|
||||
@ -185,10 +191,4 @@ EOF
|
||||
platforms = platforms.unix;
|
||||
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 {
|
||||
pname = "petsc";
|
||||
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "0943bydmsq3sjwj3rxhb8hx58b1fm8vymny731557fs10g5zfbyz";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ blas gfortran.cc.lib liblapack python ];
|
||||
nativeBuildInputs = [ blas gfortran.cc.lib lapack python ];
|
||||
|
||||
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
substituteInPlace config/install.py \
|
||||
@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
|
||||
"--with-cxx=$CXX"
|
||||
"--with-fc=0"
|
||||
"--with-mpi=0"
|
||||
"--with-blas-lib=[${blas}/lib/libblas.a,${gfortran.cc.lib}/lib/libgfortran.a]"
|
||||
"--with-lapack-lib=[${liblapack}/lib/liblapack.a,${gfortran.cc.lib}/lib/libgfortran.a]"
|
||||
"--with-blas-lib=[${blas}/lib/libblas.so,${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
|
||||
, gfortran, mpi, openblasCompat
|
||||
, gfortran, mpi, blas, lapack
|
||||
} :
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "scalapack";
|
||||
@ -15,7 +16,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ cmake openssh ];
|
||||
buildInputs = [ mpi gfortran openblasCompat ];
|
||||
buildInputs = [ mpi gfortran blas lapack ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
@ -24,8 +25,8 @@ stdenv.mkDerivation rec {
|
||||
preConfigure = ''
|
||||
cmakeFlagsArray+=(
|
||||
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
|
||||
-DLAPACK_LIBRARIES="-lopenblas"
|
||||
-DBLAS_LIBRARIES="-lopenblas"
|
||||
-DLAPACK_LIBRARIES="-llapack"
|
||||
-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 {
|
||||
pname = "scs";
|
||||
@ -20,7 +22,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
buildInputs = [ blas liblapack gfortran.cc.lib ];
|
||||
buildInputs = [ blas lapack gfortran.cc.lib ];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ stdenv, fetchurl, gfortran, openblas }:
|
||||
{ stdenv, fetchurl, gfortran, blas, lapack }:
|
||||
|
||||
let
|
||||
int_t = if openblas.blas64 then "int64_t" else "int32_t";
|
||||
int_t = if blas.is64bit then "int64_t" else "int32_t";
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
version = "4.2.1";
|
||||
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
buildInputs = [ openblas ];
|
||||
buildInputs = [ blas lapack ];
|
||||
|
||||
preConfigure = ''
|
||||
mkdir -p $out/lib
|
||||
@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
|
||||
"PREFIX=\"$(out)\""
|
||||
"INSTALL_LIB=$(out)/lib"
|
||||
"INSTALL_INCLUDE=$(out)/include"
|
||||
"BLAS=-lopenblas"
|
||||
"LAPACK="
|
||||
"BLAS=-lblas"
|
||||
"LAPACK=-llapack"
|
||||
];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -1,12 +1,12 @@
|
||||
{ stdenv, fetchurl, gfortran, openblas
|
||||
, enableCuda ? false, cudatoolkit
|
||||
{ stdenv, fetchurl, gfortran, blas, lapack
|
||||
, enableCuda ? false, cudatoolkit
|
||||
}:
|
||||
|
||||
let
|
||||
version = "4.4.4";
|
||||
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;
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
@ -51,8 +51,8 @@ stdenv.mkDerivation {
|
||||
"PREFIX=\"$(out)\""
|
||||
"INSTALL_LIB=$(out)/lib"
|
||||
"INSTALL_INCLUDE=$(out)/include"
|
||||
"BLAS=-lopenblas"
|
||||
"LAPACK="
|
||||
"BLAS=-lblas"
|
||||
"LAPACK=-llapack"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER";
|
||||
@ -64,7 +64,7 @@ stdenv.mkDerivation {
|
||||
for i in "$out"/lib/lib*.a; do
|
||||
ar -x $i
|
||||
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
|
||||
ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT}
|
||||
@ -88,7 +88,7 @@ stdenv.mkDerivation {
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
buildInputs = [ openblas ];
|
||||
buildInputs = [ blas lapack ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ stdenv
|
||||
, fetchFromGitHub
|
||||
, gfortran
|
||||
, openblas
|
||||
, blas, lapack
|
||||
, metis
|
||||
, fixDarwinDylibNames
|
||||
, gnum4
|
||||
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
||||
] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
buildInputs = [
|
||||
openblas
|
||||
blas lapack
|
||||
metis
|
||||
gfortran.cc.lib
|
||||
] ++ stdenv.lib.optional enableCuda cudatoolkit;
|
||||
@ -41,10 +41,10 @@ stdenv.mkDerivation rec {
|
||||
"INSTALL=${placeholder "out"}"
|
||||
"INSTALL_INCLUDE=${placeholder "dev"}/include"
|
||||
"JOBS=$(NIX_BUILD_CORES)"
|
||||
"BLAS=-lopenblas"
|
||||
"BLAS=-lblas"
|
||||
"LAPACK=-llapack"
|
||||
"MY_METIS_LIB=-lmetis"
|
||||
"LAPACK="
|
||||
] ++ stdenv.lib.optionals openblas.blas64 [
|
||||
] ++ stdenv.lib.optionals blas.is64bit [
|
||||
"CFLAGS=-DBLAS64"
|
||||
] ++ stdenv.lib.optionals enableCuda [
|
||||
"CUDA_PATH=${cudatoolkit}"
|
||||
|
@ -1,5 +1,7 @@
|
||||
{ stdenv, fetchurl, cmake,
|
||||
gfortran, openblasCompat}:
|
||||
gfortran, blas, lapack}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
version = "5.2.1";
|
||||
@ -12,7 +14,7 @@ stdenv.mkDerivation rec {
|
||||
|
||||
buildInputs = [ cmake gfortran ];
|
||||
|
||||
propagatedBuildInputs = [ openblasCompat ];
|
||||
propagatedBuildInputs = [ blas ];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=true"
|
||||
@ -20,7 +22,6 @@ stdenv.mkDerivation rec {
|
||||
];
|
||||
|
||||
patches = [
|
||||
./find-openblas-library.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
|
||||
# GNU Octave needs KLU for ODE solvers
|
||||
, suitesparse
|
||||
, liblapack
|
||||
, blas, lapack
|
||||
, gfortran
|
||||
, lapackSupport ? true }:
|
||||
|
||||
let liblapackShared = liblapack.override {
|
||||
shared = true;
|
||||
};
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sundials";
|
||||
version = "2.7.0";
|
||||
|
||||
@ -44,7 +42,7 @@ in stdenv.mkDerivation rec {
|
||||
"-DKLU_INCLUDE_DIR=${suitesparse}/include"
|
||||
"-DKLU_LIBRARY_DIR=${suitesparse}/lib"
|
||||
"-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
|
||||
|
@ -2,17 +2,18 @@
|
||||
, cmake
|
||||
, fetchurl
|
||||
, python
|
||||
, openblas
|
||||
, blas
|
||||
, lapack
|
||||
, gfortran
|
||||
, lapackSupport ? true }:
|
||||
|
||||
let openblas32 = openblas.override { blas64 = false; };
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "sundials";
|
||||
version = "5.1.0";
|
||||
|
||||
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran openblas32 ];
|
||||
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran blas lapack ];
|
||||
nativeBuildInputs = [ cmake ];
|
||||
|
||||
src = fetchurl {
|
||||
@ -33,7 +34,7 @@ in stdenv.mkDerivation rec {
|
||||
] ++ stdenv.lib.optionals (lapackSupport) [
|
||||
"-DSUNDIALS_INDEX_TYPE=int32_t"
|
||||
"-DLAPACK_ENABLE=ON"
|
||||
"-DLAPACK_LIBRARIES=${openblas32}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
"-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
];
|
||||
|
||||
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 (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ocaml${ocaml.version}-lacaml";
|
||||
@ -14,7 +15,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
buildInputs = [ ocaml findlib dune base stdio ];
|
||||
propagatedBuildInputs = [ liblapack blas ] ++
|
||||
propagatedBuildInputs = [ lapack blas ] ++
|
||||
stdenv.lib.optionals stdenv.isDarwin
|
||||
[ darwin.apple_sdk.frameworks.Accelerate ];
|
||||
|
||||
|
@ -6,11 +6,14 @@
|
||||
, eigen
|
||||
, stdio
|
||||
, stdlib-shims
|
||||
, openblasCompat
|
||||
, openblas, blas, lapack
|
||||
, owl-base
|
||||
, npy
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
|
||||
|
||||
buildDunePackage rec {
|
||||
pname = "owl";
|
||||
|
||||
@ -19,7 +22,7 @@ buildDunePackage rec {
|
||||
checkInputs = [ alcotest ];
|
||||
buildInputs = [ dune-configurator ];
|
||||
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
|
||||
|
@ -4,7 +4,7 @@
|
||||
, fetchPypi
|
||||
, isPyPy
|
||||
, python
|
||||
, openblasCompat # build segfaults with regular openblas
|
||||
, blas, lapack # build segfaults with 64-bit blas
|
||||
, suitesparse
|
||||
, glpk ? null
|
||||
, gsl ? null
|
||||
@ -14,6 +14,8 @@
|
||||
, withFftw ? true
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "cvxopt";
|
||||
version = "1.2.4";
|
||||
@ -25,12 +27,13 @@ buildPythonPackage rec {
|
||||
sha256 = "1h9g79gxpgpy6xciqyypihw5q4ngp322lpkka1nkwk0ysybfsp7s";
|
||||
};
|
||||
|
||||
buildInputs = [ blas lapack ];
|
||||
|
||||
# similar to Gsl, glpk, fftw there is also a dsdp interface
|
||||
# but dsdp is not yet packaged in nixpkgs
|
||||
preConfigure = ''
|
||||
export CVXOPT_BLAS_LIB_DIR=${openblasCompat}/lib
|
||||
export CVXOPT_BLAS_LIB=openblas
|
||||
export CVXOPT_LAPACK_LIB=openblas
|
||||
export CVXOPT_BLAS_LIB=blas
|
||||
export CVXOPT_LAPACK_LIB=lapack
|
||||
export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib
|
||||
export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include
|
||||
'' + lib.optionalString withGsl ''
|
||||
|
@ -5,21 +5,23 @@
|
||||
, gfortran
|
||||
, pytest
|
||||
, blas
|
||||
, lapack
|
||||
, writeTextFile
|
||||
, isPyPy
|
||||
, cython
|
||||
, setuptoolsBuildHook
|
||||
}:
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
let
|
||||
blasImplementation = lib.nameFromURL blas.name "-";
|
||||
cfg = writeTextFile {
|
||||
name = "site.cfg";
|
||||
text = (lib.generators.toINI {} {
|
||||
${blasImplementation} = {
|
||||
include_dirs = "${blas}/include";
|
||||
library_dirs = "${blas}/lib";
|
||||
} // lib.optionalAttrs (blasImplementation == "mkl") {
|
||||
${blas.implementation} = {
|
||||
include_dirs = "${blas}/include:${lapack}/include";
|
||||
library_dirs = "${blas}/lib:${lapack}/lib";
|
||||
} // lib.optionalAttrs (blas.implementation == "mkl") {
|
||||
mkl_libs = "mkl_rt";
|
||||
lapack_libs = "";
|
||||
};
|
||||
@ -37,7 +39,7 @@ in buildPythonPackage rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
|
||||
buildInputs = [ blas ];
|
||||
buildInputs = [ blas lapack ];
|
||||
|
||||
patches = lib.optionals python.hasDistutilsCxxPatch [
|
||||
# We patch cpython/distutils to fix https://bugs.python.org/issue1222585
|
||||
@ -68,8 +70,10 @@ in buildPythonPackage rec {
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
blas = blas;
|
||||
inherit blasImplementation cfg;
|
||||
# just for backwards compatibility
|
||||
blas = blas.provider;
|
||||
blasImplementation = blas.implementation;
|
||||
inherit cfg;
|
||||
};
|
||||
|
||||
# Disable test
|
||||
|
@ -1,13 +1,11 @@
|
||||
{ lib
|
||||
, blas
|
||||
, lapack
|
||||
, buildPythonPackage
|
||||
, cffi
|
||||
, fetchFromGitHub
|
||||
, liblapack
|
||||
, nose
|
||||
, numpy
|
||||
, openblas
|
||||
, useOpenblas ? true
|
||||
}:
|
||||
|
||||
buildPythonPackage {
|
||||
@ -21,8 +19,6 @@ buildPythonPackage {
|
||||
sha256 = "0mlrjbb5rw78dgijkr3bspmsskk6jqs9y7xpsgs35i46dvb327q5";
|
||||
};
|
||||
|
||||
patches = lib.optional useOpenblas ./use-openblas.patch;
|
||||
|
||||
checkInputs = [
|
||||
nose
|
||||
];
|
||||
@ -32,12 +28,7 @@ buildPythonPackage {
|
||||
cffi
|
||||
];
|
||||
|
||||
buildInputs = (
|
||||
if useOpenblas then
|
||||
[ openblas ]
|
||||
else
|
||||
[ blas liblapack ]
|
||||
);
|
||||
buildInputs = [ blas lapack ];
|
||||
|
||||
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
|
||||
, numpy
|
||||
, setuptools
|
||||
, liblapack
|
||||
, blas
|
||||
, lapack
|
||||
, isPy27
|
||||
, python
|
||||
}:
|
||||
@ -24,8 +25,8 @@ buildPythonPackage {
|
||||
|
||||
propagatedBuildInputs = [
|
||||
numpy
|
||||
numpy.blas
|
||||
liblapack
|
||||
blas
|
||||
lapack
|
||||
];
|
||||
|
||||
# Include patches from working version of PySparse 1.3-dev in
|
||||
|
@ -2,7 +2,7 @@
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, blas
|
||||
, liblapack
|
||||
, lapack
|
||||
, numpy
|
||||
, scipy
|
||||
, scs
|
||||
@ -26,7 +26,7 @@ buildPythonPackage rec {
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
liblapack
|
||||
lapack
|
||||
blas
|
||||
];
|
||||
|
||||
|
@ -252,7 +252,7 @@ let
|
||||
data_table = [pkgs.zlib.dev] ++ lib.optional stdenv.isDarwin pkgs.llvmPackages.openmp;
|
||||
devEMF = [ pkgs.xorg.libXft.dev pkgs.x11 ];
|
||||
diversitree = [ pkgs.gsl_1 pkgs.fftw ];
|
||||
EMCluster = [ pkgs.liblapack ];
|
||||
EMCluster = [ pkgs.lapack ];
|
||||
fftw = [ pkgs.fftw.dev ];
|
||||
fftwtools = [ pkgs.fftw.dev ];
|
||||
Formula = [ pkgs.gmp ];
|
||||
@ -808,11 +808,11 @@ let
|
||||
});
|
||||
|
||||
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: {
|
||||
PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas";
|
||||
PKG_LIBS = "-L${pkgs.blas}/lib -lblas -L${pkgs.lapack}/lib -llapack";
|
||||
});
|
||||
|
||||
EMCluster = old.EMCluster.overrideDerivation (attrs: {
|
||||
|
@ -275,20 +275,15 @@ self: super:
|
||||
old:
|
||||
let
|
||||
blas = old.passthru.args.blas or pkgs.openblasCompat;
|
||||
blasImplementation = lib.nameFromURL blas.name "-";
|
||||
lapack = old.passthru.args.lapack or pkgs.openblasCompat;
|
||||
cfg = pkgs.writeTextFile {
|
||||
name = "site.cfg";
|
||||
text = (
|
||||
lib.generators.toINI {} {
|
||||
${blasImplementation} = {
|
||||
include_dirs = "${blas}/include";
|
||||
library_dirs = "${blas}/lib";
|
||||
} // lib.optionalAttrs (blasImplementation == "mkl") {
|
||||
mkl_libs = "mkl_rt";
|
||||
lapack_libs = "";
|
||||
};
|
||||
}
|
||||
);
|
||||
text = (lib.generators.toINI {} {
|
||||
${blas.implementation} = {
|
||||
include_dirs = "${blas}/include:${lapack}/include";
|
||||
library_dirs = "${blas}/lib:${lapack}/lib";
|
||||
};
|
||||
});
|
||||
};
|
||||
in
|
||||
{
|
||||
@ -299,8 +294,8 @@ self: super:
|
||||
ln -s ${cfg} site.cfg
|
||||
'';
|
||||
passthru = old.passthru // {
|
||||
blas = blas;
|
||||
inherit blasImplementation cfg;
|
||||
blsaImplementation = blas.implementation;
|
||||
inherit blas cfg;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ stdenv, lib, fetchFromGitHub, cmake, perl
|
||||
, glib, luajit, openssl, pcre, pkgconfig, sqlite, ragel, icu
|
||||
, hyperscan, jemalloc, openblas, lua, libsodium
|
||||
, hyperscan, jemalloc, blas, lapack, lua, libsodium
|
||||
, withBlas ? true
|
||||
, withHyperscan ? stdenv.isx86_64
|
||||
, withLuaJIT ? stdenv.isx86_64
|
||||
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
|
||||
nativeBuildInputs = [ cmake pkgconfig perl ];
|
||||
buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ]
|
||||
++ lib.optional withHyperscan hyperscan
|
||||
++ lib.optional withBlas openblas
|
||||
++ lib.optionals withBlas [ blas lapack ]
|
||||
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
|
||||
|
||||
cmakeFlags = [
|
||||
|
@ -1,4 +1,6 @@
|
||||
{ stdenv, fetchurl, openblasCompat, mpi } :
|
||||
{ stdenv, fetchurl, blas, lapack, mpi } :
|
||||
|
||||
assert (!blas.is64bit) && (!lapack.is64bit);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "hpl";
|
||||
@ -18,7 +20,7 @@ stdenv.mkDerivation rec {
|
||||
install -D testing/ptest/HPL.dat $out/share/hpl/HPL.dat
|
||||
'';
|
||||
|
||||
buildInputs = [ openblasCompat mpi ];
|
||||
buildInputs = [ blas lapack mpi ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Portable Implementation of the Linpack Benchmark for Distributed-Memory Computers";
|
||||
@ -28,4 +30,3 @@ stdenv.mkDerivation rec {
|
||||
maintainers = [ maintainers.markuskowa ];
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -237,7 +237,7 @@ mapAliases ({
|
||||
libGL_driver = mesa.drivers;
|
||||
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
|
||||
liblapackWithoutAtlas = liblapack; # added 2018-11-05
|
||||
liblapackWithoutAtlas = lapack-reference; # added 2018-11-05
|
||||
liblrdf = lrdf; # added 2018-04-25
|
||||
libqrencode = qrencode; # added 2019-01-01
|
||||
librdf = lrdf; # added 2020-03-22
|
||||
|
@ -104,6 +104,10 @@ in
|
||||
|
||||
### BUILD SUPPORT
|
||||
|
||||
auditBlasHook = makeSetupHook
|
||||
{ name = "auto-blas-hook"; deps = [ blas lapack ]; }
|
||||
../build-support/setup-hooks/audit-blas.sh;
|
||||
|
||||
autoreconfHook = makeSetupHook
|
||||
{ deps = [ autoconf automake gettext libtool ]; }
|
||||
../build-support/setup-hooks/autoreconf.sh;
|
||||
@ -8702,25 +8706,21 @@ in
|
||||
|
||||
julia_07 = callPackage ../development/compilers/julia/0.7.nix {
|
||||
gmp = gmp6;
|
||||
openblas = openblasCompat;
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||
};
|
||||
|
||||
julia_10 = callPackage ../development/compilers/julia/1.0.nix {
|
||||
gmp = gmp6;
|
||||
openblas = openblasCompat;
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||
};
|
||||
|
||||
julia_11 = callPackage ../development/compilers/julia/1.1.nix {
|
||||
gmp = gmp6;
|
||||
openblas = openblasCompat;
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||
};
|
||||
|
||||
julia_13 = callPackage ../development/compilers/julia/1.3.nix {
|
||||
gmp = gmp6;
|
||||
openblas = openblasCompat;
|
||||
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
|
||||
};
|
||||
|
||||
@ -9404,16 +9404,13 @@ in
|
||||
|
||||
octave = callPackage ../development/interpreters/octave {
|
||||
python = python3;
|
||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
||||
};
|
||||
octave-jit = callPackage ../development/interpreters/octave {
|
||||
python = python3;
|
||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
||||
enableJIT = true;
|
||||
};
|
||||
octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave {
|
||||
python = python3;
|
||||
openblas = if stdenv.isDarwin then openblasCompat else openblas;
|
||||
enableQt = true;
|
||||
overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
|
||||
}));
|
||||
@ -11481,20 +11478,11 @@ in
|
||||
|
||||
ffcast = callPackage ../tools/X11/ffcast { };
|
||||
|
||||
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;
|
||||
};
|
||||
fflas-ffpack = callPackage ../development/libraries/fflas-ffpack { };
|
||||
|
||||
forge = callPackage ../development/libraries/forge { };
|
||||
|
||||
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;
|
||||
};
|
||||
linbox = callPackage ../development/libraries/linbox { };
|
||||
|
||||
ffmpeg_2_8 = callPackage ../development/libraries/ffmpeg/2.8.nix {
|
||||
inherit (darwin.apple_sdk.frameworks) Cocoa;
|
||||
@ -15263,7 +15251,6 @@ in
|
||||
texLive = texlive.combine {
|
||||
inherit (texlive) scheme-small inconsolata helvetic texinfo fancyvrb cm-super;
|
||||
};
|
||||
openblas = openblasCompat;
|
||||
withRecommendedPackages = false;
|
||||
inherit (darwin.apple_sdk.frameworks) Cocoa Foundation;
|
||||
inherit (darwin) libobjc;
|
||||
@ -24202,7 +24189,7 @@ in
|
||||
|
||||
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 { };
|
||||
|
||||
@ -24430,7 +24417,9 @@ in
|
||||
|
||||
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 { };
|
||||
|
||||
@ -24450,12 +24439,15 @@ in
|
||||
|
||||
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 { };
|
||||
|
||||
libhomfly = callPackage ../development/libraries/science/math/libhomfly { };
|
||||
|
||||
liblapack = callPackage ../development/libraries/science/math/liblapack {};
|
||||
|
||||
liblbfgs = callPackage ../development/libraries/science/math/liblbfgs { };
|
||||
|
||||
lrs = callPackage ../development/libraries/science/math/lrs { };
|
||||
@ -24538,7 +24530,7 @@ in
|
||||
|
||||
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 { };
|
||||
|
||||
|
@ -4667,9 +4667,7 @@ in {
|
||||
Nuitka = callPackage ../development/python-modules/nuitka { };
|
||||
|
||||
numpy = let
|
||||
numpy_ = callPackage ../development/python-modules/numpy {
|
||||
blas = pkgs.openblasCompat;
|
||||
};
|
||||
numpy_ = callPackage ../development/python-modules/numpy { };
|
||||
numpy_2 = numpy_.overridePythonAttrs(oldAttrs: rec {
|
||||
version = "1.16.5";
|
||||
src = oldAttrs.src.override {
|
||||
@ -4952,11 +4950,7 @@ in {
|
||||
|
||||
promise = callPackage ../development/python-modules/promise { };
|
||||
|
||||
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;
|
||||
};
|
||||
prox-tv = callPackage ../development/python-modules/prox-tv { };
|
||||
|
||||
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;
|
||||
qemu = linux;
|
||||
qemu_kvm = linux;
|
||||
lapack-reference = linux;
|
||||
less = all;
|
||||
lftp = all;
|
||||
liblapack = linux;
|
||||
libtool = all;
|
||||
libtool_2 = all;
|
||||
libxml2 = all;
|
||||
|
Loading…
Reference in New Issue
Block a user