From 455f80b68b606e74f477713cf5415f9f4e603ead Mon Sep 17 00:00:00 2001 From: Adam Moody Date: Sat, 16 Dec 2023 13:29:01 -0800 Subject: [PATCH] define REDSET_ENABLE_MPI to pick up redset function declarations --- buildme_deps | 8 ++++---- src/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/buildme_deps b/buildme_deps index f274017..e2e851f 100755 --- a/buildme_deps +++ b/buildme_deps @@ -33,7 +33,7 @@ rm -rf KVTree/build mkdir KVTree/build cd KVTree/build -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DMPI=ON .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DBUILD_SHARED_LIBS=ON -DMPI=ON .. make clean make make install @@ -45,7 +45,7 @@ mkdir rankstr/build # rankstr cd rankstr/build -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DMPI=ON .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DBUILD_SHARED_LIBS=ON .. make clean make make install @@ -57,7 +57,7 @@ mkdir redset/build # redset cd redset/build -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DWITH_KVTREE_PREFIX=$installdir -DMPI=ON .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DBUILD_SHARED_LIBS=ON .. make clean make make install @@ -69,7 +69,7 @@ mkdir shuffile/build # shuffile cd shuffile/build -cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DWITH_KVTREE_PREFIX=$installdir -DMPI=ON .. +cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-O0" -DCMAKE_INSTALL_PREFIX=$installdir -DBUILD_SHARED_LIBS=ON .. make clean make make install diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f8e1e96..a70ef2e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -20,11 +20,13 @@ IF(BUILD_SHARED_LIBS) # ER Library ADD_LIBRARY(er_o OBJECT ${liber_srcs}) TARGET_LINK_LIBRARIES(er_o PRIVATE ${ER_EXTERNAL_LIBS}) + TARGET_COMPILE_DEFINITIONS(er_o PUBLIC REDSET_ENABLE_MPI) ADD_LIBRARY(er SHARED $) ADD_LIBRARY(er::er ALIAS er) TARGET_LINK_LIBRARIES(er PUBLIC ${ER_EXTERNAL_LIBS}) TARGET_INCLUDE_DIRECTORIES(er PUBLIC $ $) + TARGET_COMPILE_DEFINITIONS(er PUBLIC REDSET_ENABLE_MPI) SET_TARGET_PROPERTIES(er PROPERTIES OUTPUT_NAME er CLEAN_DIRECT_OUTPUT 1) INSTALL(TARGETS er EXPORT erTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) ENDIF() @@ -32,6 +34,7 @@ ENDIF() # ER Library ADD_LIBRARY(er_static_o OBJECT ${liber_srcs}) TARGET_LINK_LIBRARIES(er_static_o PRIVATE ${ER_EXTERNAL_STATIC_LIBS}) +TARGET_COMPILE_DEFINITIONS(er_static_o PUBLIC REDSET_ENABLE_MPI) ADD_LIBRARY(er-static STATIC $) ADD_LIBRARY(er::er-static ALIAS er-static) @@ -41,6 +44,7 @@ IF(ER_LINK_STATIC) ENDIF(ER_LINK_STATIC) TARGET_LINK_LIBRARIES(er-static PUBLIC ${ER_EXTERNAL_STATIC_LIBS}) TARGET_INCLUDE_DIRECTORIES(er-static PUBLIC $ $) +TARGET_COMPILE_DEFINITIONS(er-static PUBLIC REDSET_ENABLE_MPI) SET_TARGET_PROPERTIES(er-static PROPERTIES OUTPUT_NAME er CLEAN_DIRECT_OUTPUT 1) INSTALL(TARGETS er-static EXPORT erTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})