pkgs/development/libraries: stdenv.lib -> lib
This commit is contained in:
committed by
Jonathan Ringer
parent
046d24424e
commit
66e44425c6
@@ -1,4 +1,4 @@
|
||||
{ stdenv, fetchurl, gfortran, blas, lapack
|
||||
{ lib, stdenv, fetchurl, gfortran, blas, lapack
|
||||
, enableCuda ? false, cudatoolkit
|
||||
}:
|
||||
|
||||
@@ -27,11 +27,11 @@ stdenv.mkDerivation {
|
||||
-e '/CHOLMOD_CONFIG/ s/$/-DNPARTITION -DLONGBLAS=${int_t}/' \
|
||||
-e '/UMFPACK_CONFIG/ s/$/-DLONGBLAS=${int_t}/'
|
||||
''
|
||||
+ stdenv.lib.optionalString stdenv.isDarwin ''
|
||||
+ lib.optionalString stdenv.isDarwin ''
|
||||
sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
|
||||
-e 's/^[[:space:]]*\(LIB = -lm\) -lrt/\1/'
|
||||
''
|
||||
+ stdenv.lib.optionalString enableCuda ''
|
||||
+ lib.optionalString enableCuda ''
|
||||
sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
|
||||
-e 's|^[[:space:]]*\(CUDA_ROOT =\)|CUDA_ROOT = ${cudatoolkit}|' \
|
||||
-e 's|^[[:space:]]*\(GPU_BLAS_PATH =\)|GPU_BLAS_PATH = $(CUDA_ROOT)|' \
|
||||
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
|
||||
"LAPACK=-llapack"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER";
|
||||
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin " -DNTIMER";
|
||||
|
||||
postInstall = ''
|
||||
# Build and install shared library
|
||||
@@ -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}" -lblas ${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 ${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}
|
||||
@@ -90,7 +90,7 @@ stdenv.mkDerivation {
|
||||
nativeBuildInputs = [ gfortran ];
|
||||
buildInputs = [ blas lapack ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
|
||||
description = "A suite of sparse matrix algorithms";
|
||||
license = with licenses; [ bsd2 gpl2Plus lgpl21Plus ];
|
||||
|
||||
Reference in New Issue
Block a user