lol

Merge pull request #285522 from markuskowa/fix-closure-mpi

openmpi: split dev into separate output, reduce closure size

authored by

markuskowa and committed by
GitHub
3630c552 da9b8665

+44 -19
+1 -1
nixos/tests/slurm.nix
··· 45 45 ''; 46 46 in pkgs.runCommand "mpitest" {} '' 47 47 mkdir -p $out/bin 48 - ${pkgs.openmpi}/bin/mpicc ${mpitestC} -o $out/bin/mpitest 48 + ${lib.getDev pkgs.mpi}/bin/mpicc ${mpitestC} -o $out/bin/mpitest 49 49 ''; 50 50 in { 51 51 name = "slurm";
+1 -1
pkgs/development/libraries/boost/generic.nix
··· 168 168 169 169 preConfigure = lib.optionalString useMpi '' 170 170 cat << EOF >> user-config.jam 171 - using mpi : ${mpi}/bin/mpiCC ; 171 + using mpi : ${lib.getDev mpi}/bin/mpiCC ; 172 172 EOF 173 173 '' 174 174 # On darwin we need to add the `$out/lib` to the libraries' rpath explicitly,
+1 -1
pkgs/development/libraries/netcdf/default.nix
··· 59 59 "--disable-dap-remote-tests" 60 60 "--with-plugin-dir=${placeholder "out"}/lib/hdf5-plugins" 61 61 ] 62 - ++ (lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${mpi}/bin/mpicc" ]); 62 + ++ (lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${lib.getDev mpi}/bin/mpicc" ]); 63 63 64 64 enableParallelBuilding = true; 65 65
+35 -8
pkgs/development/libraries/openmpi/default.nix
··· 1 - { lib, stdenv, fetchurl, gfortran, perl, libnl 1 + { lib, stdenv, fetchurl, removeReferencesTo, gfortran, perl, libnl 2 2 , rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin 3 - , libpsm2, libfabric, pmix, ucx, ucc 3 + , libpsm2, libfabric, pmix, ucx, ucc, makeWrapper 4 4 , config 5 5 # Enable CUDA support 6 6 , cudaSupport ? config.cudaSupport, cudaPackages ··· 38 38 find -name "Makefile.in" -exec sed -i "s/\`date\`/$ts/" \{} \; 39 39 ''; 40 40 41 - outputs = [ "out" "man" ]; 41 + outputs = [ "out" "man" "dev" ]; 42 42 43 43 buildInputs = [ zlib ] 44 44 ++ lib.optionals stdenv.isLinux [ libnl numactl pmix ucx ucc ] ··· 47 47 ++ lib.optional (stdenv.isLinux || stdenv.isFreeBSD) rdma-core 48 48 ++ lib.optionals fabricSupport [ libpsm2 libfabric ]; 49 49 50 - nativeBuildInputs = [ perl ] 50 + nativeBuildInputs = [ perl removeReferencesTo makeWrapper ] 51 51 ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ] 52 52 ++ lib.optionals fortranSupport [ gfortran ]; 53 53 ··· 71 71 72 72 postInstall = '' 73 73 find $out/lib/ -name "*.la" -exec rm -f \{} \; 74 + 75 + for f in mpi shmem osh; do 76 + for i in f77 f90 CC c++ cxx cc fort; do 77 + moveToOutput "bin/$f$i" "''${!outputDev}" 78 + echo "move $fi$i" 79 + moveToOutput "share/openmpi/$f$i-wrapper-data.txt" "''${!outputDev}" 80 + done 81 + done 82 + 83 + for i in ortecc orte-info ompi_info oshmem_info opal_wrapper; do 84 + moveToOutput "bin/$i" "''${!outputDev}" 85 + done 86 + 87 + moveToOutput "share/openmpi/ortecc-wrapper-data.txt" "''${!outputDev}" 74 88 ''; 75 89 76 90 postFixup = '' 91 + remove-references-to -t $dev $(readlink -f $out/lib/libopen-pal${stdenv.hostPlatform.extensions.sharedLibrary}) 92 + remove-references-to -t $man $(readlink -f $out/lib/libopen-pal${stdenv.hostPlatform.extensions.sharedLibrary}) 93 + 94 + # The path to the wrapper is hard coded in libopen-pal.so, which we just cleared. 95 + wrapProgram $dev/bin/opal_wrapper \ 96 + --set OPAL_INCLUDEDIR $dev/include \ 97 + --set OPAL_PKGDATADIR $dev/share/openmpi 98 + 77 99 # default compilers should be indentical to the 78 100 # compilers at build time 79 101 102 + echo "$dev/share/openmpi/mpicc-wrapper-data.txt" 80 103 sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \ 81 - $out/share/openmpi/mpicc-wrapper-data.txt 104 + $dev/share/openmpi/mpicc-wrapper-data.txt 82 105 106 + echo "$dev/share/openmpi/ortecc-wrapper-data.txt" 83 107 sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \ 84 - $out/share/openmpi/ortecc-wrapper-data.txt 108 + $dev/share/openmpi/ortecc-wrapper-data.txt 85 109 110 + echo "$dev/share/openmpi/mpic++-wrapper-data.txt" 86 111 sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \ 87 - $out/share/openmpi/mpic++-wrapper-data.txt 112 + $dev/share/openmpi/mpic++-wrapper-data.txt 88 113 '' + lib.optionalString fortranSupport '' 89 114 115 + echo "$dev/share/openmpi/mpifort-wrapper-data.txt" 90 116 sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:' \ 91 - $out/share/openmpi/mpifort-wrapper-data.txt 117 + $dev/share/openmpi/mpifort-wrapper-data.txt 118 + 92 119 ''; 93 120 94 121 doCheck = true;
+1 -1
pkgs/development/libraries/science/chemistry/libvdwxc/default.nix
··· 28 28 29 29 export PATH=$PATH:${mpi}/bin 30 30 configureFlagsArray+=( 31 - --with-mpi=${mpi} 31 + --with-mpi=${lib.getDev mpi} 32 32 CC=mpicc 33 33 FC=mpif90 34 34 MPICC=mpicc
+1 -1
pkgs/development/libraries/science/math/scalapack/default.nix
··· 51 51 -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF 52 52 -DLAPACK_LIBRARIES="-llapack" 53 53 -DBLAS_LIBRARIES="-lblas" 54 - -DCMAKE_Fortran_COMPILER=${mpi}/bin/mpif90 54 + -DCMAKE_Fortran_COMPILER=${lib.getDev mpi}/bin/mpif90 55 55 ${lib.optionalString passthru.isILP64 '' 56 56 -DCMAKE_Fortran_FLAGS="-fdefault-integer-8" 57 57 -DCMAKE_C_FLAGS="-DInt=long"
+2 -2
pkgs/development/python-modules/gpaw/default.nix
··· 29 29 text = '' 30 30 # Compiler 31 31 compiler = 'gcc' 32 - mpicompiler = '${mpi}/bin/mpicc' 33 - mpilinker = '${mpi}/bin/mpicc' 32 + mpicompiler = '${lib.getDev mpi}/bin/mpicc' 33 + mpilinker = '${lib.getDev mpi}/bin/mpicc' 34 34 35 35 # BLAS 36 36 libraries += ['blas']
+1 -1
pkgs/development/python-modules/h5py/default.nix
··· 47 47 ${lib.optionalString mpiSupport "export OMPI_MCA_rmaps_base_oversubscribe=yes"} 48 48 ''; 49 49 50 - preBuild = lib.optionalString mpiSupport "export CC=${mpi}/bin/mpicc"; 50 + preBuild = lib.optionalString mpiSupport "export CC=${lib.getDev mpi}/bin/mpicc"; 51 51 52 52 nativeBuildInputs = [ 53 53 cython
-2
pkgs/development/python-modules/mpi4py/default.nix
··· 38 38 # work as expected 39 39 ''; 40 40 41 - setupPyBuildFlags = ["--mpicc=${mpi}/bin/mpicc"]; 42 - 43 41 nativeBuildInputs = [ mpi ]; 44 42 45 43 __darwinAllowLocalNetworking = true;
+1 -1
pkgs/tools/misc/hdf5/default.nix
··· 76 76 ++ lib.optional cppSupport "-DHDF5_BUILD_CPP_LIB=ON" 77 77 ++ lib.optional fortranSupport "-DHDF5_BUILD_FORTRAN=ON" 78 78 ++ lib.optional szipSupport "-DHDF5_ENABLE_SZIP_SUPPORT=ON" 79 - ++ lib.optionals mpiSupport [ "-DHDF5_ENABLE_PARALLEL=ON" "CC=${mpi}/bin/mpicc" ] 79 + ++ lib.optionals mpiSupport [ "-DHDF5_ENABLE_PARALLEL=ON" ] 80 80 ++ lib.optional enableShared "-DBUILD_SHARED_LIBS=ON" 81 81 ++ lib.optional javaSupport "-DHDF5_BUILD_JAVA=ON" 82 82 ++ lib.optional usev110Api "-DDEFAULT_API_VERSION=v110"