diff options
author | Connor Baker <connor.baker@tweag.io> | 2023-12-05 14:40:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 14:40:13 -0500 |
commit | ec3c8084ec589be66930d30833022ba32f463d90 (patch) | |
tree | b83c895572c773fa9183030211371808256c6dfa /pkgs/applications/science | |
parent | 63fabdebd06902589a842f98b7cae84cff26035d (diff) | |
parent | 18a2e518cdcef0764cfd7a96c39fdc0e7874e9fd (diff) | |
download | nixlib-ec3c8084ec589be66930d30833022ba32f463d90.tar nixlib-ec3c8084ec589be66930d30833022ba32f463d90.tar.gz nixlib-ec3c8084ec589be66930d30833022ba32f463d90.tar.bz2 nixlib-ec3c8084ec589be66930d30833022ba32f463d90.tar.lz nixlib-ec3c8084ec589be66930d30833022ba32f463d90.tar.xz nixlib-ec3c8084ec589be66930d30833022ba32f463d90.tar.zst nixlib-ec3c8084ec589be66930d30833022ba32f463d90.zip |
Merge pull request #272063 from SomeoneSerge/fix/cuda-upkeep
cudaPackages: drop some runfile dependencies and fix a few builds
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r-- | pkgs/applications/science/molecular-dynamics/gromacs/default.nix | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix index e669562c9cc7..1daeeb81410a 100644 --- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix +++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix @@ -1,4 +1,14 @@ -{ lib, stdenv, fetchurl, cmake, hwloc, fftw, perl, blas, lapack, mpi, cudatoolkit +{ lib +, stdenv +, fetchurl +, cmake +, hwloc +, fftw +, perl +, blas +, lapack +, mpi +, cudaPackages , plumed , singlePrec ? true , config @@ -9,6 +19,8 @@ }: let + inherit (cudaPackages.cudaFlags) cudaCapabilities dropDot; + # Select reasonable defaults for all major platforms # The possible values are defined in CMakeLists.txt: # AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256 @@ -52,7 +64,7 @@ in stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ] ++ lib.optional enablePlumed plumed - ; + ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ]; buildInputs = [ fftw @@ -61,13 +73,17 @@ in stdenv.mkDerivation rec { blas lapack ] ++ lib.optional enableMpi mpi - ++ lib.optional enableCuda cudatoolkit - ; + ++ lib.optionals enableCuda [ + cudaPackages.cuda_cudart + cudaPackages.libcufft + cudaPackages.cuda_profiler_api + ]; propagatedBuildInputs = lib.optional enableMpi mpi; propagatedUserEnvPkgs = lib.optional enableMpi mpi; cmakeFlags = [ + (lib.cmakeBool "GMX_HWLOC" true) "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}" "-DGMX_OPENMP:BOOL=TRUE" "-DBUILD_SHARED_LIBS=ON" @@ -87,7 +103,13 @@ in stdenv.mkDerivation rec { else [ "-DGMX_MPI:BOOL=FALSE" ] - ) ++ lib.optional enableCuda "-DGMX_GPU=CUDA"; + ) ++ lib.optionals enableCuda [ + "-DGMX_GPU=CUDA" + (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities))) + + # Gromacs seems to ignore and override the normal variables, so we add this ad hoc: + (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities))) + ]; postInstall = '' moveToOutput share/cmake $dev |