This repository was archived by the owner on Mar 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 55# =============================================================================
66
77if (CORENRN_ENABLE_GPU)
8- # openacc needs to build static library in order to have global/routines
9- # working. See https://www.pgroup.com/userforum/viewtopic.php?t=5350
10- set (COMPILE_LIBRARY_TYPE "STATIC" )
11-
128 # cuda unified memory support
139 if (CORENRN_ENABLE_CUDA_UNIFIED_MEMORY)
1410 add_definitions (-DUNIFIED_MEMORY)
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ option(CORENRN_ENABLE_LIKWID_PROFILING "Enable LIKWID instrumentation" OFF)
6969option (CORENRN_ENABLE_CUDA_UNIFIED_MEMORY "Enable CUDA unified memory support" OFF )
7070option (CORENRN_ENABLE_UNIT_TESTS "Enable unit tests execution" ON )
7171option (CORENRN_ENABLE_GPU "Enable GPU support using OpenACC" OFF )
72+ option (CORENRN_ENABLE_SHARED "Enable shared library build" ON )
7273
7374set (CORENRN_NMODL_DIR "" CACHE PATH "Path to nmodl source-to-source compiler installation" )
7475set (LIKWID_DIR "" CACHE PATH "Path to likwid performance analysis suite" )
@@ -117,6 +118,14 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "PGI")
117118 add_definitions (-DEIGEN_DONT_VECTORIZE=1)
118119endif ()
119120
121+ # OpenACC needs to build static library in order to have global/routines
122+ # working. See https://www.pgroup.com/userforum/viewtopic.php?t=5350
123+ if (CORENRN_ENABLE_SHARED AND NOT CORENRN_ENABLE_GPU)
124+ set (COMPILE_LIBRARY_TYPE "SHARED" )
125+ else ()
126+ set (COMPILE_LIBRARY_TYPE "STATIC" )
127+ endif ()
128+
120129if (CORENRN_ENABLE_ISPC)
121130 enable_language (ISPC)
122131 add_definitions ("-DISPC_INTEROP=1" )
@@ -287,6 +296,7 @@ if(cmake_generator_tolower MATCHES "makefile")
287296 message (STATUS "--------------------+--------------------------------------------------------" )
288297
289298 message (STATUS "COMPILE FLAGS | ${COMPILER_FLAGS} ${CMAKE_CXX_FLAGS} " )
299+ message (STATUS "Build Type | ${COMPILE_LIBRARY_TYPE} " )
290300 message (STATUS "MPI | ${CORENRN_ENABLE_MPI} " )
291301 if (CORENRN_ENABLE_MPI)
292302 message (STATUS " INC | ${MPI_C_INCLUDE_PATH} " )
You can’t perform that action at this time.
0 commit comments