Loading pkgs/by-name/pe/petsc/package.nix +44 −6 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ withHypre ? withCommonDeps && mpiSupport, withFftw ? withCommonDeps, withSuperLu ? withCommonDeps, withSuperLuDist ? withCommonDeps && mpiSupport, withSuitesparse ? withCommonDeps, # External libraries Loading @@ -52,10 +53,12 @@ hypre, fftw, superlu, superlu_dist, suitesparse, # Used in passthru.tests petsc, mpich, }: assert withFullDeps -> withCommonDeps; Loading @@ -69,10 +72,12 @@ assert withPtscotch -> (mpiSupport && withZlib); assert withScalapack -> mpiSupport; assert (withMumps && mpiSupport) -> withScalapack; assert withHypre -> mpiSupport; assert withSuperLuDist -> mpiSupport; let petscPackages = lib.makeScope newScope (self: { inherit mpi # global override options mpiSupport fortranSupport Loading @@ -83,7 +88,6 @@ let petscPackages = self; # external libraries mpi = self.callPackage mpi.override { }; blas = self.callPackage blas.override { }; lapack = self.callPackage lapack.override { }; hdf5 = self.callPackage hdf5.override { Loading @@ -99,6 +103,7 @@ let hypre = self.callPackage hypre.override { }; fftw = self.callPackage fftw.override { }; superlu = self.callPackage superlu.override { }; superlu_dist = self.callPackage superlu_dist.override { }; suitesparse = self.callPackage suitesparse.override { }; }); in Loading Loading @@ -141,6 +146,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withMumps petscPackages.mumps ++ lib.optional withHypre petscPackages.hypre ++ lib.optional withSuperLu petscPackages.superlu ++ lib.optional withSuperLuDist petscPackages.superlu_dist ++ lib.optional withFftw petscPackages.fftw ++ lib.optional withSuitesparse petscPackages.suitesparse; Loading @@ -161,16 +167,20 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--with-blas=1" "--with-lapack=1" "--with-blaslapack=1" "--with-scalar-type=${scalarType}" "--with-precision=${precision}" "--with-mpi=${if mpiSupport then "1" else "0"}" ] ++ lib.optionals (!mpiSupport) [ "--with-cc=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "gcc" else "clang"}" "--with-cxx=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "g++" else "clang++"}" "--with-fc=${gfortran}/bin/gfortran" ] ++ lib.optionals mpiSupport [ "--CC=mpicc" "--with-cxx=mpicxx" "--with-fc=mpif90" "--with-cc=${lib.getDev mpi}/bin/mpicc" "--with-cxx=${lib.getDev mpi}/bin/mpicxx" "--with-fc=${lib.getDev mpi}/bin/mpif90" ] ++ lib.optionals (!debug) [ "--with-debugging=0" Loading @@ -192,6 +202,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withHdf5 "--with-hdf5=1" ++ lib.optional withHypre "--with-hypre=1" ++ lib.optional withSuperLu "--with-superlu=1" ++ lib.optional withSuperLuDist "--with-superlu_dist=1" ++ lib.optional withFftw "--with-fftw=1" ++ lib.optional withSuitesparse "--with-suitesparse=1"; Loading @@ -204,6 +215,30 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; # Ensure petscvariables contains absolute paths for compilers and flags so that downstream # packages relying on PETSc's runtime configuration (e.g. form compilers, code generators) # can correctly compile and link generated code postInstall = lib.concatStringsSep "\n" ( map ( package: let pname = package.pname or package.name; prefix = if (pname == "blas" || pname == "lapack") then "BLASLAPACK" else lib.toUpper (builtins.elemAt (lib.splitString "-" pname) 0); in '' substituteInPlace $out/lib/petsc/conf/petscvariables \ --replace-fail "${prefix}_INCLUDE =" "${prefix}_INCLUDE = -I${lib.getDev package}/include" \ --replace-fail "${prefix}_LIB =" "${prefix}_LIB = -L${lib.getLib package}/lib" '' ) finalAttrs.buildInputs ); __darwinAllowLocalNetworking = true; # This is needed as the checks need to compile and link the test cases with # -lpetsc, which is not available in the checkPhase, which is executed before # the installPhase. The installCheckPhase comes after the installPhase, so Loading Loading @@ -255,6 +290,9 @@ stdenv.mkDerivation (finalAttrs: { withFullDeps = true; withParmetis = false; }; mpich = petsc.override { mpi = mpich; }; }; }; Loading pkgs/by-name/sl/slepc/package.nix +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ stdenv.mkDerivation (finalAttrs: { installTargets = [ (if withExamples then "install" else "install-lib") ]; __darwinAllowLocalNetworking = true; nativeInstallCheckInputs = [ mpiCheckPhaseHook Loading Loading
pkgs/by-name/pe/petsc/package.nix +44 −6 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ withHypre ? withCommonDeps && mpiSupport, withFftw ? withCommonDeps, withSuperLu ? withCommonDeps, withSuperLuDist ? withCommonDeps && mpiSupport, withSuitesparse ? withCommonDeps, # External libraries Loading @@ -52,10 +53,12 @@ hypre, fftw, superlu, superlu_dist, suitesparse, # Used in passthru.tests petsc, mpich, }: assert withFullDeps -> withCommonDeps; Loading @@ -69,10 +72,12 @@ assert withPtscotch -> (mpiSupport && withZlib); assert withScalapack -> mpiSupport; assert (withMumps && mpiSupport) -> withScalapack; assert withHypre -> mpiSupport; assert withSuperLuDist -> mpiSupport; let petscPackages = lib.makeScope newScope (self: { inherit mpi # global override options mpiSupport fortranSupport Loading @@ -83,7 +88,6 @@ let petscPackages = self; # external libraries mpi = self.callPackage mpi.override { }; blas = self.callPackage blas.override { }; lapack = self.callPackage lapack.override { }; hdf5 = self.callPackage hdf5.override { Loading @@ -99,6 +103,7 @@ let hypre = self.callPackage hypre.override { }; fftw = self.callPackage fftw.override { }; superlu = self.callPackage superlu.override { }; superlu_dist = self.callPackage superlu_dist.override { }; suitesparse = self.callPackage suitesparse.override { }; }); in Loading Loading @@ -141,6 +146,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withMumps petscPackages.mumps ++ lib.optional withHypre petscPackages.hypre ++ lib.optional withSuperLu petscPackages.superlu ++ lib.optional withSuperLuDist petscPackages.superlu_dist ++ lib.optional withFftw petscPackages.fftw ++ lib.optional withSuitesparse petscPackages.suitesparse; Loading @@ -161,16 +167,20 @@ stdenv.mkDerivation (finalAttrs: { configureFlags = [ "--with-blas=1" "--with-lapack=1" "--with-blaslapack=1" "--with-scalar-type=${scalarType}" "--with-precision=${precision}" "--with-mpi=${if mpiSupport then "1" else "0"}" ] ++ lib.optionals (!mpiSupport) [ "--with-cc=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "gcc" else "clang"}" "--with-cxx=${stdenv.cc}/bin/${if stdenv.cc.isGNU then "g++" else "clang++"}" "--with-fc=${gfortran}/bin/gfortran" ] ++ lib.optionals mpiSupport [ "--CC=mpicc" "--with-cxx=mpicxx" "--with-fc=mpif90" "--with-cc=${lib.getDev mpi}/bin/mpicc" "--with-cxx=${lib.getDev mpi}/bin/mpicxx" "--with-fc=${lib.getDev mpi}/bin/mpif90" ] ++ lib.optionals (!debug) [ "--with-debugging=0" Loading @@ -192,6 +202,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withHdf5 "--with-hdf5=1" ++ lib.optional withHypre "--with-hypre=1" ++ lib.optional withSuperLu "--with-superlu=1" ++ lib.optional withSuperLuDist "--with-superlu_dist=1" ++ lib.optional withFftw "--with-fftw=1" ++ lib.optional withSuitesparse "--with-suitesparse=1"; Loading @@ -204,6 +215,30 @@ stdenv.mkDerivation (finalAttrs: { enableParallelBuilding = true; # Ensure petscvariables contains absolute paths for compilers and flags so that downstream # packages relying on PETSc's runtime configuration (e.g. form compilers, code generators) # can correctly compile and link generated code postInstall = lib.concatStringsSep "\n" ( map ( package: let pname = package.pname or package.name; prefix = if (pname == "blas" || pname == "lapack") then "BLASLAPACK" else lib.toUpper (builtins.elemAt (lib.splitString "-" pname) 0); in '' substituteInPlace $out/lib/petsc/conf/petscvariables \ --replace-fail "${prefix}_INCLUDE =" "${prefix}_INCLUDE = -I${lib.getDev package}/include" \ --replace-fail "${prefix}_LIB =" "${prefix}_LIB = -L${lib.getLib package}/lib" '' ) finalAttrs.buildInputs ); __darwinAllowLocalNetworking = true; # This is needed as the checks need to compile and link the test cases with # -lpetsc, which is not available in the checkPhase, which is executed before # the installPhase. The installCheckPhase comes after the installPhase, so Loading Loading @@ -255,6 +290,9 @@ stdenv.mkDerivation (finalAttrs: { withFullDeps = true; withParmetis = false; }; mpich = petsc.override { mpi = mpich; }; }; }; Loading
pkgs/by-name/sl/slepc/package.nix +2 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ stdenv.mkDerivation (finalAttrs: { installTargets = [ (if withExamples then "install" else "install-lib") ]; __darwinAllowLocalNetworking = true; nativeInstallCheckInputs = [ mpiCheckPhaseHook Loading