diff --git a/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2023a-CUDA-12.1.1.eb b/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2023a-CUDA-12.1.1.eb index 9a091f263c1..635b6f8d158 100644 --- a/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2023a-CUDA-12.1.1.eb +++ b/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2023a-CUDA-12.1.1.eb @@ -9,12 +9,25 @@ description = """A software package for performing and analyzing scientific Mole source_urls = ['https://github.com/espressomd/espresso/releases/download/%(version)s/'] sources = [SOURCELOWER_TAR_GZ] -checksums = ['2bc02f91632b0030f1203759768bd718bd8a0005f72696980b12331b4bfa0d76'] +patches = ['ESPResSo-4.2.2_fix_using_cuda_namespace.patch', + 'ESPResSo-4.2.2_fix_unit_test_packaging_specifiers.patch', + 'ESPResSo-4.2.2_fix_cuda_archs.patch'] +checksums = ['2bc02f91632b0030f1203759768bd718bd8a0005f72696980b12331b4bfa0d76', + {'ESPResSo-4.2.2_fix_using_cuda_namespace.patch': + '94b423c5a25fd474d91e28ffacda863cadb9092662522d2b4fe682e3570b79bb'}, + {'ESPResSo-4.2.2_fix_unit_test_packaging_specifiers.patch': + '6fdb9a61812b7a1178804c82254e837bc69552cfc3d40011de3686ea1a6ff527'}, + {'ESPResSo-4.2.2_fix_cuda_archs.patch': + 'e34c589b8bac9285d76993671018aecf3050eea1efeab5400fdeded41caa70a3'}, + ] toolchain = {'name': 'foss', 'version': '2023a'} toolchainopts = {'usempi': True, 'pic': True} -builddependencies = [('CMake', '3.26.3')] +builddependencies = [ + ('CMake', '3.26.3'), + ('Cython', '3.0.8'), +] dependencies = [ ('Python', '3.11.3'), @@ -34,6 +47,7 @@ cuda_compute_capabilities = ['5.2', '6.0', '7.0', '7.5', '8.0', '8.6', '9.0'] configopts = ' -DCMAKE_SKIP_RPATH=OFF -DWITH_TESTS=ON -DWITH_CUDA=ON' # make sure the right Python is used (note: -DPython3_EXECUTABLE or -DPython_EXECUTABLE does not work!) configopts += ' -DPYTHON_EXECUTABLE=$EBROOTPYTHON/bin/python ' +configopts += ' -DESPRESSO_CUDA_ARCHITECTURES="%(cuda_cc_cmake)s" ' runtest = 'check_unit_tests && make check_python' diff --git a/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2024a-CUDA-12.6.0.eb b/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2024a-CUDA-12.6.0.eb index d3101152209..8a9d644d1d8 100644 --- a/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2024a-CUDA-12.6.0.eb +++ b/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2-foss-2024a-CUDA-12.6.0.eb @@ -10,12 +10,15 @@ description = """A software package for performing and analyzing scientific Mole source_urls = ['https://github.com/espressomd/espresso/releases/download/%(version)s/'] sources = [SOURCELOWER_TAR_GZ] patches = ['ESPResSo-4.2.2_fix_using_cuda_namespace.patch', - 'ESPResSo-4.2.2_fix_unit_test_packaging_specifiers.patch'] + 'ESPResSo-4.2.2_fix_unit_test_packaging_specifiers.patch', + 'ESPResSo-4.2.2_fix_cuda_archs.patch'] checksums = ['2bc02f91632b0030f1203759768bd718bd8a0005f72696980b12331b4bfa0d76', {'ESPResSo-4.2.2_fix_using_cuda_namespace.patch': '94b423c5a25fd474d91e28ffacda863cadb9092662522d2b4fe682e3570b79bb'}, {'ESPResSo-4.2.2_fix_unit_test_packaging_specifiers.patch': '6fdb9a61812b7a1178804c82254e837bc69552cfc3d40011de3686ea1a6ff527'}, + {'ESPResSo-4.2.2_fix_cuda_archs.patch': + 'e34c589b8bac9285d76993671018aecf3050eea1efeab5400fdeded41caa70a3'}, ] toolchain = {'name': 'foss', 'version': '2024a'} @@ -44,6 +47,7 @@ cuda_compute_capabilities = ['5.2', '6.0', '7.0', '7.5', '8.0', '8.6', '9.0'] configopts = ' -DCMAKE_SKIP_RPATH=OFF -DWITH_TESTS=ON -DWITH_CUDA=ON' # make sure the right Python is used (note: -DPython3_EXECUTABLE or -DPython_EXECUTABLE does not work!) configopts += ' -DPYTHON_EXECUTABLE=$EBROOTPYTHON/bin/python ' +configopts += ' -DESPRESSO_CUDA_ARCHITECTURES="%(cuda_cc_cmake)s" ' runtest = 'check_unit_tests && make check_python' diff --git a/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2_fix_cuda_archs.patch b/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2_fix_cuda_archs.patch new file mode 100644 index 00000000000..f5d76b4b2be --- /dev/null +++ b/easybuild/easyconfigs/e/ESPResSo/ESPResSo-4.2.2_fix_cuda_archs.patch @@ -0,0 +1,26 @@ +# Provide a CMake option to select which CUDA architecture to build against. +# See first commit in https://github.com/espressomd/espresso/pull/4642 +diff --git a/cmake/FindCUDACompilerNVCC.cmake b/cmake/FindCUDACompilerNVCC.cmake +--- a/cmake/FindCUDACompilerNVCC.cmake ++++ b/cmake/FindCUDACompilerNVCC.cmake +@@ -52,8 +52,16 @@ + list(APPEND CUDA_NVCC_FLAGS_RELWITHASSERT -O3 -g -Xptxas=-O3 -Xcompiler=-O3,-g) +-if(CMAKE_CUDA_COMPILER_VERSION VERSION_LESS 11) +- list(APPEND CUDA_NVCC_FLAGS -gencode=arch=compute_30,code=sm_30) ++if(NOT DEFINED ESPRESSO_CUDA_ARCHITECTURES) ++ if("$ENV{CUDAARCHS}" STREQUAL "") ++ set(ESPRESSO_CUDA_ARCHITECTURES "75;86;89" CACHE INTERNAL "") ++ else() ++ set(ESPRESSO_CUDA_ARCHITECTURES "$ENV{CUDAARCHS}" CACHE INTERNAL "") ++ endif() + endif() ++foreach(ESPRESSO_CUDA_ARCH ${ESPRESSO_CUDA_ARCHITECTURES}) ++ list(APPEND CUDA_NVCC_FLAGS ++ "-gencode=arch=compute_${ESPRESSO_CUDA_ARCH},code=sm_${ESPRESSO_CUDA_ARCH}" ++ "-gencode=arch=compute_${ESPRESSO_CUDA_ARCH},code=compute_${ESPRESSO_CUDA_ARCH}") ++endforeach() + list(APPEND CUDA_NVCC_FLAGS +- -gencode=arch=compute_52,code=sm_52 +- -gencode=arch=compute_52,code=compute_52 -std=c++${CMAKE_CUDA_STANDARD} ++ -std=c++${CMAKE_CUDA_STANDARD} + $<$:-Xcompiler=-Werror;-Xptxas=-Werror>