From b5083fdc17d3dc61f5286fc7242fdc5b9f7e25cb Mon Sep 17 00:00:00 2001 From: Pramod Kumbhar Date: Thu, 21 Apr 2022 01:54:38 +0200 Subject: [PATCH] Add link to libscopmath in neuron as well --- CMake/OpenAccHelper.cmake | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMake/OpenAccHelper.cmake b/CMake/OpenAccHelper.cmake index 49a531ab1..ca96b1df1 100644 --- a/CMake/OpenAccHelper.cmake +++ b/CMake/OpenAccHelper.cmake @@ -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 @@ -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)