about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/science
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-22 10:43:06 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-11 16:17:56 +0000
commitca1aada113c0ebda1ab8667199f6453f8e01c4fc (patch)
tree55e402280096f62eb0bc8bcad5ce6050c5a0aec7 /nixpkgs/pkgs/development/libraries/science
parente4df5a52a6a6531f32626f57205356a773ac2975 (diff)
parent93883402a445ad467320925a0a5dbe43a949f25b (diff)
downloadnixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.gz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.bz2
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.lz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.xz
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.tar.zst
nixlib-ca1aada113c0ebda1ab8667199f6453f8e01c4fc.zip
Merge commit '93883402a445ad467320925a0a5dbe43a949f25b'
Conflicts:
	nixpkgs/nixos/modules/programs/ssh.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/data/fonts/noto-fonts/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/libraries/mesa/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/science')
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix1
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix92
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch113
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/metis/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/primecount/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/trilinos/default.nix100
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix2
22 files changed, 259 insertions, 255 deletions
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix
index 2ac1ba9536f6..60f5e51ae957 100644
--- a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix
@@ -15,13 +15,13 @@
 
 stdenv.mkDerivation rec {
   pname = "indilib";
-  version = "1.9.3";
+  version = "1.9.4";
 
   src = fetchFromGitHub {
     owner = "indilib";
     repo = "indi";
     rev = "v${version}";
-    sha256 = "sha256-Ik62kbOetA2vSMpnwrSiNRNJqOgmqlCB2+KNhpBo9TA=";
+    sha256 = "sha256-U3Q0WUEDRn0zfBIdHXFp5Zcaf+M6HrSFnpeu5aAkjks=";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix
index 191751993c3a..a214d28347de 100644
--- a/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix
@@ -3,13 +3,13 @@
 
 mkDerivation rec {
   pname = "stellarsolver";
-  version = "1.8";
+  version = "1.9";
 
   src = fetchFromGitHub {
     owner = "rlancaste";
     repo = pname;
     rev = version;
-    sha256 = "sha256-eC45V0aqFSUVJrxhaEXFzgzaXkHVwA5Yj8YyGvii0QI=";
+    sha256 = "sha256-PiRXNiemJ+UjVhmd2KPcTKJoDW9K9QBf62nkP1LlOfw=";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -25,6 +25,6 @@ mkDerivation rec {
     description = "Astrometric plate solving library";
     license = licenses.gpl3Plus;
     maintainers = with maintainers; [ hjones2199 ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
index 52822baca631..8a9df7601d28 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "htslib";
-  version = "1.13";
+  version = "1.14";
 
   src = fetchurl {
     url = "https://github.com/samtools/htslib/releases/download/${version}/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-8kB9+fl/C7awdlZXnkGhylEARkBntrIb+WKi6ksO/WU=";
+    sha256 = "sha256-7SIbj1L0gS+BDuvgzFbNg1WlydIcYtFCrAWtDaFHk18=";
   };
 
   # perl is only used during the check phase.
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix
index 3d4d4c21e5a1..663d61494c76 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix
@@ -1,60 +1,77 @@
-{ callPackage, cudatoolkit_10_0, cudatoolkit_10_1, cudatoolkit_10_2, cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2
-, cudatoolkit_11_3, cudatoolkit_11_4
+# The following version combinations are supported:
+#  * cuDNN 7.4.2, cudatoolkit 10.0
+#  * cuDNN 7.6.5, cudatoolkit 10.2
+#  * cuDNN 8.1.1, cudatoolkit 11.0-11.2
+#  * cuDNN 8.3.0, cudatoolkit 11.0-11.5
+{ callPackage
+, cudatoolkit_10_0
+, cudatoolkit_10_2
+, cudatoolkit_11_0
+, cudatoolkit_11_1
+, cudatoolkit_11_2
+, cudatoolkit_11_3
+, cudatoolkit_11_4
+, cudatoolkit_11_5
 }:
 
 let
-  generic = args: callPackage (import ./generic.nix (removeAttrs args ["cudatoolkit"])) {
+  generic = args: callPackage (import ./generic.nix (removeAttrs args [ "cudatoolkit" ])) {
     inherit (args) cudatoolkit;
   };
-
-in rec {
-  cudnn_cudatoolkit_10_0 = generic rec {
+in
+rec {
+  # cuDNN 7.x
+  # Still used by libtensorflow-bin. It should be upgraded at some point.
+  cudnn_7_4_cudatoolkit_10_0 = generic rec {
     version = "7.4.2";
     cudatoolkit = cudatoolkit_10_0;
     srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.4.2.24.tgz";
     sha256 = "18ys0apiz9afid2s6lvy9qbyi8g66aimb2a7ikl1f3dm09mciprf";
   };
 
-  cudnn_cudatoolkit_10_1 = generic rec {
-    version = "7.6.3";
-    cudatoolkit = cudatoolkit_10_1;
-    srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.6.3.30.tgz";
-    sha256 = "0qc9f1xpyfibwqrpqxxq2v9h6w90j0dbx564akwy44c1dls5f99m";
-  };
-
-  cudnn_cudatoolkit_10_2 = generic rec {
+  # The `cudnn` alias still points to this in all-packages.nix. It should be
+  # upgraded at some point.
+  cudnn_7_6_cudatoolkit_10_2 = generic rec {
     version = "7.6.5";
     cudatoolkit = cudatoolkit_10_2;
     srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.6.5.32.tgz";
     sha256 = "084c13vzjdkb5s1996yilybg6dgav1lscjr1xdcgvlmfrbr6f0k0";
   };
 
-  cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_2;
+  cudnn_7_6_cudatoolkit_10 = cudnn_7_6_cudatoolkit_10_2;
 
-  cudnn_cudatoolkit_11_0 = generic rec {
+  # cuDNN 8.x
+  # cuDNN 8.1 is still used by tensorflow at the time of writing (2022-02-17).
+  # See https://github.com/NixOS/nixpkgs/pull/158218 for more info.
+  cudnn_8_1_cudatoolkit_11_0 = generic rec {
     version = "8.1.1";
     cudatoolkit = cudatoolkit_11_0;
-    # 8.1.0 is compatible with CUDA 11.0, 11.1, and 11.2:
-    # https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html#cudnn-cuda-hardware-versions
+    # 8.1.0 is compatible with CUDA 11.0-11.2:
+    # https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-811/support-matrix/index.html
     srcName = "cudnn-11.2-linux-x64-v8.1.1.33.tgz";
     hash = "sha256-mKh4TpKGLyABjSDCgbMNSgzZUfk2lPZDPM9K6cUCumo=";
   };
+  cudnn_8_1_cudatoolkit_11_1 = cudnn_8_1_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_1; };
+  cudnn_8_1_cudatoolkit_11_2 = cudnn_8_1_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_2; };
+  cudnn_8_1_cudatoolkit_11 = cudnn_8_1_cudatoolkit_11_2;
 
-  cudnn_cudatoolkit_11_1 = cudnn_cudatoolkit_11_0.override {
-    cudatoolkit = cudatoolkit_11_1;
-  };
-
-  cudnn_cudatoolkit_11_2 = cudnn_cudatoolkit_11_0.override {
-    cudatoolkit = cudatoolkit_11_2;
-  };
-
-  cudnn_cudatoolkit_11_3 = cudnn_cudatoolkit_11_0.override {
-    cudatoolkit = cudatoolkit_11_3;
-  };
-
-  cudnn_cudatoolkit_11_4 = cudnn_cudatoolkit_11_0.override {
-    cudatoolkit = cudatoolkit_11_4;
+  # cuDNN 8.3 is necessary for the latest jaxlib, esp. jaxlib-bin. See
+  # https://github.com/google/jax/discussions/9455 for more info.
+  cudnn_8_3_cudatoolkit_11_0 = generic rec {
+    # 8.3.0 is the last version to respect the folder structure that generic.nix
+    # expects. Later versions have files in a subdirectory `local_installers`.
+    # See eg https://developer.download.nvidia.com/compute/redist/cudnn/v8.3.1/.
+    version = "8.3.0";
+    cudatoolkit = cudatoolkit_11_0;
+    # 8.3.0 is compatible with CUDA 11.0-11.5:
+    # https://docs.nvidia.com/deeplearning/cudnn/archives/cudnn-830/support-matrix/index.html
+    srcName = "cudnn-11.5-linux-x64-v8.3.0.98.tgz";
+    hash = "sha256-RMb1rVyxL7dPoMmh58qvTwTXVa3xGi5bbJ5BfaN2srI=";
   };
-
-  cudnn_cudatoolkit_11 = cudnn_cudatoolkit_11_4;
+  cudnn_8_3_cudatoolkit_11_1 = cudnn_8_3_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_1; };
+  cudnn_8_3_cudatoolkit_11_2 = cudnn_8_3_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_2; };
+  cudnn_8_3_cudatoolkit_11_3 = cudnn_8_3_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_3; };
+  cudnn_8_3_cudatoolkit_11_4 = cudnn_8_3_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_4; };
+  cudnn_8_3_cudatoolkit_11_5 = cudnn_8_3_cudatoolkit_11_0.override { cudatoolkit = cudatoolkit_11_5; };
+  cudnn_8_3_cudatoolkit_11 = cudnn_8_3_cudatoolkit_11_5;
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
index f5a4fac1a908..13fc0b679970 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
@@ -35,12 +35,15 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ addOpenGLRunpath ];
 
+  # Some cuDNN libraries depend on things in cudatoolkit, eg.
+  # libcudnn_ops_infer.so.8 tries to load libcublas.so.11. So we need to patch
+  # cudatoolkit into RPATH. See also https://github.com/NixOS/nixpkgs/blob/88a2ad974692a5c3638fcdc2c772e5770f3f7b21/pkgs/development/python-modules/jaxlib/bin.nix#L78-L98.
   installPhase = ''
     runHook preInstall
 
     function fixRunPath {
       p=$(patchelf --print-rpath $1)
-      patchelf --set-rpath "''${p:+$p:}${lib.makeLibraryPath [ stdenv.cc.cc ]}:\$ORIGIN/" $1
+      patchelf --set-rpath "''${p:+$p:}${lib.makeLibraryPath [ stdenv.cc.cc cudatoolkit.lib ]}:${cudatoolkit}/lib:\$ORIGIN/" $1
     }
 
     for lib in lib64/lib*.so; do
diff --git a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
index e80607ab9556..2690d544c2c8 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
@@ -26,10 +26,20 @@
 , zlib
 , blas
 , lapack
+, nixosTests
 }:
 let
   version = "2019.1.0";
 
+  # TODO: test with newer pytest
+  pytest = pythonPackages.callPackage
+    ../../../../python2-modules/pytest {
+      # hypothesis tests require pytest that causes dependency cycle
+      hypothesis = pythonPackages.hypothesis.override {
+        doCheck = false;
+      };
+    };
+
   dijitso = pythonPackages.buildPythonPackage {
     pname = "dijitso";
     inherit version;
@@ -251,6 +261,7 @@ let
       pythonPackages.pybind11
     ];
     doCheck = false; # Tries to orte_ess_init and call ssh to localhost
+    passthru.tests = { inherit (nixosTests) fenics; };
     meta = {
       description = "Python bindings for the DOLFIN FEM compiler";
       homepage = "https://fenicsproject.org/";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
index 88560e0cd983..d7a0dcfe06a7 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
@@ -49,5 +49,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl3;
     platforms = platforms.unix;
     maintainers = with maintainers; [ andrew-d ];
+    broken = stdenv.isDarwin; # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/itpp.x86_64-darwin
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
index 3f0cf45062f1..b1896917658c 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
@@ -1,94 +1,38 @@
 { lib, stdenv
-, fetchurl
-, fetchpatch
+, autoreconfHook
+, gengetopt
+, pkg-config
+, fetchFromGitLab
 , pari
 }:
 
 stdenv.mkDerivation rec {
-  version = "1.23";
+  version = "2.0.5";
   pname = "lcalc";
 
-  src = fetchurl {
-    # original at http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/L-${version}.tar.gz, no longer available
-    # "newer" version at google code https://code.google.com/archive/p/l-calc/source/default/source
-    url = "mirror://sageupstream/lcalc/lcalc-${version}.tar.bz2";
-    sha256 = "1c6dsdshgxhqppjxvxhp8yhpxaqvnz3d1mlh26r571gkq8z2bm43";
+  src = fetchFromGitLab {
+    owner = "sagemath";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-RxWZ7T0I9zV7jUVnL6jV/PxEoU32KY7Q1UsOL5Lonuc=";
   };
 
-  preConfigure = "cd src";
+  nativeBuildInputs = [
+    autoreconfHook
+    gengetopt
+    pkg-config
+  ];
 
   buildInputs = [
     pari
   ];
 
-  patches = [
-    # Port to newer pari
-    (fetchpatch {
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/pari-2.7.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
-      sha256 = "1x3aslldm8njjm7p9g9s9w2c91kphnci2vpkxkrcxfihw3ayss6c";
-    })
-
-    # Uncomment the definition of lcalc_to_double(const long double& x).
-    # (Necessary for GCC >= 4.6.0, cf. https://trac.sagemath.org/ticket/10892)
-    (fetchpatch {
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/Lcommon.h.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
-      sha256 = "0g4ybvsrcv48rmlh1xjnkms19jp25k58azv6ds1f2cm34hxs8fdx";
-    })
-
-    # Include also <time.h> in Lcommandline_numbertheory.h (at least required
-    # on Cygwin, cf. https://trac.sagemath.org/ticket/9845)
-    (fetchpatch {
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/time.h.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
-      sha256 = "1brf04n11kkc43ylagf8dm32j5r2g9zv51dp5wag1mpm4p04l7cl";
-    })
-
-    # Fix for gcc >4.6
-    (fetchpatch {
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/lcalc-1.23_default_parameters_1.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
-      sha256 = "0i2yvxm5fx4z0v6m4srgh8rj98kijmlvyirlxf1ky0bp2si6bpka";
-    })
-
-    # gcc 5.1
-    (fetchpatch {
-      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/lcalc-1.23_default_parameters_2.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
-      sha256 = "0dqwmxpm9wb53qbypsyfkgsvk2f8nf67sydphd4dkc2vw4yz6vlh";
-    })
-
-    # based on gentoos makefile patch -- fix paths, adhere to flags
-    ./makefile.patch
-
-    # (fetchpatch {
-    #   name = "default-double.patch";
-    #   url = "https://github.com/dimpase/lcalc/pull/1/commits/0500c67b6aa1f492715591669f6647c8f7a3ea59.patch";
-    #   sha256 = "0dqwmxpm9wb53qbypsyfkgsvk2f8nf67sydphd4dkc2vw4yz6vla";
-    # })
-
-    (fetchpatch {
-      name = "c++11.patch";
-      url = "https://raw.githubusercontent.com/archlinux/svntogit-community/3607b97df5a8c231191115b0cb5c62426b339e71/trunk/lcalc-c++11.patch";
-      sha256 = "1ccrl61lv2vvx8ggldq54m5d0n1iy6mym7qz0i8nj6yj0dshnpk3";
-    })
-  ] ++ lib.optional stdenv.isDarwin
-  (fetchpatch {
-    url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/clang.patch";
-    sha256 = "0bb7656z6cp6i4p2qj745cmq0lhh52v2akl9whi760dynfdxbl18";
-  });
-
-  postPatch = lib.optionalString stdenv.isDarwin ''
-    substituteInPlace src/Makefile --replace g++ c++
-  '';
-
-  installFlags = [
-    "DESTDIR=$(out)"
-  ];
-
-  makeFlags = [
-    "PARI_DEFINE=-DINCLUDE_PARI"
-    "PARI_PREFIX=${pari}"
+  configureFlags = [
+    "--with-pari"
   ];
 
   meta = with lib; {
-    homepage = "http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html";
+    homepage = "https://gitlab.com/sagemath/lcalc";
     description = "A program for calculating with L-functions";
     license = with licenses; [ gpl2 ];
     maintainers = teams.sage.members;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch b/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
deleted file mode 100644
index 5c22cf0b84e8..000000000000
--- a/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-diff --git a/src/Makefile b/src/Makefile
-index 84e4e88..56ca676 100644
---- a/src/Makefile
-+++ b/src/Makefile
-@@ -58,7 +58,7 @@ ifeq ($(G5),TRUE)
-    #MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m64
- endif
- 
--CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
-+CCFLAGS = $(CXXFLAGS) $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS)
- #CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG)  $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
- #CCFLAGS =  -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
- 
-@@ -68,12 +68,12 @@ CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MA
- 
- ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
-     #location of pari.h.
--    LOCATION_PARI_H = /usr/local/include/pari #usual location
-+    LOCATION_PARI_H = $(PARI_PREFIX)/include/pari #usual location
- 
-     #location of libpari.a or of libpari.so
-     #depending on whether static or dynamic libraries are being used.
-     #On mac os x it's the former, on linux I think usually the latter.
--    LOCATION_PARI_LIBRARY = /usr/local/lib #usual location
-+    LOCATION_PARI_LIBRARY = $(PARI_PREFIX)/lib #usual location
- else
-     #supplied as a dummy so as to avoid more ifeq's below
-     LOCATION_PARI_H = .
-@@ -89,24 +89,24 @@ INCLUDEFILES= -I../include
- 
- ifeq ($(OS_NAME),Darwin)
-     LDFLAGS2 =
--    DYN_OPTION=dynamiclib
-+    DYN_OPTION=-dynamiclib
- else
--    LDFLAGS1 = -Xlinker -export-dynamic #not sure why pari calls these when linking but on the web I found
-+    LDFLAGS1 = #not sure why pari calls these when linking but on the web I found
-     #'Libtool provides the `-export-dynamic' link flag (see section Link mode), which does this declaration.
-     #You need to use this flag if you are linking a shared library that will be dlopened'
-     #see notes below
-     #ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
--       LDFLAGS2 = $(LDFLAGS1) -Xlinker -rpath -Xlinker $(LOCATION_PARI_LIBRARY)
-+       LDFLAGS2 = $(LDFLAGS)
-     #else
-     #    LDFLAGS2 = $(LDFLAGS1)
-     #endif
--    DYN_OPTION=shared
-+    DYN_OPTION=$(LDFLAGS) -shared -Wl,-soname,libLfunction.so
- endif
- 
- ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
--    LDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
-+    MYLDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
- else
--    LDFLAGS = $(LDFLAGS2)
-+    MYLDFLAGS = $(LDFLAGS2)
- endif
- 
- 
-@@ -129,7 +129,8 @@ endif
- #become clear which libraries the computer can find.
- 
- 
--INSTALL_DIR= /usr/local
-+INSTALL_DIR= $(DESTDIR)
-+LIB_DIR ?=lib
- 
- #object files for the libLfunction library
- OBJ_L = Lglobals.o Lgamma.o Lriemannsiegel.o Lriemannsiegel_blfi.o Ldokchitser.o
-@@ -141,9 +142,8 @@ OBJECTS = $(OBJ3)
- 
- all:
- #	make print_vars
--	make libLfunction.so
--	make lcalc
--	make examples
-+	${MAKE} libLfunction.so
-+	${MAKE} lcalc
- #	make find_L
- #	make test
- 
-@@ -151,7 +151,7 @@ print_vars:
- 	@echo OS_NAME = $(OS_NAME)
- 
- lcalc: $(OBJECTS)
--	$(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)
-+	$(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(MYLDFLAGS) -o lcalc $(GMP_FLAGS)
- 
- examples:
- 	$(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.so -o example_programs/example $(GMP_FLAGS)
-@@ -262,15 +262,18 @@ Lcommandline.o: ../include/Lcommandline_values_zeros.h
- 
- 
- libLfunction.so: $(OBJ_L)
--	g++ -$(DYN_OPTION)  -o libLfunction.so $(OBJ_L)
-+	g++ $(DYN_OPTION) -o libLfunction.so $(OBJ_L)
- 
- clean:
- 	rm -f *.o lcalc libLfunction.so example_programs/example
- 
- install:
--	cp -f lcalc $(INSTALL_DIR)/bin/.
--	cp -f libLfunction.so $(INSTALL_DIR)/lib/.
--	cp -rf ../include $(INSTALL_DIR)/include/Lfunction
-+	install -d $(INSTALL_DIR)/bin
-+	install -d $(INSTALL_DIR)/$(LIB_DIR)
-+	install -d $(INSTALL_DIR)/include/Lfunction
-+	install lcalc $(INSTALL_DIR)/bin
-+	install libLfunction.so $(INSTALL_DIR)/$(LIB_DIR)
-+	install -m 644 -t $(INSTALL_DIR)/include/Lfunction ../include/*.h
- 
- 
- SRCS = Lcommandline.cc Lcommandline_elliptic.cc Lcommandline_globals.cc Lcommandline_misc.cc Lcommandline_numbertheory.cc Lcommandline_twist.cc Lcommandline_values_zeros.cc Lgamma.cc Lglobals.cc Lmisc.cc Lriemannsiegel.cc Lriemannsiegel_blfi.cc cmdline.c
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix b/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
index b756109aa8fc..d0f09290c3c7 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
@@ -5,14 +5,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "1.02r5";
-  pname = "llibhomfly";
+  version = "1.02r6";
+  pname = "libhomfly";
 
   src = fetchFromGitHub {
     owner = "miguelmarco";
     repo = "libhomfly";
     rev = version;
-    sha256 = "1szv8iwlhvmy3saigi15xz8vgch92p2lbsm6440v5s8vxj455bvd";
+    sha256 = "sha256-s1Hgy6S9+uREKsgjOVQdQfnds6oSLo5UWTrt5DJnY2s=";
   };
 
   buildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
index f81a02303a60..f2a50cb2d3d4 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , gfortran
 , cmake
 , shared ? true
@@ -17,6 +18,14 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-ewYUM+M7jDO5LLnB4joiKkqgXjEDmWbFZbgad8x98gc=";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "CVE-2021-4048.patch";
+      url = "https://github.com/Reference-LAPACK/lapack/commit/0631b6beaed60ba118b0b027c0f8d35397bf5df0.patch";
+      sha256 = "1bqjw3f6ak9iz97y7ckn0rrfcgrzbn9prgfasl489qpxgzp2kjh8";
+    })
+  ];
+
   nativeBuildInputs = [ gfortran cmake ];
 
   # Configure stage fails on aarch64-darwin otherwise, due to either clang 11 or gfortran 10.
diff --git a/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
index da79f6d62499..41deec25d454 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchurl, unzip, cmake }:
 
 stdenv.mkDerivation rec {
-  name = "metis";
+  pname = "metis";
   version = "5.1.0";
 
   src = fetchurl {
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
index 0fc00efcff0a..d61b6ee3acb0 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
@@ -129,7 +129,7 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "openblas";
-  version = "0.3.18";
+  version = "0.3.19";
 
   outputs = [ "out" "dev" ];
 
@@ -137,7 +137,7 @@ stdenv.mkDerivation rec {
     owner = "xianyi";
     repo = "OpenBLAS";
     rev = "v${version}";
-    sha256 = "sha256-b5i52rjsH65qAIlYGXQrzVxChi8/fwbD4eJTrxVq7Z8=";
+    sha256 = "sha256-EqA6oFM2theuvvuDOWeOx0Bv6AEFffmpWHJBzp23br0=";
   };
 
   inherit blas64;
@@ -208,15 +208,21 @@ EOF
     done
 
     # Setup symlinks for blas / lapack
+  '' + lib.optionalString enableShared ''
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}
-  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
+  '' + lib.optionalString (stdenv.hostPlatform.isLinux && enableShared) ''
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}.3
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}.3
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}.3
     ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}.3
+  '' + lib.optionalString enableStatic ''
+    ln -s $out/lib/libopenblas.a $out/lib/libblas.a
+    ln -s $out/lib/libopenblas.a $out/lib/libcblas.a
+    ln -s $out/lib/libopenblas.a $out/lib/liblapack.a
+    ln -s $out/lib/libopenblas.a $out/lib/liblapacke.a
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
index 84c01d80d0a6..21c7d45a9099 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "openlibm";
-  version = "0.8.0";
+  version = "0.8.1";
 
   src = fetchFromGitHub {
     owner = "JuliaLang";
     repo = "openlibm";
     rev = "v${version}";
-    sha256 = "sha256-dEM10picZXiPokzSHCfxhS7fwZ0sMjil4bni+PHBCeI=";
+    sha256 = "sha256-q7BYUU8oChjuBFbVnpT+vqIAu+BVotT4xY2Dn0hmWfc=";
   };
 
   makeFlags = [ "prefix=$(out)" ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
index e9ca9b849462..4a4208e1cbe4 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
@@ -18,11 +18,11 @@ assert petsc-withp4est -> p4est.mpiSupport;
 
 stdenv.mkDerivation rec {
   pname = "petsc";
-  version = "3.16.2";
+  version = "3.16.4";
 
   src = fetchurl {
     url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${version}.tar.gz";
-    sha256 = "sha256-erJXrhUNSDesjThyodIGmXliV4eF7CQnY5zqxG0TG7w=";
+    sha256 = "sha256-IpzOIr3P7bH+gn0wbtGvypc3eGzcPwVit0oZZsEkPK8=";
   };
 
   mpiSupport = !withp4est || p4est.mpiSupport;
@@ -74,6 +74,6 @@ stdenv.mkDerivation rec {
     description = "Portable Extensible Toolkit for Scientific computation";
     homepage = "https://www.mcs.anl.gov/petsc/index.html";
     license = licenses.bsd2;
-    maintainers = with maintainers; [ wucke13 cburstedde ];
+    maintainers = with maintainers; [ cburstedde ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/primecount/default.nix b/nixpkgs/pkgs/development/libraries/science/math/primecount/default.nix
index 7985b9d6dbd6..e1390ce6416e 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/primecount/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/primecount/default.nix
@@ -15,6 +15,14 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-/Cb/HkD4UQ9gXsRpvRiEuQBoRd0THxNHsBaAAa+CqQo=";
   };
 
+  cmakeFlags = [
+    "-DBUILD_STATIC_LIBS=OFF"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_TESTS=ON"
+    "-DBUILD_PRIMECOUNT=ON"
+    "-DBUILD_LIBPRIMESIEVE=ON"
+  ];
+
   meta = with lib; {
     description = "Fast prime counting function implementations";
     homepage = "https://github.com/kimwalisch/primecount";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
index 2367b373b1c5..0cf263218a3b 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "primesieve";
-  version = "7.7";
+  version = "7.8";
 
   nativeBuildInputs = [ cmake ];
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     owner = "kimwalisch";
     repo = "primesieve";
     rev = "v${version}";
-    sha256 = "sha256-1Gfo00yaf7zHzCLfu/abWqeM0qBuLu+f+lowFFnWFxY=";
+    sha256 = "sha256-M35CP/xEyC7mEh84kaGsgfsDI9fnanHraNPgTvpqimI=";
   };
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
index 3b1fb98a42ea..9a7374f4f49c 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
@@ -1,22 +1,36 @@
 { lib, stdenv, fetchFromGitHub, cmake, openssh
-, gfortran, mpi, blas, lapack
+, mpi, blas, lapack
 } :
 
-assert (!blas.isILP64) && (!lapack.isILP64);
+assert blas.isILP64 == lapack.isILP64;
 
 stdenv.mkDerivation rec {
   pname = "scalapack";
-  version = "2.1.0";
+  version = "2.2.0";
 
   src = fetchFromGitHub {
     owner = "Reference-ScaLAPACK";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1c10d18gj3kvpmyv5q246x35hjxaqn4ygy1cygaydhyxnm4klzdj";
+    sha256 = "0hiap5i9ik6xpvl721n2slanlqygagc1pg2bcjb27ans6balhsfh";
   };
 
-  nativeBuildInputs = [ cmake openssh gfortran ];
-  buildInputs = [ mpi blas lapack ];
+  passthru = { inherit (blas) isILP64; };
+
+  # Required to activate ILP64.
+  # See https://github.com/Reference-ScaLAPACK/scalapack/pull/19
+  postPatch = lib.optionalString passthru.isILP64 ''
+    sed -i 's/INTSZ = 4/INTSZ = 8/g'   TESTING/EIG/* TESTING/LIN/*
+    sed -i 's/INTGSZ = 4/INTGSZ = 8/g' TESTING/EIG/* TESTING/LIN/*
+
+    # These tests are not adapted to ILP64
+    sed -i '/xssep/d;/xsgsep/d;/xssyevr/d' TESTING/CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  checkInputs = [ openssh ];
+  buildInputs = [ blas lapack ];
+  propagatedBuildInputs = [ mpi ];
 
   doCheck = true;
 
@@ -25,6 +39,11 @@ stdenv.mkDerivation rec {
       -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
       -DLAPACK_LIBRARIES="-llapack"
       -DBLAS_LIBRARIES="-lblas"
+      -DCMAKE_Fortran_COMPILER=${mpi}/bin/mpif90
+      ${lib.optionalString passthru.isILP64 ''
+        -DCMAKE_Fortran_FLAGS="-fdefault-integer-8"
+        -DCMAKE_C_FLAGS="-DInt=long"
+      ''}
       )
   '';
 
@@ -52,5 +71,4 @@ stdenv.mkDerivation rec {
     platforms = [ "x86_64-linux" ];
     maintainers = with maintainers; [ costrouc markuskowa ];
   };
-
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
index 10ea82f93d26..a945e99ec9cb 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
@@ -4,13 +4,13 @@ assert (!blas.isILP64) && (!lapack.isILP64);
 
 stdenv.mkDerivation rec {
   pname = "scs";
-  version = "3.0.0";
+  version = "3.1.0";
 
   src = fetchFromGitHub {
     owner = "cvxgrp";
     repo = "scs";
     rev = version;
-    sha256 = "sha256-Lly28KDDZ5hJyiMOhiX/3VaKs0iPcSqizOurZevhfCo=";
+    sha256 = "sha256-yoh25DmvY7fohAvABCiSLkvr7TskGd0ED2K3rIa/IeM=";
   };
 
   # Actually link and add libgfortran to the rpath
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
index 151a0eef8916..4c0059184ee3 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
@@ -6,7 +6,7 @@
 
 stdenv.mkDerivation rec {
   pname = "suitesparse-graphblas";
-  version = "4.0.3";
+  version = "6.1.4";
 
   outputs = [ "out" "dev" ];
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     owner = "DrTimothyAldenDavis";
     repo = "GraphBLAS";
     rev = "v${version}";
-    sha256 = "sha256-Bf3+w/kQtFpeUGp2zWVqja535EbaUw7DbhCw54B6A8k=";
+    sha256 = "sha256-pjb4Q9b+5hcI0ZYoez46V/ve4+1GJORu2ZGweceaWDY=";
   };
 
   nativeBuildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/science/math/trilinos/default.nix b/nixpkgs/pkgs/development/libraries/science/math/trilinos/default.nix
new file mode 100644
index 000000000000..19d2119622e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/trilinos/default.nix
@@ -0,0 +1,100 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, blas
+, boost
+, cmake
+, gfortran
+, lapack
+, mpi
+, suitesparse
+, swig
+, withMPI ? false
+}:
+
+# NOTE: Not all packages are enabled.  We specifically enable the ones
+# required to build Xyce. If the need comes, we can enable more of them.
+
+let
+  flagsBase = ''
+    -G "Unix Makefiles"
+    -DBUILD_SHARED_LIBS=ON
+    -DCMAKE_CXX_FLAGS="-O3 -fPIC"
+    -DCMAKE_C_FLAGS="-O3 -fPIC"
+    -DCMAKE_Fortran_FLAGS="-O3 -fPIC"
+    -DTrilinos_ENABLE_NOX=ON
+    -DNOX_ENABLE_LOCA=ON
+    -DTrilinos_ENABLE_EpetraExt=ON
+    -DEpetraExt_BUILD_BTF=ON
+    -DEpetraExt_BUILD_EXPERIMENTAL=ON
+    -DEpetraExt_BUILD_GRAPH_REORDERINGS=ON
+    -DTrilinos_ENABLE_TrilinosCouplings=ON
+    -DTrilinos_ENABLE_Ifpack=ON
+    -DTrilinos_ENABLE_AztecOO=ON
+    -DTrilinos_ENABLE_Belos=ON
+    -DTrilinos_ENABLE_Teuchos=ON
+    -DTeuchos_ENABLE_COMPLEX=ON
+    -DTrilinos_ENABLE_Amesos=ON
+    -DAmesos_ENABLE_KLU=ON
+    -DTrilinos_ENABLE_Amesos2=ON
+    -DAmesos2_ENABLE_KLU2=ON
+    -DAmesos2_ENABLE_Basker=ON
+    -DTrilinos_ENABLE_Sacado=ON
+    -DTrilinos_ENABLE_Stokhos=ON
+    -DTrilinos_ENABLE_Kokkos=ON
+    -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF
+    -DTrilinos_ENABLE_CXX11=ON
+    -DTPL_ENABLE_AMD=ON
+    -DTPL_ENABLE_BLAS=ON
+    -DTPL_ENABLE_LAPACK=ON
+  '';
+  flagsParallel = ''
+    -DCMAKE_C_COMPILER=mpicc
+    -DCMAKE_CXX_COMPILER=mpic++
+    -DCMAKE_Fortran_COMPILER=mpif77
+    -DTrilinos_ENABLE_Isorropia=ON
+    -DTrilinos_ENABLE_Zoltan=ON
+    -DTPL_ENABLE_MPI=ON
+  '';
+in
+stdenv.mkDerivation rec {
+  pname = "trilinos";
+  version = "12.12.1"; # Xyce 7.4 requires version 12.12.1
+
+  src = fetchFromGitHub {
+    owner = "trilinos";
+    repo = "Trilinos";
+    rev = "${pname}-release-${lib.replaceStrings [ "." ] [ "-" ] version}";
+    sha256 = "sha256-Nqjr7RAlUHm6vs87a1P84Y7BIZEL0Vs/A1Z6dykfv+o=";
+  };
+
+  nativeBuildInputs = [ cmake gfortran swig ];
+
+  buildInputs = [ blas boost lapack suitesparse ] ++ lib.optionals withMPI [ mpi ];
+
+  preConfigure =
+    if withMPI then ''
+      cmakeFlagsArray+=(${flagsBase} ${flagsParallel})
+    ''
+    else ''
+      cmakeFlagsArray+=(${flagsBase})
+    '';
+
+  passthru = {
+    inherit withMPI;
+  };
+
+  meta = with lib; {
+    description = "Engineering and scientific problems algorithms";
+    longDescription = ''
+      The Trilinos Project is an effort to develop algorithms and enabling
+      technologies within an object-oriented software framework for the
+      solution of large-scale, complex multi-physics engineering and scientific
+      problems.
+    '';
+    homepage = "https://trilinos.org";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fbeffa ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix b/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix
index 8f3e1aba350e..38d5d91e0837 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with lib; {
-    homepage = "http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/";
+    homepage = "https://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/";
     description = "Polynomial arithmetic over Z/nZ";
     license = with licenses; [ gpl3 ];
     maintainers = teams.sage.members;