Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,6 @@ install(TARGETS smith
DESTINATION lib
)

if (SMITH_ENABLE_CODEVELOP)
install(TARGETS mfem ${axom_exported_targets} ${tribol_exported_targets}
EXPORT smith-targets
DESTINATION lib
)
endif()

install(EXPORT smith-targets
NAMESPACE smith::
DESTINATION lib/cmake
Expand Down
2 changes: 1 addition & 1 deletion axom
Submodule axom updated 1165 files
49 changes: 26 additions & 23 deletions cmake/smith-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if(NOT SMITH_FOUND)
set(SMITH_USE_SUNDIALS @SMITH_USE_SUNDIALS@)
set(SMITH_USE_TRIBOL @SMITH_USE_TRIBOL@)
set(SMITH_USE_UMPIRE @SMITH_USE_UMPIRE@)

set(SMITH_ADIAK_DIR "@ADIAK_DIR@")
set(SMITH_ARPACK_DIR "@ARPACK_DIR@")
set(SMITH_AXOM_DIR "@AXOM_DIR@")
Expand All @@ -69,19 +69,14 @@ if(NOT SMITH_FOUND)
set(SMITH_UMPIRE_DIR "@UMPIRE_DIR@")

# TPLs that are be included in our build
set(SMITH_CONTINUATION_DIR "@SMITH_INSTALL_PREFIX@")
set(SMITH_GRETL_DIR "@SMITH_INSTALL_PREFIX@")
set(SMITH_CONTINUATION_DIR "${SMITH_INSTALL_PREFIX}")
set(SMITH_GRETL_DIR "${SMITH_INSTALL_PREFIX}")

# Tribol may be included in our build
if(SMITH_USE_TRIBOL AND NOT SMITH_TRIBOL_DIR)
set(SMITH_TRIBOL_DIR "@SMITH_INSTALL_PREFIX@")
set(_tribol_included TRUE)
else()
set(_tribol_included FALSE)
endif()

if (NOT BLT_LOADED)
include("${CMAKE_CURRENT_LIST_DIR}/BLTInstallableMacros.cmake")
if(SMITH_USE_TRIBOL)
if (SMITH_ENABLE_CODEVELOP OR NOT SMITH_TRIBOL_DIR)
set(SMITH_TRIBOL_DIR "${SMITH_INSTALL_PREFIX}")
endif()
endif()

# Codevelop TPLs are installed alongside Smith
Expand All @@ -90,6 +85,10 @@ if(NOT SMITH_FOUND)
set(SMITH_MFEM_DIR "${SMITH_INSTALL_PREFIX}")
endif()

if (NOT BLT_LOADED)
include("${CMAKE_CURRENT_LIST_DIR}/BLTInstallableMacros.cmake")
endif()

# Set to real variable unless user overrode it
foreach(dep @SMITH_TPL_DEPS@)
if (NOT ${dep}_DIR)
Expand All @@ -113,7 +112,7 @@ if(NOT SMITH_FOUND)
endif()

# ARPACK
if(SMITH_USE_ARPACK)
if(SMITH_USE_ARPACK AND NOT TARGET arpack)
blt_import_library(NAME arpack
INCLUDES @ARPACK_INCLUDE_DIRS@
LIBRARIES @ARPACK_LIBRARIES@
Expand Down Expand Up @@ -151,6 +150,14 @@ if(NOT SMITH_FOUND)
find_dependency(raja REQUIRED PATHS "${RAJA_DIR}")
endif()

# Strumpack
if (SMITH_USE_STRUMPACK)
find_dependency(strumpack CONFIG
PATHS "${STRUMPACK_DIR}"
"${STRUMPACK_DIR}/lib/cmake/STRUMPACK"
"${STRUMPACK_DIR}/lib64/cmake/STRUMPACK")
endif()

# MFEM
if(SMITH_USE_MFEM AND NOT TARGET mfem)
set(SMITH_MFEM_BUILT_WITH_CMAKE @MFEM_BUILT_WITH_CMAKE@)
Expand Down Expand Up @@ -178,6 +185,11 @@ if(NOT SMITH_FOUND)
find_dependency(Enzyme REQUIRED REQUIRED NO_DEFAULT_PATH PATHS "${ENZYME_DIR}")
endif()

# Tribol
if(SMITH_USE_TRIBOL)
find_dependency(tribol REQUIRED PATHS "${TRIBOL_DIR}/lib/cmake")
endif()

# Gretl
if(SMITH_USE_GRETL)
find_dependency(gretl REQUIRED PATHS "${GRETL_DIR}/lib/cmake")
Expand All @@ -197,18 +209,9 @@ if(NOT SMITH_FOUND)
get_filename_component(SMITH_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include(${SMITH_CMAKE_CONFIG_DIR}/BLTSetupTargets.cmake)

# Tribol (uses BLTSetupTargets.cmake)
if(SMITH_USE_TRIBOL)
if(NOT _tribol_included)
find_dependency(tribol REQUIRED PATHS "${TRIBOL_DIR}/lib/cmake")
else()
include(${SMITH_CMAKE_CONFIG_DIR}/tribol-targets.cmake)
endif()
endif()

# SLEPc requires ARPACK, but MFEM omits it from its exported link interface.
if(SMITH_USE_ARPACK)
foreach(_target mfem axom::mfem tribol::mfem)
foreach(_target mfem)
if(TARGET ${_target})
target_link_libraries(${_target} INTERFACE arpack)
endif()
Expand Down
18 changes: 9 additions & 9 deletions cmake/thirdparty/SetupSmithThirdParty.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,18 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
#------------------------------------------------------------------------------
# Conduit (found via Axom)
#------------------------------------------------------------------------------
if(NOT CONDUIT_DIR)
if(CONDUIT_DIR)
set(CONDUIT_FOUND TRUE)
else()
MESSAGE(FATAL_ERROR "Could not find Conduit. Conduit requires explicit CONDUIT_DIR.")
endif()

#------------------------------------------------------------------------------
# HDF5 (found via Axom)
#------------------------------------------------------------------------------
if (NOT HDF5_DIR)
if (HDF5_DIR)
set(HDF5_FOUND TRUE)
else()
MESSAGE(FATAL_ERROR "Could not find HDF5. HDF5 requires explicit HDF5_DIR.")
endif()

Expand Down Expand Up @@ -657,21 +661,19 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)


#---------------------------------------------------------------------------
# Remove non-existant INTERFACE_INCLUDE_DIRECTORIES from imported targets
# Remove non-existent INTERFACE_INCLUDE_DIRECTORIES from imported targets
# to work around CMake error
#---------------------------------------------------------------------------
set(_imported_targets
axom
axom::mfem
conduit
conduit::conduit_mpi
conduit::conduit
conduit_relay_mpi
conduit_relay_mpi_io
conduit_blueprint
conduit_blueprint_mpi
mfem
tribol::mfem)
mfem)

foreach(_target ${_imported_targets})
if(TARGET ${_target})
Expand All @@ -697,9 +699,7 @@ if (NOT SMITH_THIRD_PARTY_LIBRARIES_FOUND)
# the correct MPI lib directory. This guards against that.
# https://github.com/spack/spack/issues/24685
set(_mfem_targets
mfem
axom::mfem
tribol::mfem)
mfem)
if(STRUMPACK_FOUND)
list(GET MPI_C_LIBRARIES 0 _first_mpi_lib)
get_filename_component(_mpi_lib_dir ${_first_mpi_lib} DIRECTORY)
Expand Down
5 changes: 1 addition & 4 deletions examples/using-with-cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,18 @@ include(CMakeFindDependencyMacro)
find_dependency(smith REQUIRED NO_DEFAULT_PATH PATHS "${SMITH_DIR}/lib/cmake")

#---------------------------------------------------------------------------
# Remove non-existant INTERFACE_INCLUDE_DIRECTORIES from imported targets
# Remove non-existent INTERFACE_INCLUDE_DIRECTORIES from imported targets
# to work around CMake error
#---------------------------------------------------------------------------
set(_imported_targets
axom
axom::mfem
conduit
conduit::conduit_mpi
conduit::conduit
conduit_relay_mpi
conduit_relay_mpi_io
conduit_blueprint
conduit_blueprint_mpi
tribol::mfem
smith::mfem
mfem)

foreach(_target ${_imported_targets})
Expand Down
2 changes: 1 addition & 1 deletion tribol