@@ -63,8 +63,8 @@ option(CORENRN_ENABLE_CUDA_UNIFIED_MEMORY "Enable CUDA unified memory support" O
6363option (CORENRN_ENABLE_UNIT_TESTS "Enable unit tests execution" ON )
6464option (CORENRN_ENABLE_GPU "Enable GPU support using OpenACC" OFF )
6565
66- set (CORENRN_NMODL_ROOT "" CACHE PATH "Path nmodl source-to-source compiler root " )
67- set (LIKWID_ROOT "" CACHE PATH "Path to likwid performance analysis suite" )
66+ set (CORENRN_NMODL_DIR "" CACHE PATH "Path to nmodl source-to-source compiler installation " )
67+ set (LIKWID_DIR "" CACHE PATH "Path to likwid performance analysis suite" )
6868
6969set (CORENRN_FRONTEND_C_COMPILER gcc CACHE FILEPATH "C compiler for building mod2c [frontend]" )
7070set (CORENRN_FRONTEND_CXX_COMPILER g++ CACHE FILEPATH "C++ compiler for building mod2c [frontend]" )
@@ -152,23 +152,25 @@ endif()
152152# NMODL specific options
153153# =============================================================================
154154if (CORENRN_ENABLE_NMODL)
155- find_package (nmodl REQUIRED)
156- include_directories (${nmodl_INCLUDE} )
157-
158- # copy to make nrnivmodl-core work from build as well instal directory
159- set (CORENRN_NMODL_BINARY ${CMAKE_BINARY_DIR} /bin/nmodl${CMAKE_EXECUTABLE_SUFFIX} )
160- configure_file (${nmodl_BINARY} ${CORENRN_NMODL_BINARY} COPYONLY )
161-
162- # path to python interface
163- set (ENV{PYTHONPATH} "${nmodl_PYTHONPATH} :$ENV{PYTHONPATH} " )
164- set (CORENRN_NMODL_PYTHONPATH $ENV{PYTHONPATH} )
165-
155+ find_package (nmodl)
156+ if (nmodl_FOUND)
157+ set (CORENRN_NMODL_BINARY ${nmodl_BINARY} )
158+ set (CORENRN_NMODL_INCLUDE ${nmodl_INCLUDE} )
159+ # path to python interface
160+ set (ENV{PYTHONPATH} "${nmodl_PYTHONPATH} :$ENV{PYTHONPATH} " )
161+ set (CORENRN_NMODL_PYTHONPATH $ENV{PYTHONPATH} )
162+ else ()
163+ include (AddNmodlSubmodule)
164+ set (CORENRN_NMODL_BINARY ${CMAKE_BINARY_DIR} /bin/nmodl${CMAKE_EXECUTABLE_SUFFIX} )
165+ set (CORENRN_NMODL_INCLUDE ${CMAKE_BINARY_DIR} /include )
166+ endif ()
167+ include_directories (${CORENRN_NMODL_INCLUDE} )
166168 set (CORENRN_NMODL_FLAGS "" CACHE STRING "Extra NMODL options such as passes" )
167169 separate_arguments (NMODL_EXTRA_FLAGS_LIST UNIX_COMMAND "${CORENRN_NMODL_FLAGS} " )
168170else ()
169- # use mod2c if nmodl not enabled
170171 include (AddMod2cSubmodule)
171172 set (CORENRN_NMODL_BINARY ${CMAKE_BINARY_DIR} /bin/mod2c_core${CMAKE_EXECUTABLE_SUFFIX} )
173+ set (CORENRN_NMODL_INCLUDE ${CMAKE_BINARY_DIR} /include )
172174endif ()
173175
174176
@@ -230,7 +232,7 @@ if(cmake_generator_tolower MATCHES "makefile")
230232 message (STATUS "OpenMP | ${CORENRN_ENABLE_OPENMP} " )
231233 message (STATUS "NMODL | ${CORENRN_ENABLE_NMODL} " )
232234 if (CORENRN_ENABLE_NMODL)
233- message (STATUS " PATH | ${nmodl_BINARY } " )
235+ message (STATUS " PATH | ${CORENRN_NMODL_BINARY } " )
234236 message (STATUS " ISPC | ${CORENRN_ENABLE_ISPC} " )
235237 else ()
236238 message (STATUS "MOD2C | ${MOD2C_PROJ} " )
0 commit comments