@@ -1,11 +1,7 @@
1−{ stdenv
2−, fetchurl
3−, gfortran
4−, cmake
5−, blas
6−, liblapack
7−, mpi
8−}:
1+{ stdenv, fetchurl, cmake, openssh
2+, gfortran, mpi, openblasCompat
3+} :
4+
95
106stdenv.mkDerivation rec {
117 name = "scalapack-${version}";
@@ -16,12 +12,38 @@ stdenv.mkDerivation rec {
1612 sha256 = "0p1r61ss1fq0bs8ynnx7xq4wwsdvs32ljvwjnx6yxr8gd6pawx0c";
1713 };
1814
19− buildInputs = [ cmake mpi liblapack blas gfortran ];
15+ nativeBuildInputs = [ cmake openssh ];
16+ buildInputs = [ mpi gfortran openblasCompat ];
17+
18+ enableParallelBuilding = true;
19+
20+ doCheck = true;
21+
22+ preConfigure = ''
23+ cmakeFlagsArray+=(
24+ -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
25+ -DLAPACK_LIBRARIES="-lopenblas"
26+ -DBLAS_LIBRARIES="-lopenblas"
27+ )
28+ '';
29+
30+ checkPhase = ''
31+ # make sure the test starts even if we have less than 4 cores
32+ export OMPI_MCA_rmaps_base_oversubscribe=1
33+
34+ # Run single threaded
35+ export OMP_NUM_THREADS=1
36+
37+ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:`pwd`/lib
38+ export CTEST_OUTPUT_ON_FAILURE=1
39+
40+ make test
41+ '';
2042
2143 meta = with stdenv.lib; {
2244 homepage = http://www.netlib.org/scalapack/;
2345 description = "Library of high-performance linear algebra routines for parallel distributed memory machines";
24− license = licenses.bsdOriginal;
46+ license = licenses.bsd3;
2547 platforms = platforms.all;
2648 maintainers = [ maintainers.costrouc ];
2749 };