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 all 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/LLNL/Tribol.git
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,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
84 changes: 65 additions & 19 deletions cmake/thirdparty/SetupSeracThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -405,31 +405,77 @@ 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})
set(TRIBOL_FOUND ON)
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})

set(TRIBOL_FOUND ON)

message(STATUS "Tribol support is " ${TRIBOL_FOUND})
else()
set(TRIBOL_FOUND OFF)
set(ENABLE_FORTRAN OFF CACHE BOOL "" FORCE)
# 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)
# NOTE: This needs to be removed when Tribol PR #45 is merged and serac is updated
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)
# NOTE: This needs to be removed when Tribol PR #45 is merged and serac is updated
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 mfem)
blt_list_append(TO tribol_depends ELEMENTS mpi IF ENABLE_MPI)
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)
set(ENABLE_FORTRAN ON 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 892d27