3
0
Fork 0
forked from mirrors/nixpkgs

treewide: use blas and lapack

This makes packages use lapack and blas, which can wrap different
BLAS/LAPACK implementations.

treewide: cleanup from blas/lapack changes

A few issues in the original treewide:

- can’t assume blas64 is a bool
- unused commented code
This commit is contained in:
Matthew Bauer 2020-03-31 10:47:18 -04:00
parent 43873351ff
commit 1c8aba8334
68 changed files with 272 additions and 311 deletions

View file

@ -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.

View file

@ -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;
};
}

View file

@ -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}"

View file

@ -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}";

View file

@ -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" ];

View file

@ -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"
);
'';

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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 \

View file

@ -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";

View file

@ -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.

View file

@ -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

View file

@ -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";

View file

@ -1,5 +1,5 @@
{ 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
}:
@ -41,7 +41,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
];

View file

@ -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

View file

@ -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";

View file

@ -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
'';

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;
};
}

View file

@ -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 = ''

View file

@ -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
;

View file

@ -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";

View file

@ -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
];

View file

@ -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
];

View file

@ -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.

View file

@ -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" ]

View file

@ -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"
];

View file

@ -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, mkl
, 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}"
'';
@ -50,12 +47,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";

View file

@ -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";

View file

@ -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"

View file

@ -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;
};
}

View file

@ -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;

View file

@ -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"

View file

@ -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";

View file

@ -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";

View file

@ -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";

View file

@ -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 ''

View file

@ -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 = [

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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]"
)
'';

View file

@ -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"
)
'';

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, blas, liblapack, gfortran, fixDarwinDylibNames }:
{ stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
stdenv.mkDerivation rec {
pname = "scs";
@ -20,7 +20,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;

View file

@ -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; {

View file

@ -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";

View file

@ -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}"

View file

@ -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
];

View file

@ -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)

View file

@ -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

View file

@ -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;

View file

@ -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 ];

View file

@ -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

View file

@ -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 ''

View file

@ -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

View file

@ -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;

View file

@ -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']
)

View file

@ -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

View file

@ -2,7 +2,7 @@
, buildPythonPackage
, fetchFromGitHub
, blas
, liblapack
, lapack
, numpy
, scipy
, scs
@ -26,7 +26,7 @@ buildPythonPackage rec {
'';
buildInputs = [
liblapack
lapack
blas
];

View file

@ -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: {

View file

@ -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;
};
}
);

View file

@ -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 = [

View file

@ -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 ];
};
}

View file

@ -8702,25 +8702,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 +9400,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"];
}));
@ -15252,7 +15245,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;
@ -24191,7 +24183,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 { };
@ -24532,7 +24524,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 { };

View file

@ -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 { };