Skip to content

Commit

Permalink
bugfix: change linker flag option for mac builds of charm4py (#3797)
Browse files Browse the repository at this point in the history
* bugfix: use CMK_SHARED_SUF instead of a hardcoded .so

* comment out configure lines to allow charm4py build to proceed

* Replace whole archive flag with all_load flag for macs

---------

Co-authored-by: Eric J Bohm <[email protected]>
Co-authored-by: Ritvik Rao <[email protected]>
Co-authored-by: Zane Fink <[email protected]>
  • Loading branch information
4 people authored May 2, 2024
1 parent 192db62 commit 56ca52a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,11 @@ if(${TARGET} STREQUAL "charm4py")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
add_library(charm SHARED empty.cpp)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib_so)
target_link_libraries(charm ck converse memory-default threads-default ldb-rand "-Llib/ -standalone -whole-archive -c++stl -shared")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
target_link_libraries(charm ck converse memory-default threads-default ldb-rand "-Llib/ -standalone -all_load -c++stl -shared")
else()
target_link_libraries(charm ck converse memory-default threads-default ldb-rand "-Llib/ -standalone -whole-archive -c++stl -shared")
endif()

add_dependencies(charm hwloc)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ AMPIC AMPIF: AMPI
f90charm: charm++

libcharm: charm++
cd $(L) ; $(CHARMC) -standalone -whole-archive -c++stl -shared -o libcharm.so $(LIBCHARM_LIBS)
cd $(L) ; $(CHARMC) -standalone -whole-archive -c++stl -shared -o libcharm.$(CMK_SHARED_SUF) $(LIBCHARM_LIBS)

charm4py: libcharm

Expand Down

0 comments on commit 56ca52a

Please sign in to comment.