Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues #507

Open
wants to merge 58 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
791783d
Improve build process and minor build-related code updates
LSchwiebert Apr 26, 2023
bf4a10b
Correct EOL
LSchwiebert Apr 26, 2023
199a8eb
Fix a minor memory leak
LSchwiebert May 5, 2023
03a6064
Make sure the correct abs() function is used with floats
LSchwiebert May 5, 2023
48fa348
Update for recent code changes
LSchwiebert May 9, 2023
23e1de0
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert May 9, 2023
9490665
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert May 9, 2023
e31e3a9
Add support for Clang on Linux
LSchwiebert May 17, 2023
0d1facd
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert May 22, 2023
7fa1e74
Restore to development version
LSchwiebert May 23, 2023
bff8c90
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Jun 14, 2023
b9554ad
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Jun 27, 2023
5f941bb
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Jun 27, 2023
c28d871
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Jul 25, 2023
414a644
Fixes the gcc compiler issues but not linker
LSchwiebert Aug 12, 2023
b43e807
Final changes to resolve GPU linking issues
LSchwiebert Aug 14, 2023
d3342d8
Update GOMC Website in Readme file
LSchwiebert Aug 14, 2023
523b9f3
Update web link for CMake
LSchwiebert Aug 14, 2023
2bc9c6c
Remove unused use_tidy variable. Just set CMake flag
LSchwiebert Aug 14, 2023
6b28702
Clean up README.md per Codacy style
LSchwiebert Aug 14, 2023
4f9d4fa
README.md clean up per Codacy Style guidelines
LSchwiebert Aug 14, 2023
dde4892
README.md clean up per Codacy Style guidelines
LSchwiebert Aug 14, 2023
3f21ee9
Change OpenMP pragma for compatibility with old Intel compilers
LSchwiebert Aug 27, 2023
1587a19
Change OpenMP pragma for compatibility with old Intel compilers
LSchwiebert Aug 27, 2023
fa1b2f0
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Sep 4, 2023
1bb817f
Merge branch 'development' into build-issues
LSchwiebert Sep 10, 2023
c23a326
Update CMakeLists.txt for handling clang-tidy
LSchwiebert Sep 19, 2023
6d61334
Merge branch 'build-issues' of https://github.com/GOMC-WSU/GOMC into …
LSchwiebert Sep 19, 2023
8d16bf0
Remove Endian Tests since Endian.h is no longer used in GOMC
LSchwiebert Sep 21, 2023
411ed83
Standardize guards on header files. Add some missing ones.
LSchwiebert Sep 21, 2023
11d44cd
Print error message if CUDA does not support this compiler
LSchwiebert Sep 21, 2023
850848f
Build test executables only for specified ensembles
LSchwiebert Sep 21, 2023
823c6e4
Warning instead Status message for compiler incompatible with CUDA
LSchwiebert Sep 22, 2023
b62c64b
Standardize guards on header files
LSchwiebert Sep 22, 2023
17ee84d
Fix syntax error in CMakeLists.txt for warning message
LSchwiebert Sep 22, 2023
d3da126
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Sep 26, 2023
28a4664
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Nov 28, 2023
b690cb7
Remove link time optimization from the build process
LSchwiebert Jan 8, 2024
118e917
Remove Intel LLVM Compiler detection until CUDA supports it
LSchwiebert Mar 28, 2024
0bc3977
Clean up some #define statements and comments on the #endif for heade…
LSchwiebert Mar 28, 2024
8173bdd
Resolve Codacy-detected error for builds with test
LSchwiebert Mar 28, 2024
fbf6c9f
Handle ensemble names when building the test configs
LSchwiebert Mar 28, 2024
0a97b18
Build CUDA code for GPU executables
LSchwiebert Jul 8, 2024
55726de
Don't include GPU calls in CPU builds
LSchwiebert Jul 8, 2024
afe876d
Don't call RotationMatrix::UniformRandom with prng() calls as functio…
LSchwiebert Jul 10, 2024
c99f658
Remove old UniformRandom function calls
LSchwiebert Jul 10, 2024
d3dd0e7
Fix typo in comment
LSchwiebert Nov 19, 2024
aab3c02
Add entries to print newer OpenMP versions
LSchwiebert Nov 23, 2024
e6073f4
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Nov 27, 2024
69b4ebc
Patch to handle older OpenMP versions
LSchwiebert Nov 30, 2024
64eba6e
Updates to build on Windows with Visual Studio
LSchwiebert Nov 30, 2024
64f8f80
Clarify Windows build
LSchwiebert Dec 1, 2024
713622a
Updates to resolve MSVC warnings and improve MSVC build flags
LSchwiebert Dec 3, 2024
f451add
Pass more forcefield parameters to the GPU for consistent values
LSchwiebert Dec 13, 2024
57181f0
Reformat source files using clang format
LSchwiebert Dec 13, 2024
2017878
Merge branch 'development' of https://github.com/GOMC-WSU/GOMC into b…
LSchwiebert Dec 13, 2024
0e3f3e6
Update for latest development branch patches
LSchwiebert Dec 19, 2024
5c65edf
Set address sanitizer MSVC flag only for MSVC builds
LSchwiebert Jan 6, 2025
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
1 change: 0 additions & 1 deletion CMake/FileLists.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ set(libHeaders
lib/AlphaNum.h
lib/BasicTypes.h
lib/BitLib.h
lib/Endian.h
lib/GeomLib.h
lib/Lambda.h
lib/NumLib.h
Expand Down
41 changes: 30 additions & 11 deletions CMake/GOMCCPUSetup.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
#EnsemblePreprocessor defines NVT = 1, GEMC = 2, GCMC = 3, NPT = 4
#NPT (Isothermal-Isobaric) Ensemble

set(NPT_flags "-DENSEMBLE=4")
set(NPT_name "GOMC_CPU_NPT")

#Grand Canonical Monte Carlo
set(GC_flags "-DENSEMBLE=3")
set(GC_name "GOMC_CPU_GCMC")
#NVT (Canonical) Ensemble
set(NVT_flags "-DENSEMBLE=1")
set(NVT_name "GOMC_CPU_NVT")

#Gibbs Ensemble Monte Carlo
set(GE_flags "-DENSEMBLE=2")
set(GE_name "GOMC_CPU_GEMC")

#NVT (Canonical) Ensemble
set(NVT_flags "-DENSEMBLE=1")
set(NVT_name "GOMC_CPU_NVT")
#Grand Canonical Monte Carlo
set(GC_flags "-DENSEMBLE=3")
set(GC_name "GOMC_CPU_GCMC")

#NPT (Isothermal-Isobaric) Ensemble
set(NPT_flags "-DENSEMBLE=4")
set(NPT_name "GOMC_CPU_NPT")

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED true)

if(ENSEMBLE_NVT)
add_executable(NVT ${sources} ${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for each compiler
target_compile_options(NVT
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_COMP_FLAGS}>)
target_link_options(NVT
PUBLIC $<$<LINK_LANGUAGE:CXX>:${CMAKE_LINK_FLAGS}>)
set_target_properties(NVT PROPERTIES
OUTPUT_NAME ${NVT_name}
COMPILE_FLAGS "${NVT_flags}")
Expand All @@ -35,6 +40,11 @@ endif()

if(ENSEMBLE_GEMC)
add_executable(GEMC ${sources} ${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for each compiler
target_compile_options(GEMC
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_COMP_FLAGS}>)
target_link_options(GEMC
PUBLIC $<$<LINK_LANGUAGE:CXX>:${CMAKE_LINK_FLAGS}>)
set_target_properties(GEMC PROPERTIES
OUTPUT_NAME ${GE_name}
COMPILE_FLAGS "${GE_flags}")
Expand All @@ -49,6 +59,11 @@ endif()

if(ENSEMBLE_GCMC)
add_executable(GCMC ${sources} ${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for each compiler
target_compile_options(GCMC
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_COMP_FLAGS}>)
target_link_options(GCMC
PUBLIC $<$<LINK_LANGUAGE:CXX>:${CMAKE_LINK_FLAGS}>)
set_target_properties(GCMC PROPERTIES
OUTPUT_NAME ${GC_name}
COMPILE_FLAGS "${GC_flags}")
Expand All @@ -63,6 +78,11 @@ endif()

if(ENSEMBLE_NPT)
add_executable(NPT ${sources} ${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for each compiler
target_compile_options(NPT
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_COMP_FLAGS}>)
target_link_options(NPT
PUBLIC $<$<LINK_LANGUAGE:CXX>:${CMAKE_LINK_FLAGS}>)
set_target_properties(NPT PROPERTIES
OUTPUT_NAME ${NPT_name}
COMPILE_FLAGS "${NPT_flags}")
Expand All @@ -74,4 +94,3 @@ if(ENSEMBLE_NPT)
target_link_libraries(NPT ${MPI_LIBRARIES})
endif()
endif()

268 changes: 150 additions & 118 deletions CMake/GOMCCUDASetup.cmake
Original file line number Diff line number Diff line change
@@ -1,118 +1,150 @@
# Find CUDA is enabled, set it up

if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, passing : '-g -G --keep' to nvcc")
set(CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -g -G --keep")
endif()


set(GEN_COMP_flag "-DGOMC_CUDA -DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT ")

if (GOMC_NVTX_ENABLED)
message("-- Enabling profiling with NVTX for GPU")
set(GEN_COMP_flag "${GEN_COMP_flag} -DGOMC_NVTX_ENABLED")
endif()


include_directories(src/GPU)

set(GPU_NPT_flags "-DENSEMBLE=4 ${GEN_COMP_flag}")
set(GPU_NPT_name "GOMC_GPU_NPT")
set(GPU_GC_flags "-DENSEMBLE=3 ${GEN_COMP_flag}")
set(GPU_GC_name "GOMC_GPU_GCMC")
set(GPU_GE_flags "-DENSEMBLE=2 ${GEN_COMP_flag}")
set(GPU_GE_name "GOMC_GPU_GEMC")
set(GPU_NVT_flags "-DENSEMBLE=1 ${GEN_COMP_flag}")
set(GPU_NVT_name "GOMC_GPU_NVT")

set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED true)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED true)

# Set host compiler
set(CCBIN "-ccbin=${CMAKE_CXX_COMPILER}")
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CCBIN} -Wno-deprecated-gpu-targets" )

include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})

#####################################
if(ENSEMBLE_GPU_NVT)
add_executable(GPU_NVT ${cudaSources} ${cudaHeaders}
${sources} ${headers} ${libHeaders} ${libSources})
set_target_properties(GPU_NVT PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_NVT_name}
CUDA_ARCHITECTURES "35;60;70;80"
COMPILE_FLAGS "${GPU_NVT_flags}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_NVT setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_NVT PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_NVT ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_NVT ${MPI_LIBRARIES})
endif()
endif()

if(ENSEMBLE_GPU_GEMC)
add_executable(GPU_GEMC ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
set_target_properties(GPU_GEMC PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_GE_name}
CUDA_ARCHITECTURES "35;60;70;80"
COMPILE_FLAGS "${GPU_GE_flags}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_GEMC setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_GEMC PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_GEMC ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_GEMC ${MPI_LIBRARIES})
endif()
endif()

if(ENSEMBLE_GPU_GCMC)
add_executable(GPU_GCMC ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
set_target_properties(GPU_GCMC PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_GC_name}
CUDA_ARCHITECTURES "35;60;70;80"
COMPILE_FLAGS "${GPU_GC_flags}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_GCMC setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_GCMC PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_GCMC ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_GCMC ${MPI_LIBRARIES})
endif()
endif()

if(ENSEMBLE_GPU_NPT)
add_executable(GPU_NPT ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
set_target_properties(GPU_NPT PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_NPT_name}
CUDA_ARCHITECTURES "35;60;70;80"
COMPILE_FLAGS "${GPU_NPT_flags}")
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_NPT setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_NPT PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_NPT ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_NPT ${MPI_LIBRARIES})
endif()
endif()
# Find CUDA is enabled, set it up
set(CMAKE_CUDA_COMP_FLAGS -DGOMC_CUDA -DTHRUST_IGNORE_DEPRECATED_CPP_DIALECT)
set(CMAKE_HOST_COMP_FLAGS ${CMAKE_COMP_FLAGS} -DGOMC_CUDA)

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, passing '-g -G --keep' to nvcc")
set(CMAKE_CUDA_COMP_FLAGS ${CMAKE_CUDA_COMP_FLAGS} -g -G --keep)
set(CMAKE_CUDA_LINK_FLAGS -g -G --keep)
endif()

if(GOMC_NVTX_ENABLED)
message("-- Enabling profiling with NVTX for GPU")
set(CMAKE_CUDA_COMP_FLAGS ${CMAKE_CUDA_COMP_FLAGS} -DGOMC_NVTX_ENABLED)
endif()

# Set architecture flags based on the CMake version
# Once CMake 3.23 has been available for a while, we should just use
# set(CMAKE_CUDA_ARCHITECTURES all) and remove the if block
if (CMAKE_MAJOR_VERSION VERSION_GREATER 3 OR CMAKE_MINOR_VERSION VERSION_GREATER_EQUAL 23)
set(CMAKE_CUDA_ARCHITECTURES all)
else()
set(CMAKE_CUDA_ARCHITECTURES 60;70;75;80)
endif()

include_directories(src/GPU)

set(GPU_NVT_flags "-DENSEMBLE=1")
set(GPU_NVT_name "GOMC_GPU_NVT")
set(GPU_GE_flags "-DENSEMBLE=2")
set(GPU_GE_name "GOMC_GPU_GEMC")
set(GPU_GC_flags "-DENSEMBLE=3")
set(GPU_GC_name "GOMC_GPU_GCMC")
set(GPU_NPT_flags "-DENSEMBLE=4")
set(GPU_NPT_name "GOMC_GPU_NPT")

set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED true)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED true)

# Disable the warning on deprecated GPU targets
set(CMAKE_CUDA_COMP_FLAGS ${CMAKE_CUDA_COMP_FLAGS} -Wno-deprecated-gpu-targets)
set(CMAKE_CUDA_LINK_FLAGS ${CMAKE_CUDA_LINK_FLAGS} -Wno-deprecated-gpu-targets)

include_directories(${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})

#####################################
if(ENSEMBLE_GPU_NVT)
add_executable(GPU_NVT ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for NVCC and the host compiler
target_compile_options(GPU_NVT
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_HOST_COMP_FLAGS}>
$<$<COMPILE_LANGUAGE:CUDA>:${CMAKE_CUDA_COMP_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
target_link_options(GPU_NVT
PUBLIC $<HOST_LINK:${CMAKE_LINK_FLAGS}>
$<DEVICE_LINK:${CMAKE_CUDA_LINK_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
set_target_properties(GPU_NVT PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_NVT_name}
COMPILE_FLAGS "${GPU_NVT_flags}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_NVT setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_NVT PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_NVT ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_NVT ${MPI_LIBRARIES})
endif()
endif()

if(ENSEMBLE_GPU_GEMC)
add_executable(GPU_GEMC ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for NVCC and the host compiler
target_compile_options(GPU_GEMC
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_HOST_COMP_FLAGS}>
$<$<COMPILE_LANGUAGE:CUDA>:${CMAKE_CUDA_COMP_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
target_link_options(GPU_GEMC
PUBLIC $<HOST_LINK:${CMAKE_LINK_FLAGS}>
$<DEVICE_LINK:${CMAKE_CUDA_LINK_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
set_target_properties(GPU_GEMC PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_GE_name}
COMPILE_FLAGS "${GPU_GE_flags}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_GEMC setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_GEMC PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_GEMC ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_GEMC ${MPI_LIBRARIES})
endif()
endif()

if(ENSEMBLE_GPU_GCMC)
add_executable(GPU_GCMC ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for NVCC and the host compiler
target_compile_options(GPU_GCMC
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_HOST_COMP_FLAGS}>
$<$<COMPILE_LANGUAGE:CUDA>:${CMAKE_CUDA_COMP_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
target_link_options(GPU_GCMC
PUBLIC $<HOST_LINK:${CMAKE_LINK_FLAGS}>
$<DEVICE_LINK:${CMAKE_CUDA_LINK_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
set_target_properties(GPU_GCMC PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_GC_name}
COMPILE_FLAGS "${GPU_GC_flags}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_GCMC setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_GCMC PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_GCMC ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_GCMC ${MPI_LIBRARIES})
endif()
endif()

if(ENSEMBLE_GPU_NPT)
add_executable(GPU_NPT ${cudaSources} ${cudaHeaders} ${sources}
${headers} ${libHeaders} ${libSources})
# Set compiler and linker flags for NVCC and the host compiler
target_compile_options(GPU_NPT
PUBLIC $<$<COMPILE_LANGUAGE:CXX>:${CMAKE_HOST_COMP_FLAGS}>
$<$<COMPILE_LANGUAGE:CUDA>:${CMAKE_CUDA_COMP_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
target_link_options(GPU_NPT
PUBLIC $<HOST_LINK:${CMAKE_LINK_FLAGS}>
$<DEVICE_LINK:${CMAKE_CUDA_LINK_FLAGS} ${CMAKE_GPU_COMP_FLAGS}>)
set_target_properties(GPU_NPT PROPERTIES
CUDA_SEPARABLE_COMPILATION ON
OUTPUT_NAME ${GPU_NPT_name}
COMPILE_FLAGS "${GPU_NPT_flags}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message("-- Debug build type detected, GPU_NPT setting CUDA_RESOLVE_DEVICE_SYMBOLS ON")
set_property(TARGET GPU_NPT PROPERTY CUDA_RESOLVE_DEVICE_SYMBOLS ON)
endif()
if(WIN32)
target_link_libraries(GPU_NPT ws2_32)
endif()
if(MPI_FOUND)
target_link_libraries(GPU_NPT ${MPI_LIBRARIES})
endif()
endif()
Loading
Loading