Created
August 1, 2019 07:54
-
-
Save steinitznavican/e23f8cc8889a8ec1190a17ad102fd482 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
with pkgs; | |
let | |
inherit stdenv fetchurl perl; | |
version = "2.1.1"; | |
in | |
{ | |
sundials = stdenv.mkDerivation rec { | |
pname = "sundials"; | |
version = "3.2.1"; | |
src = fetchurl { | |
url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz"; | |
sha256 = "0238r1qnwqz13wcjzfsbcfi8rfnlxcjjmxq2vpf2qf5jgablvna7"; | |
}; | |
buildInputs = [ cmake ] ++ | |
[ python ] ++ | |
# stdenv.lib.optionals (lapackSupport) [ openblas liblapack gfortran ]; | |
[ openblas liblapack gfortran ]; | |
nativeBuildInputs = [ cmake ]; | |
cmakeFlags = [ | |
"-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" | |
"-DEXAMPLES_INSTALL=ON" | |
"-DEXAMPLES_ENABLE_C=ON" | |
] ++ [ | |
"-DSUNDIALS_INDEX_TYPE=int32_t" | |
"-DLAPACK_ENABLE=ON" | |
"-DLAPACK_LIBRARIES=${openblas}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary};${openblas}/lib/liblapack.dylib" | |
]; | |
postInstall = '' | |
mkdir $out/easytofind | |
echo $(ls) > $out/easytofind/foo.txt | |
cp -r . $out/easytofind | |
cd $out/easytofind/LapackTest | |
echo $(pwd) > $out/easytofind/bar.txt | |
make | |
./ltest > $out/easytofind/ltest.out | |
''; | |
meta = with stdenv.lib; { | |
description = "Suite of nonlinear differential/algebraic equation solvers"; | |
homepage = https://computation.llnl.gov/projects/sundials; | |
platforms = platforms.all; | |
maintainers = [ maintainers.idontgetoutmuch ]; | |
license = licenses.bsd3; | |
}; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment