Skip to content

Commit

Permalink
Update SUNDIALS GNUMake (#4344)
Browse files Browse the repository at this point in the history
Update `Make.sundials` to align with the other external package makefiles
  • Loading branch information
gardner48 authored Feb 23, 2025
1 parent b8a1a39 commit 044d52f
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Tools/GNUMake/packages/Make.sundials
Original file line number Diff line number Diff line change
@@ -1,3 +1,41 @@

CPPFLAGS += -DAMREX_USE_SUNDIALS
include $(AMREX_HOME)/Src/Extern/SUNDIALS/Make.package

ifndef AMREX_SUNDIALS_HOME
ifdef SUNDIALS_DIR
AMREX_SUNDIALS_HOME = $(SUNDIALS_DIR)
endif
ifdef SUNDIALS_HOME
AMREX_SUNDIALS_HOME = $(SUNDIALS_HOME)
endif
endif

ifdef AMREX_SUNDIALS_HOME
SUNDIALS_ABSPATH = $(abspath $(AMREX_SUNDIALS_HOME))
SYSTEM_INCLUDE_LOCATIONS += $(SUNDIALS_ABSPATH)/include
LIBRARY_LOCATIONS += $(SUNDIALS_ABSPATH)/lib
LIBRARY_LOCATIONS += $(SUNDIALS_ABSPATH)/lib64
# libraries are usually installed under lib or lib64 depending on the system
LIBRARIES += -Wl,-rpath,$(SUNDIALS_ABSPATH)/lib
LIBRARIES += -Wl,-rpath,$(SUNDIALS_ABSPATH)/lib64
LIBRARIES += -lsundials_arkode -lsundials_cvode -lsundials_nvecmanyvector

ifeq ($(USE_CUDA),TRUE)
LIBRARIES += -lsundials_nveccuda
endif

ifeq ($(USE_HIP),TRUE)
LIBRARIES += -lsundials_nvechip
endif

ifeq ($(USE_SYCL),TRUE)
LIBRARIES += -lsundials_nvecsycl
endif

# sundials_core library added in sundials v7.0.0
ifneq ($(wildcard $(SUNDIALS_ABSPATH)/lib*/libsundials_core.*),)
LIBRARIES += -lsundials_core
endif

endif

0 comments on commit 044d52f

Please sign in to comment.