Skip to content

Commit

Permalink
Added Catalyst build support
Browse files Browse the repository at this point in the history
Fixed Make.catalyst include directories
  • Loading branch information
andrewcombs committed Jul 24, 2023
1 parent 0eb494d commit 6d765f7
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Docs/sphinx_documentation/source/BuildingAMReX.rst
Expand Up @@ -508,6 +508,8 @@ The list of available options is reported in the :ref:`table <tab:cmakevar>` bel
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_CONDUIT | Enable Conduit support | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_CATALYST | Enable Catalyst support | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_ASCENT | Enable Ascent support | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_HYPRE | Enable HYPRE interfaces | NO | YES, NO |
Expand Down
3 changes: 1 addition & 2 deletions Src/CMakeLists.txt
Expand Up @@ -43,7 +43,6 @@ include(AMReXParallelBackends)
# Add definitions
#
include(AMReXSetDefines)

#
# Find and link third party libraries if needed
#
Expand Down Expand Up @@ -180,7 +179,7 @@ if (AMReX_SENSEI)
add_subdirectory(Extern/SENSEI)
endif ()

if (AMReX_CONDUIT OR AMReX_ASCENT)
if (AMReX_CONDUIT OR AMReX_ASCENT OR AMReX_CATALYST)
add_subdirectory(Extern/Conduit)
endif ()

Expand Down
1 change: 1 addition & 0 deletions Src/Extern/Conduit/CMakeLists.txt
Expand Up @@ -4,6 +4,7 @@ foreach(D IN LISTS AMReX_SPACEDIM)
# TODO: Particles PR merges another file
target_sources(amrex_${D}d
PRIVATE
AMReX_Conduit_Blueprint_ParticlesI.H
AMReX_Conduit_Blueprint.H
AMReX_Conduit_Blueprint.cpp
)
Expand Down
6 changes: 6 additions & 0 deletions Tools/CMake/AMReXConfig.cmake.in
Expand Up @@ -79,6 +79,7 @@ set(AMReX_PARTICLES_FOUND @AMReX_PARTICLES@)
set(AMReX_P@AMReX_PARTICLES_PRECISION@_FOUND ON)
set(AMReX_SENSEI_FOUND @AMReX_SENSEI@)
set(AMReX_CONDUIT_FOUND @AMReX_CONDUIT@)
set(AMReX_CATALYST_FOUND @AMReX_CATALYST@)
set(AMReX_ASCENT_FOUND @AMReX_ASCENT@)
set(AMReX_HYPRE_FOUND @AMReX_HYPRE@)
set(AMReX_PETSC_FOUND @AMReX_PETSC@)
Expand Down Expand Up @@ -131,6 +132,7 @@ set(AMReX_PARTICLES_PRECISION @AMReX_PARTICLES_PRECISION@)
set(AMReX_SENSEI @AMReX_SENSEI@)
set(AMReX_NO_SENSEI_AMR_INST @AMReX_NO_SENSEI_AMR_INST@)
set(AMReX_CONDUIT @AMReX_CONDUIT@)
set(AMReX_CATALYST @AMReX_CATALYST@)
set(AMReX_ASCENT @AMReX_ASCENT@)
set(AMReX_HYPRE @AMReX_HYPRE@)
set(AMReX_PETSC @AMReX_PETSC@)
Expand Down Expand Up @@ -197,6 +199,10 @@ if (@AMReX_ASCENT@)
find_dependency(Ascent REQUIRED)
endif ()

if (@AMReX_CATALYST@)
find_dependency(Catalyst REQUIRED)
endif ()

if (@AMReX_CONDUIT@)
find_dependency(Conduit REQUIRED)
endif ()
Expand Down
5 changes: 5 additions & 0 deletions Tools/CMake/AMReXOptions.cmake
Expand Up @@ -319,6 +319,11 @@ print_option( AMReX_NO_SENSEI_AMR_INST )
option( AMReX_CONDUIT "Enable Conduit support" OFF )
print_option( AMReX_CONDUIT )

# Catalyst
cmake_dependent_option( AMReX_CATALYST "Enable Catalyst support" OFF
"AMReX_CONDUIT" OFF )
print_option( AMReX_CATALYST )

# Ascent
cmake_dependent_option( AMReX_ASCENT "Enable Ascent support" OFF
"AMReX_CONDUIT" OFF )
Expand Down
3 changes: 3 additions & 0 deletions Tools/CMake/AMReXSetDefines.cmake
Expand Up @@ -138,6 +138,9 @@ add_amrex_define( AMREX_NO_SENSEI_AMR_INST NO_LEGACY IF AMReX_NO_SENSEI_AMR_INST
# Conduit Support
add_amrex_define( AMREX_USE_CONDUIT NO_LEGACY IF AMReX_CONDUIT )

# Catalyst Support
add_amrex_define( AMREX_USE_CATALYST NO_LEGACY IF AMReX_CATALYST )

# Ascent Support
add_amrex_define( AMREX_USE_ASCENT NO_LEGACY IF AMReX_ASCENT )

Expand Down
9 changes: 9 additions & 0 deletions Tools/CMake/AMReXThirdPartyLibraries.cmake
Expand Up @@ -90,6 +90,15 @@ if (AMReX_ASCENT) # Ascent will find conduit, so check for Ascent first
endforeach()
endif ()

#
# Catalyst
#
if (AMReX_CATALYST)
find_package(Catalyst REQUIRED PATHS "$ENV{CATALYST_IMPLEMENTATION_PATHS}")
foreach(D IN LISTS AMReX_SPACEDIM)
target_link_libraries(amrex_${D}d PUBLIC catalyst::catalyst)
endforeach()
endif ()

#
# Conduit
Expand Down
1 change: 1 addition & 0 deletions Tools/CMake/AMReX_Config_ND.H.in
Expand Up @@ -41,6 +41,7 @@
#cmakedefine AMREX_USE_SENSEI_INSITU
#cmakedefine AMREX_NO_SENSEI_AMR_INST
#cmakedefine AMREX_USE_CONDUIT
#cmakedefine AMREX_USE_CATALYST
#cmakedefine AMREX_USE_ASCENT
#cmakedefine AMREX_USE_EB
#cmakedefine AMREX_USE_CUDA
Expand Down
11 changes: 11 additions & 0 deletions Tools/GNUMake/Make.defs
Expand Up @@ -216,6 +216,12 @@ else
USE_CONDUIT := FALSE
endif

ifdef USE_CATALYST
USE_CATALYST := $(strip $(USE_CATALYST))
else
USE_CATALYST := FALSE
endif

ifdef USE_ASCENT
USE_ASCENT := $(strip $(USE_ASCENT))
else
Expand Down Expand Up @@ -1042,6 +1048,11 @@ ifeq ($(USE_CONDUIT),TRUE)
include $(AMREX_HOME)/Tools/GNUMake/packages/Make.conduit
endif

ifeq ($(USE_CATALYST),TRUE)
$(info Loading $(AMREX_HOME)/Tools/GNUMake/packages/Make.catalyst...)
include $(AMREX_HOME)/Tools/GNUMake/packages/Make.catalyst
endif

ifeq ($(USE_ASCENT),TRUE)
$(info Loading $(AMREX_HOME)/Tools/GNUMake/packages/Make.ascent...)
include $(AMREX_HOME)/Tools/GNUMake/packages/Make.ascent
Expand Down
16 changes: 16 additions & 0 deletions Tools/GNUMake/packages/Make.catalyst
@@ -0,0 +1,16 @@
#########################################################
# Catalyst (https://gitlab.kitware.com/paraview/catalyst) Support
#########################################################

CPPFLAGS += -DAMREX_USE_CATALYST

ifdef CATALYST_DIR
INCLUDE_LOCATIONS += $(CATALYST_DIR)/../../../src
VPATH_LOCATIONS += $(CATALYST_DIR)/../../../src
LIBRARY_LOCATIONS += $(CATALYST_DIR)/../../
LIBRARIES += -Wl,-rpath,$(CATALYST_DIR)/../../

LIBRARIES += -lcatalyst

endif

0 comments on commit 6d765f7

Please sign in to comment.