Skip to content

Commit

Permalink
Linked henson to ftk (#28)
Browse files Browse the repository at this point in the history
Created ftk_shared.so
  • Loading branch information
tpeterka authored Oct 25, 2024
1 parent 5fc8813 commit 9cda578
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ set (CMAKE_CXX_STANDARD_REQUIRED ON)

find_package (Threads REQUIRED)

# Henson
if (NOT DEFINED HENSON AND DEFINED ENV{HENSON})
set (HENSON $ENV{HENSON})
endif ()

if (HENSON)
set (HENSON_LIBRARY ${HENSON}/lib/libhenson.a)
set (HENSON_PMPI_LIBRARY ${HENSON}/lib/libhenson-pmpi.so)
else ()
message ("Looking for Henson")
find_package (henson REQUIRED)
endif ()
message ("HENSON_LIBRARY = ${HENSON_LIBRARY}")
message ("HENSON_PMPI_LIBRARY = ${HENSON_PMPI_LIBRARY}")
set (libraries ${libraries} ${HENSON_PMPI_LIBRARY} ${HENSON_LIBRARY})

if (FTK_USE_CGAL STREQUAL AUTO)
find_package (CGAL QUIET)
elseif (FTK_USE_CGAL)
Expand Down
20 changes: 20 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
if (NOT APPLE)
set (linker_flags "-pie -Wl,--export-dynamic")
set (linker_flags "${linker_flags} -Wl,-u,henson_set_contexts,-u,henson_set_namemap")
else ()
set (linker_flags "-Wl,-u,_henson_set_contexts,-u,_henson_set_namemap")
endif (NOT APPLE)

if (FTK_BUILD_PYFTK)
include_directories (${PYTHON_INCLUDE_DIRS})
endif ()
Expand Down Expand Up @@ -45,6 +52,12 @@ endif ()
add_library (libftk SHARED ${ftk_sources} ${ftk_cuda_sources} ${ftk_sycl_sources})
target_link_libraries (libftk ndarray::ndarray ${CMAKE_THREAD_LIBS_INIT})

add_library (ftk_shared SHARED cli/ftk.cpp)
target_link_libraries (ftk_shared PRIVATE libftk ${libraries})
set_target_properties (ftk_shared PROPERTIES PREFIX "")
set_target_properties (ftk_shared PROPERTIES SUFFIX ".so")
set_target_properties (ftk_shared PROPERTIES LINK_FLAGS ${linker_flags})

if (FTK_HAVE_ADIOS1)
target_link_libraries (libftk ${ADIOS_LIBRARIES})
endif ()
Expand Down Expand Up @@ -133,6 +146,13 @@ install (TARGETS libftk ftk
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install (TARGETS ftk_shared
DESTINATION ${CMAKE_INSTALL_BINDIR}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_WRITE GROUP_EXECUTE
WORLD_READ WORLD_WRITE WORLD_EXECUTE
)

install (EXPORT FTKTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/FTK
NAMESPACE FTK::)

0 comments on commit 9cda578

Please sign in to comment.