From d9ce716cccdcd42b1d0fd18f82c2ecbbcd33a35f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 2 Jul 2019 14:55:34 +0200 Subject: sundials: use cmakeFlags --- pkgs/development/libraries/sundials/default.nix | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix index abe444c63c32..a7ecae91b220 100644 --- a/pkgs/development/libraries/sundials/default.nix +++ b/pkgs/development/libraries/sundials/default.nix @@ -1,27 +1,29 @@ -{ cmake, fetchurl, python, stdenv }: +{ stdenv +, cmake +, fetchurl +, python }: stdenv.mkDerivation rec { - pname = "sundials"; version = "4.1.0"; + nativeBuildInputs = [ cmake ]; + buildInputs = [ python ]; + src = fetchurl { url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz"; sha256 = "19ca4nmlf6i9ijqcibyvpprxzsdfnackgjs6dw51fq13gg1f2398"; }; - preConfigure = '' - export cmakeFlags="-DCMAKE_INSTALL_PREFIX=$out -DEXAMPLES_INSTALL_PATH=$out/share/examples $cmakeFlags" - ''; - - nativeBuildInputs = [ cmake ]; - buildInputs = [ python ]; + cmakeFlags = [ + "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" + ]; 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 ]; + maintainers = with maintainers; [ flokli idontgetoutmuch ]; license = licenses.bsd3; }; -- cgit 1.4.1 From ad3023e5f7a8116c544591244c6850d9c76e930d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 1 Aug 2019 14:02:00 +0200 Subject: sundials: enable tests --- pkgs/development/libraries/sundials/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix index a7ecae91b220..b95eec871b03 100644 --- a/pkgs/development/libraries/sundials/default.nix +++ b/pkgs/development/libraries/sundials/default.nix @@ -15,10 +15,19 @@ stdenv.mkDerivation rec { sha256 = "19ca4nmlf6i9ijqcibyvpprxzsdfnackgjs6dw51fq13gg1f2398"; }; + patches = [ (fetchurl { + # https://github.com/LLNL/sundials/pull/19 + url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; + sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; + })]; + cmakeFlags = [ "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" ]; + doCheck = true; + checkPhase = "make test"; + meta = with stdenv.lib; { description = "Suite of nonlinear differential/algebraic equation solvers"; homepage = https://computation.llnl.gov/projects/sundials; -- cgit 1.4.1 From 5f48e89f37f3bf5dd30ea54d9f1f03e019ad595f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 1 Aug 2019 14:28:19 +0200 Subject: sundials: add lapack support --- pkgs/development/libraries/sundials/default.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix index b95eec871b03..a10ef0d4b8ee 100644 --- a/pkgs/development/libraries/sundials/default.nix +++ b/pkgs/development/libraries/sundials/default.nix @@ -1,14 +1,21 @@ { stdenv , cmake , fetchurl -, python }: +, python +, liblapack +, gfortran +, lapackSupport ? true }: -stdenv.mkDerivation rec { +let liblapackShared = liblapack.override { + shared = true; +}; + +in stdenv.mkDerivation rec { pname = "sundials"; version = "4.1.0"; + buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran ]; nativeBuildInputs = [ cmake ]; - buildInputs = [ python ]; src = fetchurl { url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz"; @@ -23,6 +30,10 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" + ] ++ stdenv.lib.optionals (lapackSupport) [ + "-DSUNDIALS_INDEX_TYPE=int32_t" + "-DLAPACK_ENABLE=ON" + "-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; doCheck = true; @@ -35,5 +46,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ flokli idontgetoutmuch ]; license = licenses.bsd3; }; - } -- cgit 1.4.1 From 7e9e22f4d57816a74a7050a8edc0e85d63427fea Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Tue, 2 Jul 2019 19:57:22 +0200 Subject: sundials_3: init at 3.2.1 That's needed for scikits.odes. Upstream bug to migrate to sundials 4: https://github.com/bmcage/odes/issues/98 --- pkgs/development/libraries/sundials/3.x.nix | 49 +++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/development/libraries/sundials/3.x.nix (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/sundials/3.x.nix b/pkgs/development/libraries/sundials/3.x.nix new file mode 100644 index 000000000000..999b73af7b41 --- /dev/null +++ b/pkgs/development/libraries/sundials/3.x.nix @@ -0,0 +1,49 @@ +{ stdenv +, cmake +, fetchurl +, python +, liblapack +, gfortran +, lapackSupport ? true }: + +let liblapackShared = liblapack.override { + shared = true; +}; + +in stdenv.mkDerivation rec { + pname = "sundials"; + version = "3.2.1"; + + buildInputs = [ python ] ++ stdenv.lib.optionals (lapackSupport) [ gfortran ]; + nativeBuildInputs = [ cmake ]; + + src = fetchurl { + url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz"; + sha256 = "0238r1qnwqz13wcjzfsbcfi8rfnlxcjjmxq2vpf2qf5jgablvna7"; + }; + + patches = [ (fetchurl { + # https://github.com/LLNL/sundials/pull/19 + url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; + sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; + })]; + + cmakeFlags = [ + "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" + ] ++ stdenv.lib.optionals (lapackSupport) [ + "-DSUNDIALS_INDEX_TYPE=int32_t" + "-DLAPACK_ENABLE=ON" + "-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" + ]; + + doCheck = true; + checkPhase = "make test"; + + meta = with stdenv.lib; { + description = "Suite of nonlinear differential/algebraic equation solvers"; + homepage = https://computation.llnl.gov/projects/sundials; + platforms = platforms.all; + maintainers = with maintainers; [ flokli idontgetoutmuch ]; + license = licenses.bsd3; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1cea76ad3dbe..ca37025f7f31 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13746,6 +13746,8 @@ in sundials = callPackage ../development/libraries/sundials { }; + sundials_3 = callPackage ../development/libraries/sundials/3.x.nix { }; + sutils = callPackage ../tools/misc/sutils { }; svrcore = callPackage ../development/libraries/svrcore { }; -- cgit 1.4.1 From ac12bdfc96c7981226d711ac1b8d67c1683fcad1 Mon Sep 17 00:00:00 2001 From: Dominic Steinitz Date: Fri, 2 Aug 2019 12:12:22 +0100 Subject: sundials: relax tolerance for test_sunmatrix_sparse This test fails on MacOS otherwise, due to slightly different math. Only add for sundials 4, it's not in sundials_3 yet. --- pkgs/development/libraries/sundials/3.x.nix | 12 +++++++----- pkgs/development/libraries/sundials/default.nix | 17 ++++++++++++----- 2 files changed, 19 insertions(+), 10 deletions(-) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/sundials/3.x.nix b/pkgs/development/libraries/sundials/3.x.nix index 999b73af7b41..6b40a7b62e66 100644 --- a/pkgs/development/libraries/sundials/3.x.nix +++ b/pkgs/development/libraries/sundials/3.x.nix @@ -22,11 +22,13 @@ in stdenv.mkDerivation rec { sha256 = "0238r1qnwqz13wcjzfsbcfi8rfnlxcjjmxq2vpf2qf5jgablvna7"; }; - patches = [ (fetchurl { - # https://github.com/LLNL/sundials/pull/19 - url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; - sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; - })]; + patches = [ + (fetchurl { + # https://github.com/LLNL/sundials/pull/19 + url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; + sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; + }) + ]; cmakeFlags = [ "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix index a10ef0d4b8ee..bd7a3aea7d49 100644 --- a/pkgs/development/libraries/sundials/default.nix +++ b/pkgs/development/libraries/sundials/default.nix @@ -22,11 +22,18 @@ in stdenv.mkDerivation rec { sha256 = "19ca4nmlf6i9ijqcibyvpprxzsdfnackgjs6dw51fq13gg1f2398"; }; - patches = [ (fetchurl { - # https://github.com/LLNL/sundials/pull/19 - url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; - sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; - })]; + patches = [ + (fetchurl { + # https://github.com/LLNL/sundials/pull/19 + url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch"; + sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l"; + }) + (fetchurl { + # https://github.com/LLNL/sundials/pull/20 + url = "https://github.com/LLNL/sundials/pull/20/commits/2d951bbe1ff7842fcd0dafa28c61b0aa94015f66.patch"; + sha256 = "0lcr6m4lk14yqrxah4rdscpczny5l7m1zpfsjh8bgspadfsgk512"; + }) + ]; cmakeFlags = [ "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples" -- cgit 1.4.1 From a5de10b0afe5bcab41fc41a0dbebfbd99223a4dc Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 8 Sep 2019 15:18:43 -0700 Subject: sundials: include patch to remove flakiness The provided patch doesn't apply cleanly on sundials_3 (no SundialsTesting.cmake, SundialsAddTest.cmake containing trailing whitespaces inside context), so for now we just disable tests for sundials_3 - scikits-odes plans to move to sundials 4 anyways - see https://github.com/bmcage/odes/pull/106. --- pkgs/development/libraries/sundials/3.x.nix | 3 +- pkgs/development/libraries/sundials/default.nix | 2 + .../libraries/sundials/tests-parallel.patch | 45 ++++++++++++++++++++++ 3 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/libraries/sundials/tests-parallel.patch (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/sundials/3.x.nix b/pkgs/development/libraries/sundials/3.x.nix index 6b40a7b62e66..879f13e8bf53 100644 --- a/pkgs/development/libraries/sundials/3.x.nix +++ b/pkgs/development/libraries/sundials/3.x.nix @@ -38,7 +38,8 @@ in stdenv.mkDerivation rec { "-DLAPACK_LIBRARIES=${liblapackShared}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary};${liblapackShared}/lib/libblas${stdenv.hostPlatform.extensions.sharedLibrary}" ]; - doCheck = true; + # flaky tests, and patch in https://github.com/LLNL/sundials/pull/21 doesn't apply cleanly for sundials_3 + doCheck = false; checkPhase = "make test"; meta = with stdenv.lib; { diff --git a/pkgs/development/libraries/sundials/default.nix b/pkgs/development/libraries/sundials/default.nix index bd7a3aea7d49..4bc066df32e2 100644 --- a/pkgs/development/libraries/sundials/default.nix +++ b/pkgs/development/libraries/sundials/default.nix @@ -33,6 +33,8 @@ in stdenv.mkDerivation rec { url = "https://github.com/LLNL/sundials/pull/20/commits/2d951bbe1ff7842fcd0dafa28c61b0aa94015f66.patch"; sha256 = "0lcr6m4lk14yqrxah4rdscpczny5l7m1zpfsjh8bgspadfsgk512"; }) + # https://github.com/LLNL/sundials/pull/21 + ./tests-parallel.patch ]; cmakeFlags = [ diff --git a/pkgs/development/libraries/sundials/tests-parallel.patch b/pkgs/development/libraries/sundials/tests-parallel.patch new file mode 100644 index 000000000000..a785a1dade9b --- /dev/null +++ b/pkgs/development/libraries/sundials/tests-parallel.patch @@ -0,0 +1,45 @@ +diff --git a/config/SundialsAddTest.cmake b/config/SundialsAddTest.cmake +index e965fed..a7fb1d2 100644 +--- a/config/SundialsAddTest.cmake ++++ b/config/SundialsAddTest.cmake +@@ -70,7 +70,7 @@ MACRO(SUNDIALS_ADD_TEST NAME EXECUTABLE) + "--verbose" + "--testname=${NAME}" + "--executablename=$" +- "--outputdir=${CMAKE_BINARY_DIR}/Testing/output" ++ "--outputdir=${TEST_OUTPUT_DIR}" + ) + + # do not diff the output and answer files +diff --git a/config/SundialsTesting.cmake b/config/SundialsTesting.cmake +index 815576a..d91801a 100644 +--- a/config/SundialsTesting.cmake ++++ b/config/SundialsTesting.cmake +@@ -29,6 +29,13 @@ IF(SUNDIALS_DEVTESTS) + ENDIF() + ENDIF() + ++ # Directory for test output ++ SET(TEST_OUTPUT_DIR ${PROJECT_BINARY_DIR}/Testing/output) ++ ++ IF(NOT EXISTS ${TEST_OUTPUT_DIR}) ++ FILE(MAKE_DIRECTORY ${TEST_OUTPUT_DIR}) ++ ENDIF() ++ + # look for the testRunner script in the test directory + FIND_PROGRAM(TESTRUNNER testRunner PATHS test) + HIDE_VARIABLE(TESTRUNNER) +diff --git a/test/testRunner b/test/testRunner +index f450ec2..f1c8deb 100755 +--- a/test/testRunner ++++ b/test/testRunner +@@ -106,7 +106,8 @@ def main(): + + # create output directory if necessary + if not os.path.exists(outDir): +- os.makedirs(outDir) ++ error("Output directory does not exist, it must be created.", outDir) ++ sys.exit(1) + elif not os.path.isdir(outDir): + error("Output directory exists but is not a directory, it must be deleted.", outDir) + sys.exit(1) -- cgit 1.4.1 From adf5ca2ce0b19d218ac210e2bb57fa07c2f064ba Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sun, 8 Sep 2019 22:53:23 -0400 Subject: jemalloc450: disable transparent huge pages on ARM --- pkgs/development/libraries/jemalloc/common.nix | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pkgs/development/libraries') diff --git a/pkgs/development/libraries/jemalloc/common.nix b/pkgs/development/libraries/jemalloc/common.nix index c41455a65441..128910e00f21 100644 --- a/pkgs/development/libraries/jemalloc/common.nix +++ b/pkgs/development/libraries/jemalloc/common.nix @@ -24,6 +24,13 @@ stdenv.mkDerivation rec { configureFlags = [] ++ optional stripPrefix "--with-jemalloc-prefix=" ++ optional disableInitExecTls "--disable-initial-exec-tls" + # jemalloc is unable to correctly detect transparent hugepage support on + # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default + # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support + ++ optionals (stdenv.isAarch32 && versionOlder version "5") [ + "--disable-thp" + "je_cv_thp=no" + ] ; doCheck = true; -- cgit 1.4.1