Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand All @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
@@ -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}
$<$<BOOL:${WARNINGS_ARE_ERRORS}>:-Xcompiler=-Werror;-Xptxas=-Werror>