Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Tribol to codevelop build #985

Merged
merged 25 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a1b0b83
add tribol directory and submodule
ebchin Aug 18, 2023
2f14451
initial working codevelop build
ebchin Aug 19, 2023
8472094
Merge branch 'feature/chin23/contact_mechanics' into feature/chin23/t…
ebchin Aug 19, 2023
60022f1
get rid of examples and tests
ebchin Aug 19, 2023
90626d6
clean up export set tribol-targets
ebchin Aug 19, 2023
d0f3af3
only add redecomp if its built
ebchin Aug 19, 2023
6924465
Merge branch 'feature/chin23/contact_mechanics' into feature/chin23/t…
ebchin Aug 21, 2023
63c94c1
fix url; sync tribol commits
ebchin Aug 21, 2023
349b760
Merge branch 'feature/chin23/contact_mechanics' into feature/chin23/t…
ebchin Aug 22, 2023
bd3b3d8
Merge branch 'develop' into feature/chin23/tribol_submodule
ebchin Sep 25, 2023
6aa0a2f
update tribol submodule
ebchin Sep 25, 2023
3bff546
Merge branch 'feature/chin23/contact_mechanics' into feature/chin23/t…
ebchin Sep 25, 2023
a42579f
get rid of unneeded tribol targets
ebchin Sep 26, 2023
a1668e3
Merge branch 'feature/chin23/contact_mechanics' into feature/chin23/t…
ebchin Sep 26, 2023
91a347e
move method to cpp file
ebchin Sep 26, 2023
e26e443
Merge branch 'feature/chin23/contact_mechanics' into feature/chin23/t…
ebchin Nov 9, 2023
b3f9fde
Merge branch 'develop' into feature/chin23/tribol_submodule
ebchin Nov 10, 2023
a2fb383
update tribol repo
ebchin Nov 10, 2023
79ea0fe
turn off fortran for tribol
ebchin Nov 10, 2023
d8adbe5
Merge branch 'develop' into feature/chin23/tribol_submodule
jamiebramwell Nov 14, 2023
bd26dc2
add a note to get rid of tribols config header code
ebchin Nov 27, 2023
5976b5e
Merge branch 'develop' into feature/chin23/tribol_submodule
ebchin Nov 27, 2023
e0d5f97
Merge branch 'develop' into feature/chin23/tribol_submodule
ebchin Dec 4, 2023
5d79185
Merge branch 'develop' into feature/chin23/tribol_submodule
jamiebramwell Dec 8, 2023
020f77a
Merge branch 'develop' into feature/chin23/tribol_submodule
ebchin Dec 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@
[submodule "scripts/spack/radiuss-spack-configs"]
path = scripts/spack/radiuss-spack-configs
url = https://github.com/LLNL/radiuss-spack-configs.git
[submodule "tribol"]
path = tribol
url = https://github.com/mfem/mfem.git
chapman39 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ if (SERAC_ENABLE_CODEVELOP)
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/axom/src>
)

install(TARGETS mfem ${axom_exported_targets}
install(TARGETS mfem ${axom_exported_targets} ${tribol_exported_targets}
EXPORT serac-targets
DESTINATION lib
)
Expand Down
78 changes: 61 additions & 17 deletions cmake/thirdparty/SetupSeracThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -400,29 +400,73 @@ if (NOT SERAC_THIRD_PARTY_LIBRARIES_FOUND)
#------------------------------------------------------------------------------
# Tribol
#------------------------------------------------------------------------------
if(TRIBOL_DIR)
serac_assert_is_directory(VARIABLE_NAME TRIBOL_DIR)
if (NOT SERAC_ENABLE_CODEVELOP)
if(TRIBOL_DIR)
serac_assert_is_directory(VARIABLE_NAME TRIBOL_DIR)

find_package(tribol REQUIRED
NO_DEFAULT_PATH
PATHS ${TRIBOL_DIR}/lib/cmake)

find_package(tribol REQUIRED
NO_DEFAULT_PATH
PATHS ${TRIBOL_DIR}/lib/cmake)
if(TARGET tribol)
message(STATUS "Tribol CMake exported library loaded: tribol")
else()
message(FATAL_ERROR "Could not load Tribol CMake exported library: tribol")
endif()

if(TARGET tribol)
message(STATUS "Tribol CMake exported library loaded: tribol")
# Set include dir to system
set(TRIBOL_INCLUDE_DIR ${TRIBOL_DIR}/include)
set_property(TARGET tribol
APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
${TRIBOL_INCLUDE_DIR})
else()
message(FATAL_ERROR "Could not load Tribol CMake exported library: tribol")
set(TRIBOL_FOUND OFF)
endif()

# Set include dir to system
set(TRIBOL_INCLUDE_DIR ${TRIBOL_DIR}/include)
set_property(TARGET tribol
APPEND PROPERTY INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
${TRIBOL_INCLUDE_DIR})

message(STATUS "Tribol support is " ${TRIBOL_FOUND})
else()
set(TRIBOL_FOUND OFF)
# Otherwise we use the submodule
message(STATUS "Using Tribol submodule")
set(BUILD_REDECOMP ${ENABLE_MPI} CACHE BOOL "")
set(TRIBOL_USE_MPI ${ENABLE_MPI} CACHE BOOL "")
set(TRIBOL_ENABLE_TESTS OFF CACHE BOOL "")
set(TRIBOL_ENABLE_EXAMPLES OFF CACHE BOOL "")
set(TRIBOL_ENABLE_DOCS OFF CACHE BOOL "")
if(${PROJECT_NAME} STREQUAL "smith")
include(serac/tribol/cmake/TribolMacros.cmake)
add_subdirectory(${PROJECT_SOURCE_DIR}/serac/tribol/src ${CMAKE_BINARY_DIR}/tribol)
tribol_configure_file(${PROJECT_SOURCE_DIR}/serac/tribol/src/tribol/config.hpp.in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is tribol not configuring this file itself?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will when LLNL/Tribol#45 is merged in. Added a note here as a reminder to get rid of this when we update serac's Tribol again.

${PROJECT_BINARY_DIR}/serac/tribol/include/tribol/config.hpp)
else()
include(tribol/cmake/TribolMacros.cmake)
add_subdirectory(${PROJECT_SOURCE_DIR}/tribol/src ${CMAKE_BINARY_DIR}/tribol)
tribol_configure_file(${PROJECT_SOURCE_DIR}/tribol/src/tribol/config.hpp.in
${PROJECT_BINARY_DIR}/tribol/include/tribol/config.hpp)
endif()

target_include_directories(redecomp PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/tribol/src>
)

target_include_directories(tribol PUBLIC
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really wish I could figure out why these includes disappear. Axom does the same thing and I can't for the life of my figure out why.

$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/tribol/src>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/tribol/include>
$<INSTALL_INTERFACE:include>
)

set(tribol_depends axom mfem hdf5 sparsehash sol lua fmt)
blt_list_append(TO tribol_depends ELEMENTS mpi IF ENABLE_MPI)
blt_list_append(TO tribol_depends ELEMENTS openmp IF ENABLE_OPENMP)
install(TARGETS ${tribol_depends}
EXPORT tribol-targets
DESTINATION lib
)

set(tribol_exported_targets tribol)
blt_list_append(TO tribol_exported_targets ELEMENTS redecomp IF BUILD_REDECOMP)

set(TRIBOL_FOUND TRUE CACHE BOOL "" FORCE)
endif()

message(STATUS "Tribol support is " ${TRIBOL_FOUND})

#------------------------------------------------------------------------------
# PETSC
Expand Down
1 change: 1 addition & 0 deletions tribol
Submodule tribol added at 78f4b3