about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-07-09 12:30:28 +0000
committerAlyssa Ross <hi@alyssa.is>2021-07-23 09:11:31 +0000
commit55cc63c079f49e81d695a25bc2f5b3902f2bd290 (patch)
treee705335d97f50b927c76ccb4a3fbde9fab8372b9 /nixpkgs/pkgs/development/libraries/science
parentc26eb6f74d9393127a21eee7a9620a920769f613 (diff)
parent87807e64a5ef5206b745a40af118c7be8db73681 (diff)
downloadnixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.gz
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.bz2
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.lz
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.xz
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.zst
nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.zip
Merge commit '87807e64a5ef5206b745a40af118c7be8db73681'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/blas/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch26
5 files changed, 163 insertions, 8 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
index 332806c495c9..85a73ccd5697 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "blas";
-  version = "3.8.0";
+  version = "3.10.0";
 
   src = fetchurl {
     url = "http://www.netlib.org/blas/${pname}-${version}.tgz";
-    sha256 = "1s24iry5197pskml4iygasw196bdhplj0jmbsb9jhabcjqj2mpsm";
+    sha256 = "sha256-LjYNmcm9yEB6YYiMQKqFP7QhlCDruCZNtIbLiGBGirM=";
   };
 
   buildInputs = [ gfortran ];
@@ -20,17 +20,17 @@ stdenv.mkDerivation rec {
     echo >>make.inc "NOOPT = -O0 -fPIC"
     echo >>make.inc "LOADER = gfortran"
     echo >>make.inc "LOADOPTS ="
-    echo >>make.inc "ARCH = gfortran"
-    echo >>make.inc "ARCHFLAGS = -shared -o"
+    echo >>make.inc "AR = gfortran"
+    echo >>make.inc "ARFLAGS = -shared -o"
     echo >>make.inc "RANLIB = echo"
     echo >>make.inc "BLASLIB = libblas.so.${version}"
   '';
 
   buildPhase = ''
     make
-    echo >>make.inc "ARCHFLAGS = "
+    echo >>make.inc "ARFLAGS = "
     echo >>make.inc "BLASLIB = libblas.a"
-    echo >>make.inc "ARCH = ar rcs"
+    echo >>make.inc "AR = ar rcs"
     echo >>make.inc "RANLIB = ranlib"
     make
   '';
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
index 50563f2745ab..66f343d4912d 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -7,7 +7,7 @@
 }:
 let
   inherit (lib) optional;
-  version = "3.9.0";
+  version = "3.9.1";
 in
 
 stdenv.mkDerivation rec {
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     owner = "Reference-LAPACK";
     repo = "lapack";
     rev = "v${version}";
-    sha256 = "0sxnc97z67i7phdmcnq8f8lmxgw10wdwvr8ami0w3pb179cgrbpb";
+    sha256 = "sha256-B7eRaEY9vaLvuKkJ7d2KWanGE7OXh43O0UbXFheUWK8=";
   };
 
   nativeBuildInputs = [ gfortran cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix
new file mode 100644
index 000000000000..338101b80b56
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, p4est-sc-debugEnable ? true, p4est-sc-mpiSupport ? true
+, mpi, openssh, zlib
+}:
+
+let
+  dbg = if debugEnable then "-dbg" else "";
+  debugEnable = p4est-sc-debugEnable;
+  mpiSupport = p4est-sc-mpiSupport;
+  isOpenmpi = mpiSupport && mpi.pname == "openmpi";
+in
+stdenv.mkDerivation {
+  pname = "p4est-sc${dbg}";
+  version = "unstable-2021-06-14";
+
+  # fetch an untagged snapshot of the prev3-develop branch
+  src = fetchFromGitHub {
+    owner = "cburstedde";
+    repo = "libsc";
+    rev = "1ae814e3fb1cc5456652e0d77550386842cb9bfb";
+    sha256 = "14vm0b162jh8399pgpsikbwq4z5lkrw9vfzy3drqykw09n6nc53z";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  propagatedBuildInputs = [ zlib ]
+    ++ lib.optional mpiSupport mpi
+    ++ lib.optional isOpenmpi openssh
+  ;
+  inherit debugEnable mpiSupport;
+
+  postPatch = ''
+    echo "dist_scaclocal_DATA += config/sc_v4l2.m4" >> Makefile.am
+  '';
+  preConfigure = ''
+    echo "2.8.0" > .tarball-version
+    ${if mpiSupport then "unset CC" else ""}
+  '';
+
+  configureFlags = [ "--enable-pthread=-pthread" ]
+    ++ lib.optional debugEnable "--enable-debug"
+    ++ lib.optional mpiSupport "--enable-mpi"
+  ;
+
+  dontDisableStatic = true;
+  enableParallelBuilding = true;
+  makeFlags = [ "V=0" ];
+
+  preCheck = ''
+    export OMPI_MCA_rmaps_base_oversubscribe=1
+    export HYDRA_IFACE=lo
+  '';
+
+  # disallow Darwin checks due to prototype incompatibility of qsort_r
+  # to be fixed in a future version of the source code
+  doCheck = !stdenv.isDarwin && stdenv.hostPlatform == stdenv.buildPlatform;
+
+  meta = {
+    branch = "prev3-develop";
+    description = "Support for parallel scientific applications";
+    longDescription = ''
+      The SC library provides support for parallel scientific applications.
+      Its main purpose is to support the p4est software library, hence
+      this package is called p4est-sc, but it works standalone, too.
+    '';
+    homepage = "https://www.p4est.org/";
+    downloadPage = "https://github.com/cburstedde/libsc.git";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.cburstedde ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix b/nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix
new file mode 100644
index 000000000000..68c71ab59be1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, p4est-withMetis ? true, metis
+, p4est-sc
+}:
+
+let
+  inherit (p4est-sc) debugEnable mpiSupport;
+  dbg = if debugEnable then "-dbg" else "";
+  withMetis = p4est-withMetis;
+in
+stdenv.mkDerivation {
+  pname = "p4est${dbg}";
+  version = "unstable-2021-06-22";
+
+  # fetch an untagged snapshot of the prev3-develop branch
+  src = fetchFromGitHub {
+    owner = "cburstedde";
+    repo = "p4est";
+    rev = "7423ac5f2b2b64490a7a92e5ddcbd251053c4dee";
+    sha256 = "0vffnf48rzw6d0as4c3x1f31b4kapmdzr1hfj5rz5ngah72gqrph";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  propagatedBuildInputs = [ p4est-sc ];
+  buildInputs = lib.optional withMetis metis;
+  inherit debugEnable mpiSupport withMetis;
+
+  patches = [ ./p4est-metis.patch ];
+  postPatch = ''
+    sed -i -e "s:\(^\s*ACLOCAL_AMFLAGS.*\)\s@P4EST_SC_AMFLAGS@\s*$:\1 -I ${p4est-sc}/share/aclocal:" Makefile.am
+  '';
+  preConfigure = ''
+    echo "2.8.0" > .tarball-version
+    ${if mpiSupport then "unset CC" else ""}
+  '';
+
+  configureFlags = p4est-sc.configureFlags
+    ++ [ "--with-sc=${p4est-sc}" ]
+    ++ lib.optional withMetis "--with-metis"
+  ;
+
+  inherit (p4est-sc) makeFlags dontDisableStatic enableParallelBuilding preCheck doCheck;
+
+  meta = {
+    branch = "prev3-develop";
+    description = "Parallel AMR on Forests of Octrees";
+    longDescription = ''
+      The p4est software library provides algorithms for parallel AMR.
+      AMR refers to Adaptive Mesh Refinement, a technique in scientific
+      computing to cover the domain of a simulation with an adaptive mesh.
+    '';
+    homepage = "https://www.p4est.org/";
+    downloadPage = "https://github.com/cburstedde/p4est.git";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [ lib.maintainers.cburstedde ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch b/nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch
new file mode 100644
index 000000000000..46b8dc8af08c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch
@@ -0,0 +1,26 @@
+diff --git a/src/p4est_connectivity.c b/src/p4est_connectivity.c
+index 95339136..c93528f2 100644
+--- a/src/p4est_connectivity.c
++++ b/src/p4est_connectivity.c
+@@ -3715,6 +3715,7 @@ p4est_connectivity_reorder_newid (sc_MPI_Comm comm, int k,
+                                   sc_array_t * newid)
+ {
+   const int           n = (int) conn->num_trees;
++  int                 metis_n;
+   int                *xadj;
+   int                *adjncy;
+   int                *part;
+@@ -3862,10 +3863,12 @@ p4est_connectivity_reorder_newid (sc_MPI_Comm comm, int k,
+ 
+     P4EST_GLOBAL_INFO ("Entering metis\n");
+     /* now call metis */
++    metis_n = n;
+     P4EST_EXECUTE_ASSERT_INT
+-      (METIS_PartGraphRecursive (&n, &ncon, xadj, adjncy, NULL, NULL,
++      (METIS_PartGraphRecursive (&metis_n, &ncon, xadj, adjncy, NULL, NULL,
+                                  NULL, &k, NULL, NULL, NULL, &volume, part),
+        METIS_OK);
++    P4EST_ASSERT (metis_n == n);
+     P4EST_GLOBAL_INFO ("Done metis\n");
+ 
+     P4EST_GLOBAL_STATISTICSF ("metis volume %d\n", volume);