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

Added Catalyst2 Build Support #3444

Open
wants to merge 5 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/catalyst.yml
@@ -0,0 +1,34 @@
name: 🐧 Catalyst

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}-${{ github.head_ref }}-insituvis
cancel-in-progress: true

jobs:
catalyst:
name: Catalyst
runs-on: ubuntu-22.04
if: github.event.pull_request.draft == false
env:
CXX: g++
CC: gcc
container:
image: cwetterernelson/catalyst:v2
steps:
- uses: actions/checkout@v4
- name: Configure
run: |
export Catalyst_DIR=${catalyst_DIR}
export Conduit_DIR=${Catalyst_DIR}
cmake -S . -B build \
Copy link
Member

Choose a reason for hiding this comment

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

@c-wetterer-nelson I think your docker container might have a small bug. It sets an env variable catalyst_DIR, but I think it needs to be case sensitive:

Suggested change
cmake -S . -B build \
export Catalyst_DIR=${catalyst_DIR}
cmake -S . -B build \

https://cmake.org/cmake/help/latest/command/find_package.html#config-mode-search-procedure

CMake Error at Tools/CMake/AMReXThirdPartyLibraries.cmake:97 (find_package):
  Could not find a package configuration file provided by "Catalyst" with any
  of the following names:

    CatalystConfig.cmake
    catalyst-config.cmake

Copy link
Member

Choose a reason for hiding this comment

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

An env hint for Conduit_DIR also needs to be set :)

-DCMAKE_BUILD_TYPE=Debug \
-DAMReX_ENABLE_TESTS=ON \
-DAMReX_FORTRAN=OFF \
-DAMReX_CATALYST=ON \
-DAMReX_CONDUIT=ON
- name: Build
run: |
cmake --build build -j 2

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
2 changes: 1 addition & 1 deletion Src/Extern/Conduit/AMReX_Conduit_Blueprint_ParticlesI.H
Expand Up @@ -389,4 +389,4 @@ ParticleContainerToBlueprint(const ParticleContainer_impl<ParticleType,



}
}
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
WeiqunZhang marked this conversation as resolved.
Show resolved Hide resolved
AMReX_Conduit_Blueprint.H
AMReX_Conduit_Blueprint.cpp
)
Expand Down
2 changes: 1 addition & 1 deletion Src/Extern/Conduit/Make.package
Expand Up @@ -3,7 +3,7 @@
#

CEXE_sources += AMReX_Conduit_Blueprint.cpp

CEXE_headers += AMReX_Conduit_Blueprint_ParticlesI.H
CEXE_headers += AMReX_Conduit_Blueprint.H

VPATH_LOCATIONS += $(AMREX_HOME)/Src/Extern/Conduit
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 @@ -321,6 +321,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