From e36b3ec0a56c3b06152a205a46804733b88695d6 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Thu, 4 Jun 2015 07:09:29 -0500 Subject: [PATCH] suitesparse: build shared libraries --- pkgs/development/compilers/julia/0.3.nix | 19 +++---------------- .../science/math/suitesparse/default.nix | 12 ++++++++++++ 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/pkgs/development/compilers/julia/0.3.nix b/pkgs/development/compilers/julia/0.3.nix index c7cda2749248..62a1f4f98cc5 100644 --- a/pkgs/development/compilers/julia/0.3.nix +++ b/pkgs/development/compilers/julia/0.3.nix @@ -63,7 +63,6 @@ stdenv.mkDerivation rec { makeFlags = [ "USE_SYSTEM_PATCHELF=1" - "USE_SYSTEM_OPENBLAS=1" "USE_SYSTEM_BLAS=1" "USE_SYSTEM_LAPACK=1" "ARCH=${arch}" @@ -122,25 +121,13 @@ stdenv.mkDerivation rec { ''; preBuild = '' + # Link dynamically loaded shared libraries into output so they are found at runtime. mkdir -p "$out/lib" ln -s "${openblas}/lib/libopenblas.so" "$out/lib/libblas.so" ln -s "${openblas}/lib/libopenblas.so" "$out/lib/liblapack.so" - - mkdir -p usr/lib - - echo "$out" - mkdir -p "$out/lib" - ( - cd "$(mktemp -d)" - for i in "${suitesparse}"/lib/lib*.a; do - ar -x $i - done - gcc *.o --shared -o "$out/lib/libsuitesparse.so" - ) - cp "$out/lib/libsuitesparse.so" usr/lib + ln -s "${suitesparse}/lib/libsuitesparse.so" "$out/lib/libsuitesparse.so" for i in umfpack cholmod amd camd colamd spqr; do - ln -s libsuitesparse.so "$out"/lib/lib$i.so; - ln -s libsuitesparse.so "usr"/lib/lib$i.so; + ln -s libsuitesparse.so "$out/lib/lib$i.so"; done ''; diff --git a/pkgs/development/libraries/science/math/suitesparse/default.nix b/pkgs/development/libraries/science/math/suitesparse/default.nix index af9396ad9004..f30db472b0de 100644 --- a/pkgs/development/libraries/science/math/suitesparse/default.nix +++ b/pkgs/development/libraries/science/math/suitesparse/default.nix @@ -36,6 +36,18 @@ stdenv.mkDerivation { NIX_CFLAGS = "-fPIC"; postInstall = '' + # Build and install shared library + ( + cd "$(mktemp -d)" + for i in "$out"/lib/lib*.a; do + ar -x $i + done + gcc *.o --shared -o "$out/lib/libsuitesparse.so" + ) + for i in umfpack cholmod amd camd colamd spqr; do + ln -s libsuitesparse.so "$out"/lib/lib$i.so; + done + # Install documentation outdoc=$out/share/doc/${name} mkdir -p $outdoc