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 }:
|
||||
|
||||
let
|
||||
int_t = if blas.isILP64 then "int64_t" else "int32_t";
|
||||
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
|
||||
"LAPACK=-llapack"
|
||||
];
|
||||
|
||||
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 ];
|
||||
|
||||
@@ -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 ];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{ stdenv
|
||||
{ lib, stdenv
|
||||
, fetchFromGitHub
|
||||
, gfortran
|
||||
, blas, lapack
|
||||
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
||||
|
||||
# Use compatible indexing for lapack and blas used
|
||||
buildInputs = assert (blas.isILP64 == lapack.isILP64); [
|
||||
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
|
||||
gfortran.cc.lib
|
||||
gmp
|
||||
mpfr
|
||||
] ++ stdenv.lib.optional enableCuda cudatoolkit;
|
||||
] ++ lib.optional enableCuda cudatoolkit;
|
||||
|
||||
preConfigure = ''
|
||||
# Mongoose and GraphBLAS are packaged separately
|
||||
@@ -45,13 +45,13 @@ stdenv.mkDerivation rec {
|
||||
"INSTALL_INCLUDE=${placeholder "dev"}/include"
|
||||
"JOBS=$(NIX_BUILD_CORES)"
|
||||
"MY_METIS_LIB=-lmetis"
|
||||
] ++ stdenv.lib.optionals blas.isILP64 [
|
||||
] ++ lib.optionals blas.isILP64 [
|
||||
"CFLAGS=-DBLAS64"
|
||||
] ++ stdenv.lib.optionals enableCuda [
|
||||
] ++ lib.optionals enableCuda [
|
||||
"CUDA_PATH=${cudatoolkit}"
|
||||
"CUDART_LIB=${cudatoolkit.lib}/lib/libcudart.so"
|
||||
"CUBLAS_LIB=${cudatoolkit}/lib/libcublas.so"
|
||||
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
# Unless these are set, the build will attempt to use `Accelerate` on darwin, see:
|
||||
# https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/v5.8.1/SuiteSparse_config/SuiteSparse_config.mk#L368
|
||||
"BLAS=-lblas"
|
||||
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
|
||||
"library"
|
||||
];
|
||||
|
||||
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