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 , pythonPackages
, uhd , uhd
, log4cpp , log4cpp
, openblas , blas, lapack
, matio , matio
, pugixml , pugixml
, protobuf , protobuf
@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
# nothing to be gained by leaving it out. # nothing to be gained by leaving it out.
uhd uhd
log4cpp log4cpp
openblas blas lapack
matio matio
pugixml pugixml
protobuf protobuf
@ -63,8 +63,8 @@ stdenv.mkDerivation rec {
# armadillo is built using both, so skip checking for them. # armadillo is built using both, so skip checking for them.
"-DBLAS=YES" "-DBLAS=YES"
"-DLAPACK=YES" "-DLAPACK=YES"
"-DBLAS_LIBRARIES=-lopenblas" "-DBLAS_LIBRARIES=-lblas"
"-DLAPACK_LIBRARIES=-lopenblas" "-DLAPACK_LIBRARIES=-llapack"
# Similarly, it doesn't actually use gfortran despite checking for # Similarly, it doesn't actually use gfortran despite checking for
# its presence. # its presence.

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, zlib, openblas, darwin}: { stdenv, fetchFromGitHub, zlib, blas, lapack, darwin}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "plink-ng"; pname = "plink-ng";
@ -11,14 +11,20 @@ stdenv.mkDerivation rec {
sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq"; sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq";
}; };
buildInputs = [ zlib ] ++ (if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ openblas ]) ; buildInputs = [ zlib ] ++ (if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ blas lapack ]) ;
buildPhase = '' preBuild = ''
sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h
${if stdenv.cc.isClang then "sed -i 's|g++|clang++|g' Makefile.std" else ""} ${if stdenv.cc.isClang then "sed -i 's|g++|clang++|g' Makefile.std" else ""}
make ZLIB=-lz ${if stdenv.isDarwin then "" else "BLASFLAGS=-lopenblas"} -f Makefile.std
makeFlagsArray+=(
ZLIB=-lz
BLASFLAGS="-lblas -lcblas -llapack"
);
''; '';
makefile = "Makefile.std";
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
cp plink $out/bin cp plink $out/bin
@ -31,4 +37,3 @@ stdenv.mkDerivation rec {
platforms = stdenv.lib.platforms.linux; platforms = stdenv.lib.platforms.linux;
}; };
} }

View file

@ -1,7 +1,9 @@
{ stdenv, fetchFromGitLab, symlinkJoin, gfortran, perl, procps { stdenv, fetchFromGitLab, symlinkJoin, gfortran, perl, procps
, libyaml, libxc, fftw, openblas, gsl, netcdf, arpack, autoreconfHook , libyaml, libxc, fftw, blas, lapack, gsl, netcdf, arpack, autoreconfHook
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "octopus"; pname = "octopus";
version = "9.2"; version = "9.2";
@ -14,12 +16,12 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ perl procps autoreconfHook ]; nativeBuildInputs = [ perl procps autoreconfHook ];
buildInputs = [ libyaml gfortran libxc openblas gsl fftw netcdf arpack ]; buildInputs = [ libyaml gfortran libxc blas lapack gsl fftw netcdf arpack ];
configureFlags = [ configureFlags = [
"--with-yaml-prefix=${libyaml}" "--with-yaml-prefix=${libyaml}"
"--with-blas=-lopenblas" "--with-blas=-lblas"
"--with-lapack=-lopenblas" "--with-lapack=-llapack"
"--with-fftw-prefix=${fftw.dev}" "--with-fftw-prefix=${fftw.dev}"
"--with-gsl-prefix=${gsl}" "--with-gsl-prefix=${gsl}"
"--with-libxc-prefix=${libxc}" "--with-libxc-prefix=${libxc}"

View file

@ -1,9 +1,11 @@
{ stdenv, fetchFromGitLab, cmake, gfortran, perl { stdenv, fetchFromGitLab, cmake, gfortran, perl
, openblas, hdf5-cpp, python3, texlive , openblas, blas, lapack, hdf5-cpp, python3, texlive
, armadillo, openmpi, globalarrays, openssh , armadillo, openmpi, globalarrays, openssh
, makeWrapper, fetchpatch , makeWrapper, fetchpatch
} : } :
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
let let
version = "19.11"; version = "19.11";
gitLabRev = "v${version}"; gitLabRev = "v${version}";

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl { stdenv, fetchurl
, gfortran, fftw, openblas , gfortran, fftw, blas, lapack
, mpi ? null , mpi ? null
}: }:
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
patchShebangs configure patchShebangs configure
''; '';
buildInputs = [ fftw openblas gfortran ] buildInputs = [ fftw blas lapack gfortran ]
++ (stdenv.lib.optionals (mpi != null) [ mpi ]); ++ (stdenv.lib.optionals (mpi != null) [ mpi ]);
configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ]; configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];

View file

@ -1,5 +1,5 @@
{ stdenv, fetchurl { stdenv, fetchurl
, gfortran, openblas , gfortran, blas, lapack
, mpi ? null, scalapack , mpi ? null, scalapack
}: }:
@ -16,7 +16,7 @@ stdenv.mkDerivation {
inherit mpi; inherit mpi;
}; };
buildInputs = [ openblas gfortran ] buildInputs = [ blas lapack gfortran ]
++ (stdenv.lib.optionals (mpi != null) [ mpi scalapack ]); ++ (stdenv.lib.optionals (mpi != null) [ mpi scalapack ]);
enableParallelBuilding = true; enableParallelBuilding = true;
@ -33,11 +33,11 @@ stdenv.mkDerivation {
makeFlagsArray=( makeFlagsArray=(
CC="mpicc" FC="mpifort" CC="mpicc" FC="mpifort"
FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="." FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
COMP_LIBS="" LIBS="-lopenblas -lscalapack" COMP_LIBS="" LIBS="-lblas -llapack -lscalapack"
); );
'' else '' '' else ''
makeFlagsArray=( makeFlagsArray=(
COMP_LIBS="" LIBS="-lopenblas" COMP_LIBS="" LIBS="-lblas -llapack"
); );
''; '';

View file

@ -2,7 +2,7 @@
# data, compression # data, compression
, bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy , bzip2, curl, hdf5, json_c, lzma, lzo, protobuf, snappy
# maths # maths
, openblasCompat, eigen, nlopt, lp_solve, colpack, liblapack, glpk , blas, lapack, eigen, nlopt, lp_solve, colpack, glpk
# libraries # libraries
, libarchive, libxml2 , libarchive, libxml2
# extra support # extra support
@ -13,6 +13,8 @@
assert pythonSupport -> pythonPackages != null; assert pythonSupport -> pythonPackages != null;
assert opencvSupport -> opencv != null; assert opencvSupport -> opencv != null;
assert (!blas.is64bit) && (!lapack.is64bit);
let let
pname = "shogun"; pname = "shogun";
version = "6.1.4"; version = "6.1.4";
@ -64,8 +66,8 @@ stdenv.mkDerivation rec {
CCACHE_DIR=".ccache"; CCACHE_DIR=".ccache";
buildInputs = with lib; [ buildInputs = with lib; [
openblasCompat bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo blas lapack bzip2 cmake colpack curl ctags eigen hdf5 json_c lp_solve lzma lzo
protobuf nlopt snappy swig (libarchive.dev) libxml2 liblapack glpk protobuf nlopt snappy swig (libarchive.dev) libxml2 lapack glpk
] ]
++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ]) ++ optionals (pythonSupport) (with pythonPackages; [ python ply numpy ])
++ optional (opencvSupport) opencv; ++ optional (opencvSupport) opencv;

View file

@ -1,6 +1,6 @@
{ stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng { stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
, libtiff, ncurses, pango, pcre, perl, readline, tcl, texLive, tk, xz, zlib , libtiff, ncurses, pango, pcre, perl, readline, tcl, texLive, tk, xz, zlib
, less, texinfo, graphviz, icu, pkgconfig, bison, imake, which, jdk, openblas , less, texinfo, graphviz, icu, pkgconfig, bison, imake, which, jdk, blas, lapack
, curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch , curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch
, withRecommendedPackages ? true , withRecommendedPackages ? true
, enableStrictBarrier ? false , enableStrictBarrier ? false
@ -9,6 +9,8 @@
, static ? false , static ? false
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "R-3.6.3"; name = "R-3.6.3";
@ -22,7 +24,7 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
pango pcre perl readline texLive xz zlib less texinfo graphviz icu pango pcre perl readline texLive xz zlib less texinfo graphviz icu
pkgconfig bison imake which openblas curl tcl tk jdk pkgconfig bison imake which blas lapack curl tcl tk jdk
] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ]; ] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ];
patches = [ patches = [
@ -43,8 +45,8 @@ stdenv.mkDerivation rec {
configureFlagsArray=( configureFlagsArray=(
--disable-lto --disable-lto
--with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages --with${stdenv.lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
--with-blas="-L${openblas}/lib -lopenblas" --with-blas="-L${blas}/lib -lblas"
--with-lapack="-L${openblas}/lib -lopenblas" --with-lapack="-L${lapack}/lib -llapack"
--with-readline --with-readline
--with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh" --with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh"
--with-cairo --with-cairo

View file

@ -9,7 +9,7 @@
, opencv3 , opencv3
, protobuf , protobuf
, doxygen , doxygen
, openblas , blas
, Accelerate, CoreGraphics, CoreVideo , Accelerate, CoreGraphics, CoreVideo
, lmdbSupport ? true, lmdb , lmdbSupport ? true, lmdb
, leveldbSupport ? true, leveldb, snappy , leveldbSupport ? true, leveldb, snappy
@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"] ++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
++ ["-DUSE_LMDB=${toggle lmdbSupport}"]; ++ ["-DUSE_LMDB=${toggle lmdbSupport}"];
buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv3 openblas ] buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv3 blas ]
++ lib.optional cudaSupport cudatoolkit ++ lib.optional cudaSupport cudatoolkit
++ lib.optional cudnnSupport cudnn ++ lib.optional cudnnSupport cudnn
++ lib.optional lmdbSupport lmdb ++ lib.optional lmdbSupport lmdb

View file

@ -15,7 +15,7 @@ index 9cab2fc..6e977b8 100755
OCCXMAIN = $(SCCXMAIN:.c=.o) OCCXMAIN = $(SCCXMAIN:.c=.o)
-DIR=../../../SPOOLES.2.2 -DIR=../../../SPOOLES.2.2
+LIBS = -lpthread -lm -lc -lspooles -larpack -lopenblas +LIBS = -lpthread -lm -lc -lspooles -larpack -lblas -llapack
-LIBS = \ -LIBS = \
- $(DIR)/spooles.a \ - $(DIR)/spooles.a \

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gfortran, arpack, spooles, openblas }: { stdenv, fetchurl, gfortran, arpack, spooles, blas, lapack }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "calculix"; pname = "calculix";
@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ gfortran ]; nativeBuildInputs = [ gfortran ];
buildInputs = [ arpack spooles openblas ]; buildInputs = [ arpack spooles blas lapack ];
NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles"; NIX_CFLAGS_COMPILE = "-I${spooles}/include/spooles";

View file

@ -1,11 +1,12 @@
{ lib, stdenv, fetchgit, fetchFromGitHub, cmake { lib, stdenv, fetchgit, fetchFromGitHub, cmake
, openblas, opencv3, libzip, boost, protobuf, openmpi , openblas, blas, lapack, opencv3, libzip, boost, protobuf, openmpi
, onebitSGDSupport ? false , onebitSGDSupport ? false
, cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11 , cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
, cudnnSupport ? cudaSupport, cudnn , cudnnSupport ? cudaSupport, cudnn
}: }:
assert cudnnSupport -> cudaSupport; assert cudnnSupport -> cudaSupport;
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
let let
# Old specific version required for CNTK. # Old specific version required for CNTK.

View file

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, blas, gfortran, liblapack }: { lib, stdenv, fetchurl, blas, gfortran, lapack }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "csdp-6.1.1"; name = "csdp-6.1.1";
@ -8,7 +8,7 @@ stdenv.mkDerivation {
sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05"; sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05";
}; };
buildInputs = [ blas gfortran.cc.lib liblapack ]; buildInputs = [ blas gfortran.cc.lib lapack ];
postPatch = '' postPatch = ''
substituteInPlace Makefile --replace /usr/local/bin $out/bin substituteInPlace Makefile --replace /usr/local/bin $out/bin

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 { stdenv.mkDerivation rec {
name = "getdp-${version}"; name = "getdp-${version}";
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ cmake gfortran ]; nativeBuildInputs = [ cmake gfortran ];
buildInputs = [ openblas openmpi petsc python3 ]; buildInputs = [ blas lapack openmpi petsc python3 ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A General Environment for the Treatment of Discrete Problems"; description = "A General Environment for the Treatment of Discrete Problems";

View file

@ -1,5 +1,5 @@
{ stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, liblapack { stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, lapack, blas
, gmp, mpfr, pari, ntl, gsl, blas, mpfi, ecm, glpk, nauty , gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
, readline, gettext, libpng, libao, gfortran, perl , readline, gettext, libpng, libao, gfortran, perl
, enableGUI ? false, libGL ? null, libGLU ? null, xorg ? null, fltk ? null , enableGUI ? false, libGL ? null, libGLU ? null, xorg ? null, fltk ? null
}: }:
@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
# gfortran.cc default output contains static libraries compiled without -fPIC # gfortran.cc default output contains static libraries compiled without -fPIC
# we want libgfortran.so.3 instead # we want libgfortran.so.3 instead
(stdenv.lib.getLib gfortran.cc) (stdenv.lib.getLib gfortran.cc)
liblapack lapack blas
] ++ stdenv.lib.optionals enableGUI [ ] ++ stdenv.lib.optionals enableGUI [
libGL libGLU fltk xorg.libX11 libGL libGLU fltk xorg.libX11
]; ];

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 }: , zlib, libGL, libGLU, xorg, opencascade-occt }:
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "gmsh"; pname = "gmsh";
version = "4.5.6"; version = "4.5.6";
@ -10,7 +12,7 @@ stdenv.mkDerivation rec {
sha256 = "0gs65bgr1ph5lz7r6manqj8cra30s7c94pxilkd2z0p5vq6fpsj6"; sha256 = "0gs65bgr1ph5lz7r6manqj8cra30s7c94pxilkd2z0p5vq6fpsj6";
}; };
buildInputs = [ openblasCompat gmm fltk libjpeg zlib libGLU libGL buildInputs = [ blas lapack gmm fltk libjpeg zlib libGLU libGL
libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes xorg.libXext libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes xorg.libXext
xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE
opencascade-occt opencascade-occt

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, gfortran, openblas}: {stdenv, fetchurl, gfortran, blas, lapack}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "JAGS-4.3.0"; name = "JAGS-4.3.0";
@ -6,8 +6,8 @@ stdenv.mkDerivation rec {
url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz"; url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
sha256 = "1z3icccg2ic56vmhyrpinlsvpq7kcaflk1731rgpvz9bk1bxvica"; sha256 = "1z3icccg2ic56vmhyrpinlsvpq7kcaflk1731rgpvz9bk1bxvica";
}; };
buildInputs = [gfortran openblas]; buildInputs = [gfortran blas lapack];
configureFlags = [ "--with-blas=-lopenblas" "--with-lapack=-lopenblas" ]; configureFlags = [ "--with-blas=-lblas" "--with-lapack=-llapack" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Just Another Gibbs Sampler"; description = "Just Another Gibbs Sampler";

View file

@ -1,5 +1,5 @@
{ config, stdenv, lib, fetchurl, bash, cmake { config, stdenv, lib, fetchurl, bash, cmake
, opencv3, gtest, openblas, liblapack, perl , opencv3, gtest, blas, perl
, cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11 , cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11
, cudnnSupport ? cudaSupport, cudnn , cudnnSupport ? cudaSupport, cudnn
}: }:
@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake perl ]; nativeBuildInputs = [ cmake perl ];
buildInputs = [ opencv3 gtest openblas liblapack ] buildInputs = [ opencv3 gtest blas ]
++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ] ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
++ lib.optional cudnnSupport cudnn; ++ lib.optional cudnnSupport cudnn;

View file

@ -41,7 +41,8 @@
, lcalc , lcalc
, rubiks , rubiks
, flintqs , flintqs
, openblasCompat , blas
, lapack
, flint , flint
, gmp , gmp
, mpfr , mpfr
@ -53,6 +54,8 @@
, less , less
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
# This generates a `sage-env` shell file that will be sourced by sage on startup. # This generates a `sage-env` shell file that will be sourced by sage on startup.
# It sets up various environment variables, telling sage where to find its # It sets up various environment variables, telling sage where to find its
# dependencies. # dependencies.
@ -114,7 +117,7 @@ writeTextFile rec {
# testsuite instead, but since all the packages are also runtime # testsuite instead, but since all the packages are also runtime
# dependencies it doesn't really hurt to include them here. # dependencies it doesn't really hurt to include them here.
singular singular
openblasCompat blas lapack
fflas-ffpack givaro fflas-ffpack givaro
gd gd
libpng zlib libpng zlib

View file

@ -2,7 +2,8 @@
, lib , lib
, makeWrapper , makeWrapper
, sage-env , sage-env
, openblasCompat , blas
, lapack
, pkg-config , pkg-config
, three , three
, singular , singular
@ -21,6 +22,9 @@
, pythonEnv , pythonEnv
}: }:
# lots of segfaults with (64 bit) blas
assert (!blas.is64bit) && (!lapack.is64bit);
# Wrapper that combined `sagelib` with `sage-env` to produce an actually # Wrapper that combined `sagelib` with `sage-env` to produce an actually
# executable sage. No tests are run yet and no documentation is built. # executable sage. No tests are run yet and no documentation is built.
@ -29,7 +33,7 @@ let
pythonEnv # for patchShebangs pythonEnv # for patchShebangs
makeWrapper makeWrapper
pkg-config pkg-config
openblasCompat # lots of segfaults with regular (64 bit) openblas blas lapack
singular singular
three three
pynac pynac

View file

@ -3,7 +3,8 @@
, perl , perl
, buildPythonPackage , buildPythonPackage
, arb , arb
, openblasCompat , blas
, lapack
, brial , brial
, cliquer , cliquer
, cypari2 , cypari2
@ -52,6 +53,8 @@
, pplpy , pplpy
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
# This is the core sage python package. Everything else is just wrappers gluing # This is the core sage python package. Everything else is just wrappers gluing
# stuff together. It is not very useful on its own though, since it will not # stuff together. It is not very useful on its own though, since it will not
# find many of its dependencies without `sage-env`, will not be tested without # find many of its dependencies without `sage-env`, will not be tested without
@ -103,7 +106,8 @@ buildPythonPackage rec {
m4rie m4rie
mpfi mpfi
ntl ntl
openblasCompat blas
lapack
pari pari
planarity planarity
ppl ppl

View file

@ -1,5 +1,5 @@
{stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake, {stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
hwloc, jre, liblapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which, hwloc, jre, lapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which,
lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison, lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison,
doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }: doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
@ -15,7 +15,7 @@ stdenv.mkDerivation {
src = fetchgit (import ./src-main.nix); src = fetchgit (import ./src-main.nix);
buildInputs = [autoconf cmake automake libtool gfortran clang gnumake buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
hwloc jre liblapack blas hdf5 expat ncurses readline qt4 webkitgtk which hwloc jre lapack blas hdf5 expat ncurses readline qt4 webkitgtk which
lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison
doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu
git gtk2 makeWrapper]; git gtk2 makeWrapper];
@ -40,7 +40,7 @@ stdenv.mkDerivation {
for e in $(cd $out/bin && ls); do for e in $(cd $out/bin && ls); do
wrapProgram $out/bin/$e \ wrapProgram $out/bin/$e \
--prefix PATH : "${gnumake}/bin" \ --prefix PATH : "${gnumake}/bin" \
--prefix LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ liblapack blas ]}" --prefix LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ lapack blas ]}"
done done
''; '';
@ -53,5 +53,3 @@ stdenv.mkDerivation {
broken = true; broken = true;
}; };
} }

View file

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub { stdenv, fetchFromGitHub
, libpng, gzip, fftw, openblas , libpng, gzip, fftw, blas, lapack
, mpi ? null , mpi ? null
}: }:
let packages = [ let packages = [
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
inherit packages; inherit packages;
}; };
buildInputs = [ fftw libpng openblas gzip ] buildInputs = [ fftw libpng blas lapack gzip ]
++ (stdenv.lib.optionals withMPI [ mpi ]); ++ (stdenv.lib.optionals withMPI [ mpi ]);
configurePhase = '' configurePhase = ''

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 { stdenv.mkDerivation rec {
pname = "xfitter"; pname = "xfitter";
@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ gfortran which ]; nativeBuildInputs = [ gfortran which ];
buildInputs = buildInputs =
[ apfel apfelgrid applgrid blas lhapdf liblapack mela root5 qcdnum ] [ apfel apfelgrid applgrid blas lhapdf lapack mela root5 qcdnum ]
# pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin # pdf2yaml requires fmemopen and open_memstream which are not readily available on Darwin
++ stdenv.lib.optional (!stdenv.isDarwin) libyaml ++ stdenv.lib.optional (!stdenv.isDarwin) libyaml
; ;

View file

@ -1,7 +1,10 @@
{ llvmPackages, lib, fetchFromGitHub, cmake { llvmPackages, lib, fetchFromGitHub, cmake
, libpng, libjpeg, mesa, eigen, openblas , libpng, libjpeg, mesa, eigen
, openblas, blas, lapack
}: }:
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
let let
version = "2019_08_27"; version = "2019_08_27";

View file

@ -7,20 +7,14 @@
# standard library dependencies # standard library dependencies
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2 , curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
# linear algebra # linear algebra
, openblas, arpack , blas, lapack, arpack
# Darwin frameworks # Darwin frameworks
, CoreServices, ApplicationServices , CoreServices, ApplicationServices
}: }:
with stdenv.lib; assert (!blas.is64bit) && (!lapack.is64bit);
# All dependencies must use the same OpenBLAS. with stdenv.lib;
let
arpack_ = arpack;
in
let
arpack = arpack_.override { inherit openblas; };
in
let let
majorVersion = "1"; majorVersion = "1";
@ -67,7 +61,7 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
pcre2.dev openblas openlibm openspecfun readline utf8proc pcre2.dev blas lapack openlibm openspecfun readline utf8proc
zlib zlib
] ]
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
@ -94,13 +88,9 @@ stdenv.mkDerivation rec {
"SHELL=${stdenv.shell}" "SHELL=${stdenv.shell}"
"USE_SYSTEM_BLAS=1" "USE_SYSTEM_BLAS=1"
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}" "USE_BLAS64=${if blas.is64bit then "1" else "0"}"
"LIBBLAS=-lopenblas"
"LIBBLASNAME=libopenblas"
"USE_SYSTEM_LAPACK=1" "USE_SYSTEM_LAPACK=1"
"LIBLAPACK=-lopenblas"
"LIBLAPACKNAME=libopenblas"
"USE_SYSTEM_ARPACK=1" "USE_SYSTEM_ARPACK=1"
"USE_SYSTEM_FFTW=1" "USE_SYSTEM_FFTW=1"
@ -123,7 +113,7 @@ stdenv.mkDerivation rec {
]; ];
LD_LIBRARY_PATH = makeLibraryPath [ LD_LIBRARY_PATH = makeLibraryPath [
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm arpack fftw fftwSinglePrec gmp libgit2 mpfr blas openlibm
openspecfun pcre2 openspecfun pcre2
]; ];

View file

@ -15,20 +15,14 @@
# standard library dependencies # standard library dependencies
, curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2 , curl, fftwSinglePrec, fftw, gmp, libgit2, mpfr, openlibm, openspecfun, pcre2
# linear algebra # linear algebra
, openblas, arpack , blas, lapack, arpack
# Darwin frameworks # Darwin frameworks
, CoreServices, ApplicationServices , CoreServices, ApplicationServices
}: }:
with stdenv.lib; with stdenv.lib;
# All dependencies must use the same OpenBLAS. assert (!blas.is64bit) && (!lapack.is64bit);
let
arpack_ = arpack;
in
let
arpack = arpack_.override { inherit openblas; };
in
let let
dsfmtVersion = "2.2.3"; dsfmtVersion = "2.2.3";
@ -118,7 +112,7 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr arpack fftw fftwSinglePrec gmp libgit2 libunwind mpfr
pcre2.dev openblas openlibm openspecfun readline utf8proc pcre2.dev blas lapack openlibm openspecfun readline utf8proc
zlib zlib
] ]
++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices] ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
@ -143,13 +137,9 @@ stdenv.mkDerivation rec {
"SHELL=${stdenv.shell}" "SHELL=${stdenv.shell}"
"USE_SYSTEM_BLAS=1" "USE_SYSTEM_BLAS=1"
"USE_BLAS64=${if openblas.blas64 then "1" else "0"}" "USE_BLAS64=${if blas.is64bit then "1" else "0"}"
"LIBBLAS=-lopenblas"
"LIBBLASNAME=libopenblas"
"USE_SYSTEM_LAPACK=1" "USE_SYSTEM_LAPACK=1"
"LIBLAPACK=-lopenblas"
"LIBLAPACKNAME=libopenblas"
"USE_SYSTEM_ARPACK=1" "USE_SYSTEM_ARPACK=1"
"USE_SYSTEM_FFTW=1" "USE_SYSTEM_FFTW=1"
@ -173,7 +163,7 @@ stdenv.mkDerivation rec {
]; ];
LD_LIBRARY_PATH = makeLibraryPath [ LD_LIBRARY_PATH = makeLibraryPath [
arpack fftw fftwSinglePrec gmp libgit2 mpfr openblas openlibm arpack fftw fftwSinglePrec gmp libgit2 mpfr blas lapack openlibm
openspecfun pcre2 openspecfun pcre2
]; ];

View file

@ -114,13 +114,8 @@ self: super: {
# Depends on broken "hails" package. # Depends on broken "hails" package.
hails-bin = dontDistribute super.hails-bin; hails-bin = dontDistribute super.hails-bin;
# Switch levmar build to openblas.
bindings-levmar = overrideCabal super.bindings-levmar (drv: { bindings-levmar = overrideCabal super.bindings-levmar (drv: {
preConfigure = '' extraLibraries = [ pkgs.blas ];
sed -i bindings-levmar.cabal \
-e 's,extra-libraries: lapack blas,extra-libraries: openblas,'
'';
extraLibraries = [ pkgs.openblasCompat ];
}); });
# The Haddock phase fails for one reason or another. # The Haddock phase fails for one reason or another.

View file

@ -21,7 +21,7 @@
, zlib , zlib
, curl , curl
, qrupdate , qrupdate
, openblas , blas, lapack
, arpack , arpack
, libwebp , libwebp
, gl2ps , gl2ps
@ -53,17 +53,7 @@
, darwin , darwin
}: }:
let assert (!blas.is64bit) && (!lapack.is64bit);
suitesparseOrig = suitesparse;
qrupdateOrig = qrupdate;
in
# integer width is determined by openblas, so all dependencies must be built
# with exactly the same openblas
let
suitesparse =
if suitesparseOrig != null then suitesparseOrig.override { inherit openblas; } else null;
qrupdate = if qrupdateOrig != null then qrupdateOrig.override { inherit openblas; } else null;
in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "5.2.0"; version = "5.2.0";
@ -85,7 +75,8 @@ stdenv.mkDerivation rec {
fltk fltk
zlib zlib
curl curl
openblas blas
lapack
libsndfile libsndfile
fftw fftw
fftwSinglePrec fftwSinglePrec
@ -134,15 +125,15 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
# See https://savannah.gnu.org/bugs/?50339 # See https://savannah.gnu.org/bugs/?50339
F77_INTEGER_8_FLAG = if openblas.blas64 then "-fdefault-integer-8" else ""; F77_INTEGER_8_FLAG = if blas.is64bit then "-fdefault-integer-8" else "";
configureFlags = [ configureFlags = [
"--with-blas=openblas" "--with-blas=blas"
"--with-lapack=openblas" "--with-lapack=lapack"
(if blas.is64bit then "--enable-64" else "--disable-64")
] ]
++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ]) ++ (if stdenv.isDarwin then [ "--enable-link-all-dependencies" ] else [ ])
++ stdenv.lib.optionals enableReadline [ "--enable-readline" ] ++ stdenv.lib.optionals enableReadline [ "--enable-readline" ]
++ stdenv.lib.optionals openblas.blas64 [ "--enable-64" ]
++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "--with-x=no" ]
++ stdenv.lib.optionals enableQt [ "--with-qt=5" ] ++ stdenv.lib.optionals enableQt [ "--with-qt=5" ]
++ stdenv.lib.optionals enableJIT [ "--enable-jit" ] ++ stdenv.lib.optionals enableJIT [ "--enable-jit" ]

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, cmake, openblasCompat, superlu, hdf5 }: { stdenv, fetchurl, cmake, blas, lapack, superlu, hdf5 }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "armadillo"; pname = "armadillo";
@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ openblasCompat superlu hdf5 ]; buildInputs = [ blas lapack superlu hdf5 ];
cmakeFlags = [ cmakeFlags = [
"-DLAPACK_LIBRARY=${openblasCompat}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}" "-DLAPACK_LIBRARY=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
"-DDETECT_HDF5=ON" "-DDETECT_HDF5=ON"
]; ];

View file

@ -1,14 +1,12 @@
{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig { stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
, cudatoolkit, opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl , opencl-clhpp, ocl-icd, fftw, fftwFloat, mkl
, blas, openblas, boost, mesa, libGLU, libGL , blas, lapack, boost, mesa, libGLU, libGL
, freeimage, python, clfft, clblas , freeimage, python, clfft, clblas
, doxygen, buildDocs ? false , doxygen, buildDocs ? false
, cudaSupport ? false, cudatoolkit
}: }:
let stdenv.mkDerivation rec {
strOnLinux = stdenv.lib.optionalString stdenv.isLinux;
in stdenv.mkDerivation rec {
pname = "arrayfire"; pname = "arrayfire";
version = "3.6.4"; version = "3.6.4";
@ -21,8 +19,7 @@ in stdenv.mkDerivation rec {
"-DAF_BUILD_OPENCL=OFF" "-DAF_BUILD_OPENCL=OFF"
"-DAF_BUILD_EXAMPLES=OFF" "-DAF_BUILD_EXAMPLES=OFF"
"-DBUILD_TESTING=OFF" "-DBUILD_TESTING=OFF"
(strOnLinux "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs") ] ++ stdenv.lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs";
];
patches = [ ./no-download.patch ]; patches = [ ./no-download.patch ];
@ -35,7 +32,7 @@ in stdenv.mkDerivation rec {
cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
''; '';
preBuild = strOnLinux '' preBuild = stdenv.lib.optionalString cudaSupport ''
export CUDA_PATH="${cudatoolkit}" export CUDA_PATH="${cudatoolkit}"
''; '';
@ -50,12 +47,13 @@ in stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
opencl-clhpp fftw fftwFloat opencl-clhpp fftw fftwFloat
mkl mkl
openblas blas lapack
libGLU libGL libGLU libGL
mesa freeimage mesa freeimage
boost.out boost.dev boost.out boost.dev
] ++ (stdenv.lib.optional stdenv.isLinux [ cudatoolkit ocl-icd ]) ] ++ (stdenv.lib.optional stdenv.isLinux ocl-icd)
++ (stdenv.lib.optional buildDocs [ doxygen ]); ++ (stdenv.lib.optional cudaSupport cudatoolkit)
++ (stdenv.lib.optional buildDocs doxygen);
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "A general-purpose library for parallel and massively-parallel computations"; description = "A general-purpose library for parallel and massively-parallel computations";

View file

@ -5,11 +5,11 @@
, mpir , mpir
, mpfr , mpfr
, ntl , ntl
, openblas ? null , openblas ? null, blas, lapack
, withBlas ? true , withBlas ? true
}: }:
assert withBlas -> openblas != null; assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "flint"; pname = "flint";

View file

@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
nativeBuildInputs = [ autoreconfHook ]; nativeBuildInputs = [ autoreconfHook ];
buildInputs = [autoconf automake libtool gmpxx]; buildInputs = [autoconf automake libtool];
propagatedBuildInputs = [ gmpxx ];
configureFlags = [ configureFlags = [
"--disable-optimization" "--disable-optimization"

View file

@ -1,5 +1,5 @@
{ stdenv, fetchpatch, fetchFromGitHub, autoreconfHook { stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
, openblas, gfortran, openssh, openmpi , blas, gfortran, openssh, openmpi
} : } :
let let
@ -17,7 +17,7 @@ in stdenv.mkDerivation {
}; };
nativeBuildInputs = [ autoreconfHook ]; nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ openmpi openblas gfortran openssh ]; buildInputs = [ openmpi blas gfortran openssh ];
preConfigure = '' preConfigure = ''
configureFlagsArray+=( "--enable-i8" \ configureFlagsArray+=( "--enable-i8" \
@ -25,7 +25,7 @@ in stdenv.mkDerivation {
"--with-mpi3" \ "--with-mpi3" \
"--enable-eispack" \ "--enable-eispack" \
"--enable-underscoring" \ "--enable-underscoring" \
"--with-blas8=${openblas}/lib -lopenblas" ) "--with-blas8=${blas}/lib -lblas" )
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
@ -38,5 +38,3 @@ in stdenv.mkDerivation {
platforms = platforms.linux; platforms = platforms.linux;
}; };
} }

View file

@ -1,4 +1,4 @@
{stdenv, autoreconfHook, fetchurl, gmp, openblas}: {stdenv, autoreconfHook, fetchurl, gmp, blas}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "iml"; pname = "iml";
version = "1.0.5"; version = "1.0.5";
@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [ buildInputs = [
gmp gmp
openblas blas
]; ];
nativeBuildInputs = [ nativeBuildInputs = [
autoreconfHook autoreconfHook
@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
configureFlags = [ configureFlags = [
"--with-gmp-include=${gmp.dev}/include" "--with-gmp-include=${gmp.dev}/include"
"--with-gmp-lib=${gmp}/lib" "--with-gmp-lib=${gmp}/lib"
"--with-cblas=-lopenblas" "--with-cblas=-lblas"
]; ];
meta = { meta = {
inherit version; inherit version;

View file

@ -2,7 +2,7 @@
, lib , lib
, fetchFromGitHub , fetchFromGitHub
, cmake , cmake
, openblas , blas
# Check Inputs # Check Inputs
, python2 , python2
}: }:
@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ openblas ]; buildInputs = [ blas ];
cmakeFlags = [ cmakeFlags = [
"-DENABLE_TEST=1" "-DENABLE_TEST=1"
"-DQUICK_TEST=1" "-DQUICK_TEST=1"

View file

@ -11,7 +11,7 @@
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase , enableEXR ? !stdenv.isDarwin, openexr, ilmbase
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE) , enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
, enableEigen ? true, eigen , enableEigen ? true, eigen
, enableOpenblas ? true, openblas , enableOpenblas ? true, openblas, blas, lapack
, enableContrib ? true , enableContrib ? true
, enableCuda ? (config.cudaSupport or false) && , enableCuda ? (config.cudaSupport or false) &&
@ -35,6 +35,8 @@
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2 , AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
}: }:
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
let let
version = "3.4.8"; version = "3.4.8";

View file

@ -11,7 +11,7 @@
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase , enableEXR ? !stdenv.isDarwin, openexr, ilmbase
, enableJPEG2K ? false, jasper # disable jasper by default (many CVE) , enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
, enableEigen ? true, eigen , enableEigen ? true, eigen
, enableOpenblas ? true, openblas , enableOpenblas ? true, openblas, blas, lapack
, enableContrib ? true , enableContrib ? true
, enableCuda ? (config.cudaSupport or false) && , enableCuda ? (config.cudaSupport or false) &&
@ -35,6 +35,8 @@
, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2 , AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
}: }:
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
let let
version = "4.1.2"; version = "4.1.2";

View file

@ -1,7 +1,8 @@
{ stdenv { stdenv
, fetchurl , fetchurl
, gfortran , gfortran
, openblas , blas
, lapack
}: }:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "qrupdate-1.1.2"; name = "qrupdate-1.1.2";
@ -13,11 +14,11 @@ stdenv.mkDerivation {
configurePhase = configurePhase =
'' ''
export PREFIX=$out export PREFIX=$out
sed -i -e 's,^BLAS=.*,BLAS=-L${openblas}/lib -lopenblas,' \ sed -i -e 's,^BLAS=.*,BLAS=-L${blas}/lib -lblas,' \
-e 's,^LAPACK=.*,LAPACK=-L${openblas}/lib -lopenblas,' \ -e 's,^LAPACK=.*,LAPACK=-L${lapack}/lib -llapack,' \
Makeconf Makeconf
'' ''
+ stdenv.lib.optionalString openblas.blas64 + stdenv.lib.optionalString blas.is64bit
'' ''
sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/' sed -i Makeconf -e '/^FFLAGS=.*/ s/$/-fdefault-integer-8/'
''; '';
@ -30,7 +31,7 @@ stdenv.mkDerivation {
installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ]; installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
buildInputs = [ gfortran openblas ]; buildInputs = [ gfortran blas lapack ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Library for fast updating of qr and cholesky decompositions"; description = "Library for fast updating of qr and cholesky decompositions";

View file

@ -1,5 +1,5 @@
{ stdenv, fetchFromGitHub, cmake { stdenv, fetchFromGitHub, cmake
, gfortran, openblas, eigen }: , gfortran, blas, lapack, eigen }:
with stdenv.lib; with stdenv.lib;
@ -18,15 +18,16 @@ stdenv.mkDerivation {
}; };
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
buildInputs = [ gfortran openblas eigen ]; buildInputs = [ gfortran blas lapack eigen ];
doCheck = true; doCheck = true;
BLAS_LIBS = "-L${openblas}/lib -lopenblas"; BLAS_LIBS = "-L${blas}/lib -lblas";
LAPACK_LIBS = "-L${lapack}/lib -llapack";
cmakeFlags = [ cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON" "-DBUILD_SHARED_LIBS=ON"
"-DINTERFACE64=${optionalString openblas.blas64 "1"}" "-DINTERFACE64=${optionalString blas.is64bit "1"}"
]; ];
preCheck = if stdenv.isDarwin then '' preCheck = if stdenv.isDarwin then ''

View file

@ -1,10 +1,5 @@
{ stdenv, fetchFromGitHub, gfortran, suitesparse, openblas }: { stdenv, fetchFromGitHub, gfortran, suitesparse, blas, lapack }:
let stdenv.mkDerivation rec {
suitesparse_ = suitesparse;
in let
# SuiteSparse must use the same openblas
suitesparse = suitesparse_.override { inherit openblas; };
in stdenv.mkDerivation rec {
pname = "cholmod-extra"; pname = "cholmod-extra";
version = "1.2.0"; version = "1.2.0";
@ -15,10 +10,10 @@ in stdenv.mkDerivation rec {
sha256 = "0hz1lfp0zaarvl0dv0zgp337hyd8np41kmdpz5rr3fc6yzw7vmkg"; sha256 = "0hz1lfp0zaarvl0dv0zgp337hyd8np41kmdpz5rr3fc6yzw7vmkg";
}; };
buildInputs = [ suitesparse gfortran openblas ]; buildInputs = [ suitesparse gfortran blas lapack ];
buildFlags = [ makeFlags = [
"BLAS=-lopenblas" "BLAS=-lcblas"
]; ];
installFlags = [ installFlags = [

View file

@ -24,6 +24,8 @@
, suitesparse , suitesparse
, swig , swig
, zlib , zlib
, blas
, lapack
}: }:
let let
version = "2019.1.0"; version = "2019.1.0";
@ -176,13 +178,14 @@ let
hdf5 hdf5
mpi mpi
numpy numpy
(numpy.blas) blas
lapack
ply ply
python python
scotch scotch
six six
sphinx sphinx
(suitesparse.override { openblas = numpy.blas; }) suitesparse
swig swig
sympy sympy
ufl ufl

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 { stdenv.mkDerivation rec {
pname = "ipopt"; pname = "ipopt";
@ -12,13 +14,13 @@ stdenv.mkDerivation rec {
CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ]; CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
configureFlags = [ configureFlags = [
"--with-blas-lib=-lopenblas" "--with-blas-lib=-lblas"
"--with-lapack-lib=-lopenblas" "--with-lapack-lib=-llapack"
]; ];
nativeBuildInputs = [ unzip ]; nativeBuildInputs = [ unzip ];
buildInputs = [ gfortran openblas ]; buildInputs = [ gfortran blas lapack ];
enableParallelBuilding = true; enableParallelBuilding = true;

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 , mklSupport ? false, mkl ? null
}: }:
@ -18,7 +18,7 @@ in stdenv.mkDerivation {
}; };
buildInputs = [ gfortran cudatoolkit libpthreadstubs cmake ] buildInputs = [ gfortran cudatoolkit libpthreadstubs cmake ]
++ (if mklSupport then [ mkl ] else [ liblapack ]); ++ (if mklSupport then [ mkl ] else [ lapack blas ]);
doCheck = false; doCheck = false;

View file

@ -1,4 +1,4 @@
{ stdenv , fetchurl , blas , gfortran , liblapack , python }: { stdenv , fetchurl , blas , gfortran , lapack , python }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "petsc"; pname = "petsc";
@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
sha256 = "0943bydmsq3sjwj3rxhb8hx58b1fm8vymny731557fs10g5zfbyz"; sha256 = "0943bydmsq3sjwj3rxhb8hx58b1fm8vymny731557fs10g5zfbyz";
}; };
nativeBuildInputs = [ blas gfortran.cc.lib liblapack python ]; nativeBuildInputs = [ blas gfortran.cc.lib lapack python ];
prePatch = stdenv.lib.optionalString stdenv.isDarwin '' prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace config/install.py \ substituteInPlace config/install.py \
@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
"--with-cxx=$CXX" "--with-cxx=$CXX"
"--with-fc=0" "--with-fc=0"
"--with-mpi=0" "--with-mpi=0"
"--with-blas-lib=[${blas}/lib/libblas.a,${gfortran.cc.lib}/lib/libgfortran.a]" "--with-blas-lib=[${blas}/lib/libblas.so,${gfortran.cc.lib}/lib/libgfortran.a]"
"--with-lapack-lib=[${liblapack}/lib/liblapack.a,${gfortran.cc.lib}/lib/libgfortran.a]" "--with-lapack-lib=[${lapack}/lib/liblapack.so,${gfortran.cc.lib}/lib/libgfortran.a]"
) )
''; '';

View file

@ -1,7 +1,8 @@
{ stdenv, fetchFromGitHub, cmake, openssh { stdenv, fetchFromGitHub, cmake, openssh
, gfortran, mpi, openblasCompat , gfortran, mpi, blas, lapack
} : } :
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "scalapack"; pname = "scalapack";
@ -15,7 +16,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ cmake openssh ]; nativeBuildInputs = [ cmake openssh ];
buildInputs = [ mpi gfortran openblasCompat ]; buildInputs = [ mpi gfortran blas lapack ];
enableParallelBuilding = true; enableParallelBuilding = true;
@ -24,8 +25,8 @@ stdenv.mkDerivation rec {
preConfigure = '' preConfigure = ''
cmakeFlagsArray+=( cmakeFlagsArray+=(
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
-DLAPACK_LIBRARIES="-lopenblas" -DLAPACK_LIBRARIES="-llapack"
-DBLAS_LIBRARIES="-lopenblas" -DBLAS_LIBRARIES="-lblas"
) )
''; '';

View file

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, blas, liblapack, gfortran, fixDarwinDylibNames }: { stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "scs"; pname = "scs";
@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ blas liblapack gfortran.cc.lib ]; buildInputs = [ blas lapack gfortran.cc.lib ];
doCheck = true; doCheck = true;

View file

@ -1,7 +1,7 @@
{ stdenv, fetchurl, gfortran, openblas }: { stdenv, fetchurl, gfortran, blas, lapack }:
let let
int_t = if openblas.blas64 then "int64_t" else "int32_t"; int_t = if blas.is64bit then "int64_t" else "int32_t";
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "4.2.1"; version = "4.2.1";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
}; };
nativeBuildInputs = [ gfortran ]; nativeBuildInputs = [ gfortran ];
buildInputs = [ openblas ]; buildInputs = [ blas lapack ];
preConfigure = '' preConfigure = ''
mkdir -p $out/lib mkdir -p $out/lib
@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
"PREFIX=\"$(out)\"" "PREFIX=\"$(out)\""
"INSTALL_LIB=$(out)/lib" "INSTALL_LIB=$(out)/lib"
"INSTALL_INCLUDE=$(out)/include" "INSTALL_INCLUDE=$(out)/include"
"BLAS=-lopenblas" "BLAS=-lblas"
"LAPACK=" "LAPACK=-llapack"
]; ];
meta = with stdenv.lib; { meta = with stdenv.lib; {

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gfortran, openblas { stdenv, fetchurl, gfortran, blas, lapack
, enableCuda ? false, cudatoolkit , enableCuda ? false, cudatoolkit
}: }:
@ -6,7 +6,7 @@ let
version = "4.4.4"; version = "4.4.4";
name = "suitesparse-${version}"; name = "suitesparse-${version}";
int_t = if openblas.blas64 then "int64_t" else "int32_t"; int_t = if blas.is64bit then "int64_t" else "int32_t";
SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary; SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
in in
stdenv.mkDerivation { stdenv.mkDerivation {
@ -51,8 +51,8 @@ stdenv.mkDerivation {
"PREFIX=\"$(out)\"" "PREFIX=\"$(out)\""
"INSTALL_LIB=$(out)/lib" "INSTALL_LIB=$(out)/lib"
"INSTALL_INCLUDE=$(out)/include" "INSTALL_INCLUDE=$(out)/include"
"BLAS=-lopenblas" "BLAS=-lblas"
"LAPACK=" "LAPACK=-llapack"
]; ];
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER"; NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER";
@ -64,7 +64,7 @@ stdenv.mkDerivation {
for i in "$out"/lib/lib*.a; do for i in "$out"/lib/lib*.a; do
ar -x $i ar -x $i
done done
${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse${SHLIB_EXT}" -lopenblas ${stdenv.lib.optionalString enableCuda "-lcublas"} ${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse${SHLIB_EXT}" -lblas ${stdenv.lib.optionalString enableCuda "-lcublas"}
) )
for i in umfpack cholmod amd camd colamd spqr; do for i in umfpack cholmod amd camd colamd spqr; do
ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT} ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT}
@ -88,7 +88,7 @@ stdenv.mkDerivation {
''; '';
nativeBuildInputs = [ gfortran ]; nativeBuildInputs = [ gfortran ];
buildInputs = [ openblas ]; buildInputs = [ blas lapack ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html"; homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";

View file

@ -1,7 +1,7 @@
{ stdenv { stdenv
, fetchFromGitHub , fetchFromGitHub
, gfortran , gfortran
, openblas , blas, lapack
, metis , metis
, fixDarwinDylibNames , fixDarwinDylibNames
, gnum4 , gnum4
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
buildInputs = [ buildInputs = [
openblas blas lapack
metis metis
gfortran.cc.lib gfortran.cc.lib
] ++ stdenv.lib.optional enableCuda cudatoolkit; ] ++ stdenv.lib.optional enableCuda cudatoolkit;
@ -41,10 +41,10 @@ stdenv.mkDerivation rec {
"INSTALL=${placeholder "out"}" "INSTALL=${placeholder "out"}"
"INSTALL_INCLUDE=${placeholder "dev"}/include" "INSTALL_INCLUDE=${placeholder "dev"}/include"
"JOBS=$(NIX_BUILD_CORES)" "JOBS=$(NIX_BUILD_CORES)"
"BLAS=-lopenblas" "BLAS=-lblas"
"LAPACK=-llapack"
"MY_METIS_LIB=-lmetis" "MY_METIS_LIB=-lmetis"
"LAPACK=" ] ++ stdenv.lib.optionals blas.is64bit [
] ++ stdenv.lib.optionals openblas.blas64 [
"CFLAGS=-DBLAS64" "CFLAGS=-DBLAS64"
] ++ stdenv.lib.optionals enableCuda [ ] ++ stdenv.lib.optionals enableCuda [
"CUDA_PATH=${cudatoolkit}" "CUDA_PATH=${cudatoolkit}"

View file

@ -1,5 +1,7 @@
{ stdenv, fetchurl, cmake, { stdenv, fetchurl, cmake,
gfortran, openblasCompat}: gfortran, blas, lapack}:
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
version = "5.2.1"; version = "5.2.1";
@ -12,7 +14,7 @@ stdenv.mkDerivation rec {
buildInputs = [ cmake gfortran ]; buildInputs = [ cmake gfortran ];
propagatedBuildInputs = [ openblasCompat ]; propagatedBuildInputs = [ blas ];
cmakeFlags = [ cmakeFlags = [
"-DBUILD_SHARED_LIBS=true" "-DBUILD_SHARED_LIBS=true"
@ -20,7 +22,6 @@ stdenv.mkDerivation rec {
]; ];
patches = [ patches = [
./find-openblas-library.patch
./add-superlu-lib-as-dependency-for-the-unit-tests.patch ./add-superlu-lib-as-dependency-for-the-unit-tests.patch
]; ];

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 , python
# GNU Octave needs KLU for ODE solvers # GNU Octave needs KLU for ODE solvers
, suitesparse , suitesparse
, liblapack , blas, lapack
, gfortran , gfortran
, lapackSupport ? true }: , lapackSupport ? true }:
let liblapackShared = liblapack.override { assert (!blas.is64bit) && (!lapack.is64bit);
shared = true;
};
in stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sundials"; pname = "sundials";
version = "2.7.0"; version = "2.7.0";
@ -44,7 +42,7 @@ in stdenv.mkDerivation rec {
"-DKLU_INCLUDE_DIR=${suitesparse}/include" "-DKLU_INCLUDE_DIR=${suitesparse}/include"
"-DKLU_LIBRARY_DIR=${suitesparse}/lib" "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
"-DLAPACK_ENABLE=ON" "-DLAPACK_ENABLE=ON"
"-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" "-DLAPACK_LIBRARIES=${lapack}/lib/lapack${stdenv.hostPlatform.extensions.sharedLibrary};${blas}/lib/blas${stdenv.hostPlatform.extensions.sharedLibrary}"
]; ];
# flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3 # flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3

View file

@ -2,17 +2,18 @@
, cmake , cmake
, fetchurl , fetchurl
, python , python
, openblas , blas
, lapack
, gfortran , gfortran
, lapackSupport ? true }: , lapackSupport ? true }:
let openblas32 = openblas.override { blas64 = false; }; assert (!blas.is64bit) && (!lapack.is64bit);
in stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "sundials"; pname = "sundials";
version = "5.1.0"; version = "5.1.0";
buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran openblas32 ]; buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran blas lapack ];
nativeBuildInputs = [ cmake ]; nativeBuildInputs = [ cmake ];
src = fetchurl { src = fetchurl {
@ -33,7 +34,7 @@ in stdenv.mkDerivation rec {
] ++ stdenv.lib.optionals (lapackSupport) [ ] ++ stdenv.lib.optionals (lapackSupport) [
"-DSUNDIALS_INDEX_TYPE=int32_t" "-DSUNDIALS_INDEX_TYPE=int32_t"
"-DLAPACK_ENABLE=ON" "-DLAPACK_ENABLE=ON"
"-DLAPACK_LIBRARIES=${openblas32}/lib/libopenblas${stdenv.hostPlatform.extensions.sharedLibrary}" "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
]; ];
doCheck = true; doCheck = true;

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 stdenv.lib.versionAtLeast (stdenv.lib.getVersion ocaml) "4.05.0";
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "ocaml${ocaml.version}-lacaml"; pname = "ocaml${ocaml.version}-lacaml";
@ -14,7 +15,7 @@ stdenv.mkDerivation rec {
}; };
buildInputs = [ ocaml findlib dune base stdio ]; buildInputs = [ ocaml findlib dune base stdio ];
propagatedBuildInputs = [ liblapack blas ] ++ propagatedBuildInputs = [ lapack blas ] ++
stdenv.lib.optionals stdenv.isDarwin stdenv.lib.optionals stdenv.isDarwin
[ darwin.apple_sdk.frameworks.Accelerate ]; [ darwin.apple_sdk.frameworks.Accelerate ];

View file

@ -6,11 +6,14 @@
, eigen , eigen
, stdio , stdio
, stdlib-shims , stdlib-shims
, openblasCompat , openblas, blas, lapack
, owl-base , owl-base
, npy , npy
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
buildDunePackage rec { buildDunePackage rec {
pname = "owl"; pname = "owl";
@ -19,7 +22,7 @@ buildDunePackage rec {
checkInputs = [ alcotest ]; checkInputs = [ alcotest ];
buildInputs = [ dune-configurator ]; buildInputs = [ dune-configurator ];
propagatedBuildInputs = [ propagatedBuildInputs = [
eigen stdio stdlib-shims openblasCompat owl-base npy eigen stdio stdlib-shims openblas owl-base npy
]; ];
doCheck = !stdenv.isDarwin; # https://github.com/owlbarn/owl/issues/462 doCheck = !stdenv.isDarwin; # https://github.com/owlbarn/owl/issues/462

View file

@ -4,7 +4,7 @@
, fetchPypi , fetchPypi
, isPyPy , isPyPy
, python , python
, openblasCompat # build segfaults with regular openblas , blas, lapack # build segfaults with 64-bit blas
, suitesparse , suitesparse
, glpk ? null , glpk ? null
, gsl ? null , gsl ? null
@ -14,6 +14,8 @@
, withFftw ? true , withFftw ? true
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
buildPythonPackage rec { buildPythonPackage rec {
pname = "cvxopt"; pname = "cvxopt";
version = "1.2.4"; version = "1.2.4";
@ -25,12 +27,13 @@ buildPythonPackage rec {
sha256 = "1h9g79gxpgpy6xciqyypihw5q4ngp322lpkka1nkwk0ysybfsp7s"; sha256 = "1h9g79gxpgpy6xciqyypihw5q4ngp322lpkka1nkwk0ysybfsp7s";
}; };
buildInputs = [ blas lapack ];
# similar to Gsl, glpk, fftw there is also a dsdp interface # similar to Gsl, glpk, fftw there is also a dsdp interface
# but dsdp is not yet packaged in nixpkgs # but dsdp is not yet packaged in nixpkgs
preConfigure = '' preConfigure = ''
export CVXOPT_BLAS_LIB_DIR=${openblasCompat}/lib export CVXOPT_BLAS_LIB=blas
export CVXOPT_BLAS_LIB=openblas export CVXOPT_LAPACK_LIB=lapack
export CVXOPT_LAPACK_LIB=openblas
export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib export CVXOPT_SUITESPARSE_LIB_DIR=${lib.getLib suitesparse}/lib
export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include export CVXOPT_SUITESPARSE_INC_DIR=${lib.getDev suitesparse}/include
'' + lib.optionalString withGsl '' '' + lib.optionalString withGsl ''

View file

@ -5,21 +5,23 @@
, gfortran , gfortran
, pytest , pytest
, blas , blas
, lapack
, writeTextFile , writeTextFile
, isPyPy , isPyPy
, cython , cython
, setuptoolsBuildHook , setuptoolsBuildHook
}: }:
assert (!blas.is64bit) && (!lapack.is64bit);
let let
blasImplementation = lib.nameFromURL blas.name "-";
cfg = writeTextFile { cfg = writeTextFile {
name = "site.cfg"; name = "site.cfg";
text = (lib.generators.toINI {} { text = (lib.generators.toINI {} {
${blasImplementation} = { ${blas.implementation} = {
include_dirs = "${blas}/include"; include_dirs = "${blas}/include:${lapack}/include";
library_dirs = "${blas}/lib"; library_dirs = "${blas}/lib:${lapack}/lib";
} // lib.optionalAttrs (blasImplementation == "mkl") { } // lib.optionalAttrs (blas.implementation == "mkl") {
mkl_libs = "mkl_rt"; mkl_libs = "mkl_rt";
lapack_libs = ""; lapack_libs = "";
}; };
@ -37,7 +39,7 @@ in buildPythonPackage rec {
}; };
nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ]; nativeBuildInputs = [ gfortran pytest cython setuptoolsBuildHook ];
buildInputs = [ blas ]; buildInputs = [ blas lapack ];
patches = lib.optionals python.hasDistutilsCxxPatch [ patches = lib.optionals python.hasDistutilsCxxPatch [
# We patch cpython/distutils to fix https://bugs.python.org/issue1222585 # We patch cpython/distutils to fix https://bugs.python.org/issue1222585
@ -68,8 +70,10 @@ in buildPythonPackage rec {
''; '';
passthru = { passthru = {
blas = blas; # just for backwards compatibility
inherit blasImplementation cfg; blas = blas.provider;
blasImplementation = blas.implementation;
inherit cfg;
}; };
# Disable test # Disable test

View file

@ -1,13 +1,11 @@
{ lib { lib
, blas , blas
, lapack
, buildPythonPackage , buildPythonPackage
, cffi , cffi
, fetchFromGitHub , fetchFromGitHub
, liblapack
, nose , nose
, numpy , numpy
, openblas
, useOpenblas ? true
}: }:
buildPythonPackage { buildPythonPackage {
@ -21,8 +19,6 @@ buildPythonPackage {
sha256 = "0mlrjbb5rw78dgijkr3bspmsskk6jqs9y7xpsgs35i46dvb327q5"; sha256 = "0mlrjbb5rw78dgijkr3bspmsskk6jqs9y7xpsgs35i46dvb327q5";
}; };
patches = lib.optional useOpenblas ./use-openblas.patch;
checkInputs = [ checkInputs = [
nose nose
]; ];
@ -32,12 +28,7 @@ buildPythonPackage {
cffi cffi
]; ];
buildInputs = ( buildInputs = [ blas lapack ];
if useOpenblas then
[ openblas ]
else
[ blas liblapack ]
);
enableParallelBuilding = true; enableParallelBuilding = true;

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 , fetchFromGitHub
, numpy , numpy
, setuptools , setuptools
, liblapack , blas
, lapack
, isPy27 , isPy27
, python , python
}: }:
@ -24,8 +25,8 @@ buildPythonPackage {
propagatedBuildInputs = [ propagatedBuildInputs = [
numpy numpy
numpy.blas blas
liblapack lapack
]; ];
# Include patches from working version of PySparse 1.3-dev in # Include patches from working version of PySparse 1.3-dev in

View file

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

View file

@ -252,7 +252,7 @@ let
data_table = [pkgs.zlib.dev] ++ lib.optional stdenv.isDarwin pkgs.llvmPackages.openmp; data_table = [pkgs.zlib.dev] ++ lib.optional stdenv.isDarwin pkgs.llvmPackages.openmp;
devEMF = [ pkgs.xorg.libXft.dev pkgs.x11 ]; devEMF = [ pkgs.xorg.libXft.dev pkgs.x11 ];
diversitree = [ pkgs.gsl_1 pkgs.fftw ]; diversitree = [ pkgs.gsl_1 pkgs.fftw ];
EMCluster = [ pkgs.liblapack ]; EMCluster = [ pkgs.lapack ];
fftw = [ pkgs.fftw.dev ]; fftw = [ pkgs.fftw.dev ];
fftwtools = [ pkgs.fftw.dev ]; fftwtools = [ pkgs.fftw.dev ];
Formula = [ pkgs.gmp ]; Formula = [ pkgs.gmp ];
@ -808,11 +808,11 @@ let
}); });
slfm = old.slfm.overrideDerivation (attrs: { slfm = old.slfm.overrideDerivation (attrs: {
PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas"; PKG_LIBS = "-L${pkgs.blas}/lib -lblas -L${pkgs.lapack}/lib -llapack";
}); });
SamplerCompare = old.SamplerCompare.overrideDerivation (attrs: { SamplerCompare = old.SamplerCompare.overrideDerivation (attrs: {
PKG_LIBS = "-L${pkgs.openblasCompat}/lib -lopenblas"; PKG_LIBS = "-L${pkgs.blas}/lib -lblas -L${pkgs.lapack}/lib -llapack";
}); });
EMCluster = old.EMCluster.overrideDerivation (attrs: { EMCluster = old.EMCluster.overrideDerivation (attrs: {

View file

@ -275,20 +275,15 @@ self: super:
old: old:
let let
blas = old.passthru.args.blas or pkgs.openblasCompat; blas = old.passthru.args.blas or pkgs.openblasCompat;
blasImplementation = lib.nameFromURL blas.name "-"; lapack = old.passthru.args.lapack or pkgs.openblasCompat;
cfg = pkgs.writeTextFile { cfg = pkgs.writeTextFile {
name = "site.cfg"; name = "site.cfg";
text = ( text = (lib.generators.toINI {} {
lib.generators.toINI {} { ${blas.implementation} = {
${blasImplementation} = { include_dirs = "${blas}/include:${lapack}/include";
include_dirs = "${blas}/include"; library_dirs = "${blas}/lib:${lapack}/lib";
library_dirs = "${blas}/lib";
} // lib.optionalAttrs (blasImplementation == "mkl") {
mkl_libs = "mkl_rt";
lapack_libs = "";
}; };
} });
);
}; };
in in
{ {
@ -299,8 +294,8 @@ self: super:
ln -s ${cfg} site.cfg ln -s ${cfg} site.cfg
''; '';
passthru = old.passthru // { passthru = old.passthru // {
blas = blas; blsaImplementation = blas.implementation;
inherit blasImplementation cfg; inherit blas cfg;
}; };
} }
); );

View file

@ -1,6 +1,6 @@
{ stdenv, lib, fetchFromGitHub, cmake, perl { stdenv, lib, fetchFromGitHub, cmake, perl
, glib, luajit, openssl, pcre, pkgconfig, sqlite, ragel, icu , glib, luajit, openssl, pcre, pkgconfig, sqlite, ragel, icu
, hyperscan, jemalloc, openblas, lua, libsodium , hyperscan, jemalloc, blas, lapack, lua, libsodium
, withBlas ? true , withBlas ? true
, withHyperscan ? stdenv.isx86_64 , withHyperscan ? stdenv.isx86_64
, withLuaJIT ? stdenv.isx86_64 , withLuaJIT ? stdenv.isx86_64
@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkgconfig perl ]; nativeBuildInputs = [ cmake pkgconfig perl ];
buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ] buildInputs = [ glib openssl pcre sqlite ragel icu jemalloc libsodium ]
++ lib.optional withHyperscan hyperscan ++ lib.optional withHyperscan hyperscan
++ lib.optional withBlas openblas ++ lib.optionals withBlas [ blas lapack ]
++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua; ++ lib.optional withLuaJIT luajit ++ lib.optional (!withLuaJIT) lua;
cmakeFlags = [ cmakeFlags = [

View file

@ -1,4 +1,6 @@
{ stdenv, fetchurl, openblasCompat, mpi } : { stdenv, fetchurl, blas, lapack, mpi } :
assert (!blas.is64bit) && (!lapack.is64bit);
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "hpl"; pname = "hpl";
@ -18,7 +20,7 @@ stdenv.mkDerivation rec {
install -D testing/ptest/HPL.dat $out/share/hpl/HPL.dat install -D testing/ptest/HPL.dat $out/share/hpl/HPL.dat
''; '';
buildInputs = [ openblasCompat mpi ]; buildInputs = [ blas lapack mpi ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Portable Implementation of the Linpack Benchmark for Distributed-Memory Computers"; description = "Portable Implementation of the Linpack Benchmark for Distributed-Memory Computers";
@ -28,4 +30,3 @@ stdenv.mkDerivation rec {
maintainers = [ maintainers.markuskowa ]; maintainers = [ maintainers.markuskowa ];
}; };
} }

View file

@ -8702,25 +8702,21 @@ in
julia_07 = callPackage ../development/compilers/julia/0.7.nix { julia_07 = callPackage ../development/compilers/julia/0.7.nix {
gmp = gmp6; gmp = gmp6;
openblas = openblasCompat;
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
}; };
julia_10 = callPackage ../development/compilers/julia/1.0.nix { julia_10 = callPackage ../development/compilers/julia/1.0.nix {
gmp = gmp6; gmp = gmp6;
openblas = openblasCompat;
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
}; };
julia_11 = callPackage ../development/compilers/julia/1.1.nix { julia_11 = callPackage ../development/compilers/julia/1.1.nix {
gmp = gmp6; gmp = gmp6;
openblas = openblasCompat;
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
}; };
julia_13 = callPackage ../development/compilers/julia/1.3.nix { julia_13 = callPackage ../development/compilers/julia/1.3.nix {
gmp = gmp6; gmp = gmp6;
openblas = openblasCompat;
inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices; inherit (darwin.apple_sdk.frameworks) CoreServices ApplicationServices;
}; };
@ -9404,16 +9400,13 @@ in
octave = callPackage ../development/interpreters/octave { octave = callPackage ../development/interpreters/octave {
python = python3; python = python3;
openblas = if stdenv.isDarwin then openblasCompat else openblas;
}; };
octave-jit = callPackage ../development/interpreters/octave { octave-jit = callPackage ../development/interpreters/octave {
python = python3; python = python3;
openblas = if stdenv.isDarwin then openblasCompat else openblas;
enableJIT = true; enableJIT = true;
}; };
octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave { octaveFull = (lowPrio (libsForQt512.callPackage ../development/interpreters/octave {
python = python3; python = python3;
openblas = if stdenv.isDarwin then openblasCompat else openblas;
enableQt = true; enableQt = true;
overridePlatforms = ["x86_64-linux" "x86_64-darwin"]; overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
})); }));
@ -15252,7 +15245,6 @@ in
texLive = texlive.combine { texLive = texlive.combine {
inherit (texlive) scheme-small inconsolata helvetic texinfo fancyvrb cm-super; inherit (texlive) scheme-small inconsolata helvetic texinfo fancyvrb cm-super;
}; };
openblas = openblasCompat;
withRecommendedPackages = false; withRecommendedPackages = false;
inherit (darwin.apple_sdk.frameworks) Cocoa Foundation; inherit (darwin.apple_sdk.frameworks) Cocoa Foundation;
inherit (darwin) libobjc; inherit (darwin) libobjc;
@ -24191,7 +24183,7 @@ in
molden = callPackage ../applications/science/chemistry/molden { }; molden = callPackage ../applications/science/chemistry/molden { };
octopus = callPackage ../applications/science/chemistry/octopus { openblas=openblasCompat; }; octopus = callPackage ../applications/science/chemistry/octopus { };
openmolcas = callPackage ../applications/science/chemistry/openmolcas { }; openmolcas = callPackage ../applications/science/chemistry/openmolcas { };
@ -24532,7 +24524,7 @@ in
sympow = callPackage ../development/libraries/science/math/sympow { }; sympow = callPackage ../development/libraries/science/math/sympow { };
ipopt = callPackage ../development/libraries/science/math/ipopt { openblas = openblasCompat; }; ipopt = callPackage ../development/libraries/science/math/ipopt { };
gmsh = callPackage ../applications/science/math/gmsh { }; gmsh = callPackage ../applications/science/math/gmsh { };

View file

@ -4667,9 +4667,7 @@ in {
Nuitka = callPackage ../development/python-modules/nuitka { }; Nuitka = callPackage ../development/python-modules/nuitka { };
numpy = let numpy = let
numpy_ = callPackage ../development/python-modules/numpy { numpy_ = callPackage ../development/python-modules/numpy { };
blas = pkgs.openblasCompat;
};
numpy_2 = numpy_.overridePythonAttrs(oldAttrs: rec { numpy_2 = numpy_.overridePythonAttrs(oldAttrs: rec {
version = "1.16.5"; version = "1.16.5";
src = oldAttrs.src.override { src = oldAttrs.src.override {
@ -4952,11 +4950,7 @@ in {
promise = callPackage ../development/python-modules/promise { }; promise = callPackage ../development/python-modules/promise { };
prox-tv = callPackage ../development/python-modules/prox-tv { prox-tv = callPackage ../development/python-modules/prox-tv { };
# We need to use blas instead of openblas on darwin,
# see https://github.com/NixOS/nixpkgs/pull/45013.
useOpenblas = ! stdenv.isDarwin;
};
pvlib = callPackage ../development/python-modules/pvlib { }; pvlib = callPackage ../development/python-modules/pvlib { };