Skip to content

Commit 1692bf6

Browse files
CMake: Avoid building AMPI when ChaNGa is specified (#3474)
1 parent ffb3c2d commit 1692bf6

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ string(TOLOWER "${TARGET}" target_lower)
190190
if(${target_lower} STREQUAL "changa")
191191
set(TARGET "LIBS")
192192
set(LBUSERDATA 1)
193+
set(BUILD_CHANGA 1)
194+
else()
195+
set(BUILD_CHANGA 0)
193196
endif()
194197

195198
if(${TARGET} STREQUAL "everylb")
@@ -853,7 +856,7 @@ add_dependencies(moduletcharmmain ck)
853856
add_dependencies(moduletcharm ck)
854857
add_dependencies(tcharm-compat ck)
855858

856-
if(${TARGET} STREQUAL "AMPI" OR ${TARGET} STREQUAL "LIBS")
859+
if(${TARGET} STREQUAL "AMPI" OR (${TARGET} STREQUAL "LIBS" AND NOT BUILD_CHANGA))
857860
add_subdirectory(src/libs/ck-libs/ampi)
858861
endif()
859862

src/libs/ck-libs/CMakeLists.txt

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,16 +117,18 @@ configure_file(pose/libmodulepose.dep ${CMAKE_BINARY_DIR}/lib/libmoduleseqpose.d
117117

118118

119119
# idxl
120-
set(idxl-h-sources idxl/idxlc.h idxl/idxlf.h idxl/idxl.h idxl/idxl_layout.h idxl/idxl_comm.h)
121-
set(idxl-cxx-sources idxl/idxl.C idxl/idxl_layout.C idxl/idxl_comm.C idxl/idxl_api.C)
122-
add_library(idxl ${idxl-h-sources} ${idxl-cxx-sources})
123-
add_dependencies(idxl ck moduleampi)
120+
if(NOT BUILD_CHANGA)
121+
set(idxl-h-sources idxl/idxlc.h idxl/idxlf.h idxl/idxl.h idxl/idxl_layout.h idxl/idxl_comm.h)
122+
set(idxl-cxx-sources idxl/idxl.C idxl/idxl_layout.C idxl/idxl_comm.C idxl/idxl_api.C)
123+
add_library(idxl ${idxl-h-sources} ${idxl-cxx-sources})
124+
add_dependencies(idxl ck moduleampi)
124125

125-
set_target_properties(idxl PROPERTIES RULE_LAUNCH_COMPILE ${CMAKE_BINARY_DIR}/bin/ampicxx)
126+
set_target_properties(idxl PROPERTIES RULE_LAUNCH_COMPILE ${CMAKE_BINARY_DIR}/bin/ampicxx)
126127

127-
foreach(file ${idxl-h-sources})
128-
configure_file(${file} ${CMAKE_BINARY_DIR}/include COPYONLY)
129-
endforeach()
128+
foreach(file ${idxl-h-sources})
129+
configure_file(${file} ${CMAKE_BINARY_DIR}/include COPYONLY)
130+
endforeach()
131+
endif()
130132

131133

132134
# searchengine

0 commit comments

Comments
 (0)