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

Commit 85ef555

Browse files
committed
Fix for static library build and mpi with multiple directories
1 parent df59823 commit 85ef555

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

coreneuron/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,7 @@ set_target_properties(coreneuron PROPERTIES
305305
SOVERSION ${VERSION_MAJOR}
306306
CLEAN_DIRECT_OUTPUT 1)
307307

308+
set_property(TARGET coreneuron PROPERTY POSITION_INDEPENDENT_CODE ON)
308309

309310
# Extract link defs to the whole project
310311
get_target_property(CORENRN_LINK_LIBS coreneuron LINK_LIBRARIES)

extra/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ string(REPLACE ";" " " CORENRN_OPTMODS "${CORENRN_OPTMECH_MODS}")
2727
# PGI add --c++11;-A option for c++11 flag
2828
string(REPLACE ";" " " CXX11_STANDARD_COMPILE_OPTION "${CMAKE_CXX11_STANDARD_COMPILE_OPTION}")
2929

30+
31+
# MPI path might be multiple directories
32+
if (MPI_C_INCLUDE_PATH)
33+
string(REPLACE ";" " -I" CORENRN_MPI_INCLUDES "${MPI_C_INCLUDE_PATH}")
34+
endif()
35+
36+
3037
# Compiler flags depending on BUILD_TYPE shared as BUILD_TYPE_<LANG>_FLAGS
3138
string(TOUPPER "${CMAKE_BUILD_TYPE}" _BUILD_TYPE)
3239
set(BUILD_TYPE_C_FLAGS "${CMAKE_C_FLAGS_${_BUILD_TYPE}}")

extra/nrnivmodl_core_makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ CORENRNLIB_FLAGS = -L$(libdir) -lcoreneuron
2525

2626
# We rebuild the include dirs since a lot of stuff changes place
2727
INCLUDES = $(INCFLAGS) -I$(incdir) -I$(incdir)/coreneuron/utils/randoms
28-
ifneq (@MPI_C_INCLUDE_PATH@,)
29-
INCLUDES += -I@MPI_C_INCLUDE_PATH@
28+
ifneq (@CORENRN_MPI_INCLUDES@,)
29+
INCLUDES += -I@CORENRN_MPI_INCLUDES@
3030
endif
3131
ifneq (@reportinglib_INCLUDE_DIR@,)
3232
INCLUDES += -I@reportinglib_INCLUDE_DIR@

0 commit comments

Comments
 (0)