petsc: removed default unfree dependencies

authored by Alexander Kiselyov and committed by Emery Hemingway dc622dce 771c5644

+36 -43
+36 -43
pkgs/by-name/pe/petsc/package.nix
··· 15 hdf5, 16 metis, 17 parmetis, 18 pkg-config, 19 p4est, 20 zlib, # propagated by p4est but required by petsc ··· 36 }; 37 38 inherit mpiSupport; 39 - withp4est = petsc-withp4est; 40 41 strictDeps = true; 42 nativeBuildInputs = [ ··· 47 buildInputs = [ 48 blas 49 lapack 50 - ] ++ lib.optional hdf5-support hdf5 ++ lib.optional withp4est p4est; 51 52 prePatch = lib.optionalString stdenv.isDarwin '' 53 substituteInPlace config/install.py \ ··· 60 # These messages contaminate test output, which makes the quicktest suite to fail. The patch adds filtering for these messages. 61 patches = [ ./filter_mpi_warnings.patch ]; 62 63 preConfigure = '' 64 patchShebangs ./lib/petsc/bin 65 - configureFlagsArray=( 66 - $configureFlagsArray 67 - ${ 68 - if !mpiSupport then 69 - '' 70 - "--with-mpi=0" 71 - '' 72 - else 73 - '' 74 - "--CC=mpicc" 75 - "--with-cxx=mpicxx" 76 - "--with-fc=mpif90" 77 - "--with-mpi=1" 78 - "--with-metis=1" 79 - "--with-metis-dir=${metis}" 80 - "--with-parmetis=1" 81 - "--with-parmetis-dir=${parmetis}" 82 - '' 83 - } 84 - ${lib.optionalString withp4est '' 85 - "--with-p4est=1" 86 - "--with-zlib-include=${zlib.dev}/include" 87 - "--with-zlib-lib=-L${zlib}/lib -lz" 88 - ''} 89 - ${lib.optionalString hdf5-support '' 90 - "--with-hdf5=1" 91 - "--with-hdf5-fortran-bindings=1" 92 - "--with-hdf5-lib=-L${hdf5}/lib -lhdf5" 93 - "--with-hdf5-include=${hdf5.dev}/include" 94 - ''} 95 - "--with-blas=1" 96 - "--with-lapack=1" 97 - "--with-scalar-type=${petsc-scalar-type}" 98 - "--with-precision=${petsc-precision}" 99 - ${lib.optionalString petsc-optimized '' 100 - "--with-debugging=0" 101 - COPTFLAGS='-O3' 102 - FOPTFLAGS='-O3' 103 - CXXOPTFLAGS='-O3' 104 - CXXFLAGS='-O3' 105 - ''} 106 ) 107 ''; 108
··· 15 hdf5, 16 metis, 17 parmetis, 18 + withParmetis ? false, 19 pkg-config, 20 p4est, 21 zlib, # propagated by p4est but required by petsc ··· 37 }; 38 39 inherit mpiSupport; 40 41 strictDeps = true; 42 nativeBuildInputs = [ ··· 47 buildInputs = [ 48 blas 49 lapack 50 + ] ++ lib.optional hdf5-support hdf5 ++ lib.optional petsc-withp4est p4est ++ lib.optionals withParmetis [ metis parmetis ]; 51 52 prePatch = lib.optionalString stdenv.isDarwin '' 53 substituteInPlace config/install.py \ ··· 60 # These messages contaminate test output, which makes the quicktest suite to fail. The patch adds filtering for these messages. 61 patches = [ ./filter_mpi_warnings.patch ]; 62 63 + configureFlags = [ 64 + "--with-blas=1" 65 + "--with-lapack=1" 66 + "--with-scalar-type=${petsc-scalar-type}" 67 + "--with-precision=${petsc-precision}" 68 + "--with-mpi=${if mpiSupport then "1" else "0"}" 69 + ] ++ lib.optionals mpiSupport [ 70 + "--CC=mpicc" 71 + "--with-cxx=mpicxx" 72 + "--with-fc=mpif90" 73 + ] ++ lib.optionals (mpiSupport && withParmetis) [ 74 + "--with-metis=1" 75 + "--with-metis-dir=${metis}" 76 + "--with-parmetis=1" 77 + "--with-parmetis-dir=${parmetis}" 78 + ] ++ lib.optionals petsc-optimized [ 79 + "--with-debugging=0" 80 + "COPTFLAGS=-O3" 81 + "FOPTFLAGS=-O3" 82 + "CXXOPTFLAGS=-O3" 83 + "CXXFLAGS=-O3" 84 + ]; 85 preConfigure = '' 86 patchShebangs ./lib/petsc/bin 87 + '' + lib.optionalString petsc-withp4est '' 88 + configureFlagsArray+=( 89 + "--with-p4est=1" 90 + "--with-zlib-include=${zlib.dev}/include" 91 + "--with-zlib-lib=-L${zlib}/lib -lz" 92 + ) 93 + '' + lib.optionalString hdf5-support '' 94 + configureFlagsArray+=( 95 + "--with-hdf5=1" 96 + "--with-hdf5-fortran-bindings=1" 97 + "--with-hdf5-include=${hdf5.dev}/include" 98 + "--with-hdf5-lib=-L${hdf5}/lib -lhdf5" 99 ) 100 ''; 101