Skip to content
This repository has been archived by the owner on Mar 20, 2023. It is now read-only.

Commit

Permalink
Add link to libscopmath in neuron as well
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodk committed Apr 20, 2022
1 parent 66622b7 commit b5083fd
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions CMake/OpenAccHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,11 @@ if(CORENRN_ENABLE_GPU)
# linking. Without this, we had problems with linking between the explicit CUDA (.cu) device code
# and offloaded OpenACC/OpenMP code. Using -cuda when compiling seems to improve error messages in
# some cases, and to be recommended by NVIDIA. We pass -gpu=cudaX.Y to ensure that OpenACC/OpenMP
# code is compiled with the same CUDA version as the explicit CUDA code.
# TODO nordc option is added based on the recommendation from:
# https://forums.developer.nvidia.com/t/separate-compilation-of-mixed-cuda-openacc-code/192701
# but as discussed in
# https://github.com/BlueBrain/CoreNeuron/issues/141#issuecomment-1086742194
# this is still not completely solving underlying link issue.
# code is compiled with the same CUDA version as the explicit CUDA code. TODO nordc option is
# added based on the recommendation from:
# https://forums.developer.nvidia.com/t/separate-compilation-of-mixed-cuda-openacc-code/192701 but
# as discussed in https://github.com/BlueBrain/CoreNeuron/issues/141#issuecomment-1086742194 this
# is still not completely solving underlying link issue.
set(NVHPC_ACC_COMP_FLAGS "-cuda -gpu=cuda${CORENRN_CUDA_VERSION_SHORT},lineinfo")
# Make sure that OpenACC code is generated for the same compute capabilities as the explicit CUDA
# code. Otherwise there may be confusing linker errors. We cannot rely on nvcc and nvc++ using the
Expand Down Expand Up @@ -108,11 +107,11 @@ if(CORENRN_ENABLE_GPU)
GLOBAL
PROPERTY
CORENEURON_LIB_LINK_FLAGS
"${NVHPC_ACC_COMP_FLAGS} -rdynamic -lrt -Wl,--whole-archive -L${CMAKE_HOST_SYSTEM_PROCESSOR} -lcorenrnmech -L$(libdir) -lcoreneuron -Wl,--no-whole-archive"
"${NVHPC_ACC_COMP_FLAGS} -rdynamic -lrt -Wl,--whole-archive -L${CMAKE_HOST_SYSTEM_PROCESSOR} -lcorenrnmech -lscopmath -L$(libdir) -lcoreneuron -Wl,--no-whole-archive"
)
else()
set_property(GLOBAL PROPERTY CORENEURON_LIB_LINK_FLAGS
"-L${CMAKE_HOST_SYSTEM_PROCESSOR} -lcorenrnmech")
"-L${CMAKE_HOST_SYSTEM_PROCESSOR} -lcorenrnmech -lscopmath")
endif(CORENRN_ENABLE_GPU)

if(CORENRN_HAVE_NVHPC_COMPILER)
Expand Down

0 comments on commit b5083fd

Please sign in to comment.