nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
Anders Kaseorg 3cd8ce3bce treewide: Fix unsafe concatenation of $LD_LIBRARY_PATH
Naive concatenation of $LD_LIBRARY_PATH can result in an empty
colon-delimited segment; this tells glibc to load libraries from the
current directory, which is definitely wrong, and may be a security
vulnerability if the current directory is untrusted.  (See #67234, for
example.)  Fix this throughout the tree.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2020-01-15 09:47:03 +01:00

55 lines
1.4 KiB
Nix

{ stdenv, fetchFromGitHub, cmake, openssh
, gfortran, mpi, openblasCompat
} :
stdenv.mkDerivation rec {
pname = "scalapack";
version = "2.1";
src = fetchFromGitHub {
owner = "Reference-ScaLAPACK";
repo = pname;
rev = "v${version}";
sha256 = "042q9kc383h7y0had9a37702z4s0szavss063ljvfdsbjy07gzb1";
};
nativeBuildInputs = [ cmake openssh ];
buildInputs = [ mpi gfortran openblasCompat ];
enableParallelBuilding = true;
doCheck = true;
preConfigure = ''
cmakeFlagsArray+=(
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
-DLAPACK_LIBRARIES="-lopenblas"
-DBLAS_LIBRARIES="-lopenblas"
)
'';
# Increase individual test timeout from 1500s to 10000s because hydra's builds
# sometimes fail due to this
checkFlagsArray = [ "ARGS=--timeout 10000" ];
preCheck = ''
# make sure the test starts even if we have less than 4 cores
export OMPI_MCA_rmaps_base_oversubscribe=1
# Run single threaded
export OMP_NUM_THREADS=1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
'';
meta = with stdenv.lib; {
homepage = http://www.netlib.org/scalapack/;
description = "Library of high-performance linear algebra routines for parallel distributed memory machines";
license = licenses.bsd3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ costrouc markuskowa ];
};
}