nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 121 lines 2.9 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 blas, 6 boost, 7 cmake, 8 gfortran, 9 lapack, 10 mpi, 11 suitesparse, 12 swig, 13 withMPI ? false, 14}: 15 16# NOTE: Not all packages are enabled. We specifically enable the ones 17# required to build Xyce. If the need comes, we can enable more of them. 18 19let 20 flagsBase = '' 21 -G "Unix Makefiles" 22 -DBUILD_SHARED_LIBS=ON 23 -DCMAKE_CXX_FLAGS="-O3 -fPIC" 24 -DCMAKE_C_FLAGS="-O3 -fPIC" 25 -DCMAKE_Fortran_FLAGS="-O3 -fPIC" 26 -DTrilinos_ENABLE_NOX=ON 27 -DNOX_ENABLE_LOCA=ON 28 -DTrilinos_ENABLE_EpetraExt=ON 29 -DEpetraExt_BUILD_BTF=ON 30 -DEpetraExt_BUILD_EXPERIMENTAL=ON 31 -DEpetraExt_BUILD_GRAPH_REORDERINGS=ON 32 -DTrilinos_ENABLE_TrilinosCouplings=ON 33 -DTrilinos_ENABLE_Ifpack=ON 34 -DTrilinos_ENABLE_AztecOO=ON 35 -DTrilinos_ENABLE_Belos=ON 36 -DTrilinos_ENABLE_Teuchos=ON 37 -DTeuchos_ENABLE_COMPLEX=ON 38 -DTrilinos_ENABLE_Amesos=ON 39 -DAmesos_ENABLE_KLU=ON 40 -DTrilinos_ENABLE_Amesos2=ON 41 -DAmesos2_ENABLE_KLU2=ON 42 -DAmesos2_ENABLE_Basker=ON 43 -DTrilinos_ENABLE_Sacado=ON 44 -DTrilinos_ENABLE_Stokhos=ON 45 -DTrilinos_ENABLE_Kokkos=ON 46 -DTrilinos_ENABLE_ALL_OPTIONAL_PACKAGES=OFF 47 -DTrilinos_ENABLE_CXX11=ON 48 -DTPL_ENABLE_AMD=ON 49 -DTPL_ENABLE_BLAS=ON 50 -DTPL_ENABLE_LAPACK=ON 51 ''; 52 flagsParallel = '' 53 -DCMAKE_C_COMPILER=mpicc 54 -DCMAKE_CXX_COMPILER=mpic++ 55 -DCMAKE_Fortran_COMPILER=mpif77 56 -DTrilinos_ENABLE_Isorropia=ON 57 -DTrilinos_ENABLE_Zoltan=ON 58 -DTPL_ENABLE_MPI=ON 59 ''; 60in 61stdenv.mkDerivation rec { 62 pname = "trilinos"; 63 # Xyce 7.4 requires version 12.12.1 64 # nixpkgs-update: no auto update 65 version = "12.12.1"; 66 67 src = fetchFromGitHub { 68 owner = "trilinos"; 69 repo = "Trilinos"; 70 tag = "trilinos-release-${lib.replaceStrings [ "." ] [ "-" ] version}"; 71 sha256 = "sha256-Nqjr7RAlUHm6vs87a1P84Y7BIZEL0Vs/A1Z6dykfv+o="; 72 }; 73 74 nativeBuildInputs = [ 75 cmake 76 gfortran 77 swig 78 ]; 79 80 buildInputs = [ 81 blas 82 boost 83 lapack 84 suitesparse 85 ] 86 ++ lib.optionals withMPI [ mpi ]; 87 88 preConfigure = 89 if withMPI then 90 '' 91 cmakeFlagsArray+=(${flagsBase} ${flagsParallel}) 92 '' 93 else 94 '' 95 cmakeFlagsArray+=(${flagsBase}) 96 ''; 97 98 postInstall = '' 99 # remove dangling symlink 100 rm $out/lib/cmake/tribits/doc/developers_guide/TribitsBuildReference.html 101 ''; 102 103 passthru = { 104 inherit withMPI; 105 }; 106 107 meta = with lib; { 108 description = "Engineering and scientific problems algorithms"; 109 mainProgram = "nvcc_wrapper"; 110 longDescription = '' 111 The Trilinos Project is an effort to develop algorithms and enabling 112 technologies within an object-oriented software framework for the 113 solution of large-scale, complex multi-physics engineering and scientific 114 problems. 115 ''; 116 homepage = "https://trilinos.org"; 117 license = licenses.bsd3; 118 maintainers = with maintainers; [ fbeffa ]; 119 platforms = platforms.all; 120 }; 121}