suitesparse: link against system metis

This commit is contained in:
Jan Tojnar 2020-03-10 20:07:26 +01:00
parent e9d7774b7b
commit 306cf6091f
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4

View File

@ -2,6 +2,7 @@
, fetchFromGitHub , fetchFromGitHub
, gfortran , gfortran
, openblas , openblas
, metis
, cmake , cmake
, fixDarwinDylibNames , fixDarwinDylibNames
, gnum4 , gnum4
@ -29,6 +30,7 @@ stdenv.mkDerivation rec {
buildInputs = [ buildInputs = [
openblas openblas
metis
gfortran.cc.lib gfortran.cc.lib
] ++ stdenv.lib.optional enableCuda cudatoolkit; ] ++ stdenv.lib.optional enableCuda cudatoolkit;
@ -71,6 +73,7 @@ stdenv.mkDerivation rec {
make library \ make library \
JOBS=$NIX_BUILD_CORES \ JOBS=$NIX_BUILD_CORES \
BLAS=-lopenblas \ BLAS=-lopenblas \
MY_METIS_LIB=-lmetis \
LAPACK="" \ LAPACK="" \
${stdenv.lib.optionalString openblas.blas64 "CFLAGS=-DBLAS64"} ${stdenv.lib.optionalString openblas.blas64 "CFLAGS=-DBLAS64"}
@ -78,7 +81,9 @@ stdenv.mkDerivation rec {
# Bundling is done by building the static libraries, extracting objects from # Bundling is done by building the static libraries, extracting objects from
# them and combining the objects into one shared library. # them and combining the objects into one shared library.
mkdir -p static mkdir -p static
make static JOBS=$NIX_BUILD_CORES AR_TARGET=$(pwd)/static/'$(LIBRARY).a' make static JOBS=$NIX_BUILD_CORES \
MY_METIS_LIB=-lmetis \
AR_TARGET=$(pwd)/static/'$(LIBRARY).a'
( (
cd static cd static
for i in lib*.a; do for i in lib*.a; do