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

Commit 487e020

Browse files
authored
Fix building without MPI. (#811)
1 parent d07bae0 commit 487e020

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

coreneuron/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ set(SCOPMATH_CODE_FILES
3535
"sim/scopmath/abort.cpp" "sim/scopmath/crout_thread.cpp" "sim/scopmath/newton_thread.cpp"
3636
"sim/scopmath/sparse_thread.cpp" "sim/scopmath/ssimplic_thread.cpp")
3737
set(MPI_LIB_FILES "mpi/lib/mpispike.cpp" "mpi/lib/nrnmpi.cpp")
38-
set(MPI_CORE_FILES "mpi/core/nrnmpi_def_cinc.cpp" "mpi/core/nrnmpi.cpp" "mpi/core/nrnmpidec.cpp")
38+
set(MPI_CORE_FILES "mpi/core/nrnmpi_def_cinc.cpp")
39+
if(CORENRN_ENABLE_MPI)
40+
# Building these requires -ldl, which is only added if MPI is enabled.
41+
list(APPEND MPI_CORE_FILES "mpi/core/nrnmpi.cpp" "mpi/core/nrnmpidec.cpp")
42+
endif()
3943
file(COPY ${CORENEURON_PROJECT_SOURCE_DIR}/external/Random123/include/Random123
4044
DESTINATION ${CMAKE_BINARY_DIR}/include)
4145
list(APPEND CORENEURON_CODE_FILES ${PROJECT_BINARY_DIR}/coreneuron/config/config.cpp)

0 commit comments

Comments
 (0)