Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/gcc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ jobs:
# Build and install libamrex as AMReX CMake project
# Note: this is an intentional "minimal" build that does not enable (many) options
library:
name: GNU@14 Release [lib]
name: GNU@11 Release [lib]
runs-on: ubuntu-24.04
needs: check_changes
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
steps:
- uses: actions/checkout@v6
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies_gcc.sh 14
.github/workflows/dependencies/dependencies_gcc.sh 11
.github/workflows/dependencies/dependencies_clang-tidy-apt-llvm.sh 21
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
Expand Down Expand Up @@ -57,9 +57,9 @@ jobs:
-DAMReX_PLOTFILE_TOOLS=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \
-DCMAKE_C_COMPILER=$(which gcc-14) \
-DCMAKE_CXX_COMPILER=$(which g++-14) \
-DCMAKE_Fortran_COMPILER=$(which gfortran-14) \
-DCMAKE_C_COMPILER=$(which gcc-11) \
-DCMAKE_CXX_COMPILER=$(which g++-11) \
-DCMAKE_Fortran_COMPILER=$(which gfortran-11) \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
make -j 4
make install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/hypre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
- uses: actions/checkout@v6
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies_nvcc.sh 12.0
sudo apt-get install -y libcublas-dev-12.0
.github/workflows/dependencies/dependencies_nvcc.sh 12.2
sudo apt-get install -y libcublas-dev-12.2
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v5
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sundials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: actions/checkout@v6
- name: Dependencies
run: |
.github/workflows/dependencies/dependencies_nvcc.sh
.github/workflows/dependencies/dependencies_nvcc.sh 12.2
.github/workflows/dependencies/dependencies_ccache.sh
- name: Set Up Cache
uses: actions/cache@v5
Expand All @@ -103,7 +103,7 @@ jobs:
ccache -z
# sundials requirement
sudo apt-get install -y libcusolver-dev-12-0 libcusparse-dev-12-0 libcublas-dev-12-0
sudo apt-get install -y libcusolver-dev-12-2 libcusparse-dev-12-2 libcublas-dev-12-2
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
which nvcc || echo "nvcc not in PATH!"
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ endif ()
#
# Check compiler version
#
set_mininum_compiler_version(CXX GNU 5.1)
set_mininum_compiler_version(CXX MSVC 19.23)
set_mininum_compiler_version(CXX GNU 11.0)
set_mininum_compiler_version(CXX Clang 14.0)
set_mininum_compiler_version(CXX AppleClang 14.0)
set_mininum_compiler_version(CXX MSVC 19.34)

#
# Set CMAKE_<LANG>_FLAGS_<CONFIG> if not already defined
Expand Down
11 changes: 5 additions & 6 deletions Docs/sphinx_documentation/source/BuildingAMReX.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ list of important variables.
| COMP | gnu, cray, ibm, intel, intel-llvm, | |
| | intel-classic, llvm, or pgi | none |
+-----------------+-------------------------------------+--------------------+
| CXXSTD | C++ standard (``c++17``, ``c++20``) | compiler default, |
| | | at least ``c++17`` |
| CXXSTD | C++ standard (e.g., ``c++20``) | compiler default, |
| | | at least ``c++20`` |
+-----------------+-------------------------------------+--------------------+
| DEBUG | TRUE or FALSE | FALSE |
+-----------------+-------------------------------------+--------------------+
Expand Down Expand Up @@ -123,7 +123,6 @@ MPI with support for concurrent MPI calls from multiple threads.
Variables ``USE_CUDA``, ``USE_HIP`` and ``USE_SYCL`` are used for
targeting Nvidia, AMD and Intel GPUs, respectively. At most one of
the three can be TRUE.
For HIP and SYCL builds, we currently test only against C++17 builds.

The variable ``USE_RPATH`` controls the link mechanism to dependent libraries.
If enabled, the library path at link time will be saved as a
Expand Down Expand Up @@ -435,15 +434,15 @@ The list of available options is reported in the :ref:`table <tab:cmakevar>` bel
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| CMAKE_CXX_FLAGS | User-defined C++ flags | | user-defined |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| CMAKE_CXX_STANDARD | C++ standard | compiler/17 | 17, 20 |
| CMAKE_CXX_STANDARD | C++ standard | compiler/20 | 20, 23 |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_SPACEDIM | Dimension of AMReX build | 3 ``;``-separated list | "1;2;3" |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| USE_XSDK_DEFAULTS | Use xSDK defaults settings | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_BUILD_SHARED_LIBS | Build as shared C++ library | NO (unless xSDK) | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_FASTMATH | Enable fast-math optimizations | NO (CUDA is ON) | YES, NO |
| AMReX_FASTMATH | Enable fast-math optimizations | NO (CUDA is ON) | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
| AMReX_FORTRAN | Enable Fortran language | NO | YES, NO |
+------------------------------+-------------------------------------------------+-------------------------+-----------------------+
Expand Down Expand Up @@ -781,7 +780,7 @@ The AMReX team does development on Linux machines, from laptops to supercomputer
We do not officially support AMReX on Windows, and many of us do not have access to any Windows
machines. However, we believe there are no fundamental issues for it to work on Windows.

(1) AMReX mostly uses standard C++17.
(1) AMReX mostly uses standard C++20.
We run continuous integration tests on Windows with MSVC and Clang compilers.

(2) We use POSIX signal handling when floating-point exceptions, segmentation faults, etc. happen.
Expand Down
11 changes: 10 additions & 1 deletion Docs/sphinx_documentation/source/BuildingAMReX_Chapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@ an application code then uses its own build system and links to AMReX as an exte

Finally, AMReX can also be built with CMake, as detailed in the section on :ref:`sec:build:cmake`.

AMReX requires a C++ compiler that supports the C++17 standard, a
AMReX requires a C++ compiler that supports the C++20 standard, a
Fortran compiler that supports the Fortran 2003 standard, and a C
compiler that supports the C99 standard. Prerequisites for building
with GNU Make include Python (>= 2.7, including 3) and standard tools
available in any Unix-like environment (e.g., Perl and sed). For
building with CMake, the minimal requirement is version 3.18.

The minimum toolchain versions we target for C++20 builds are:

* GCC 11 or newer (for both host builds and CUDA host compilers).
* LLVM Clang 14 or newer, including AppleClang 14 on macOS.
* Microsoft Visual Studio 2022 (MSVC 19.34 / 17.4) or newer.
* NVIDIA CUDA Toolkit 12.2 or newer.
* AMD ROCm/HIP 6.0 or newer.
* Intel oneAPI DPC++ 2025.2 or newer.

Please note that we fully support AMReX for Linux systems in general and on the
DOE supercomputers (e.g., Perlmutter, Frontier) in particular. Many of our users do build
and use AMReX on Macs but we do not have the resources to fully support Mac users.
Expand Down
2 changes: 1 addition & 1 deletion Docs/sphinx_documentation/source/GPU.rst
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ If autodetection fails, a list of "common" architectures is assumed.
Building for multiple CUDA architectures will generally result in a larger library and longer build times.

**Note that AMReX supports NVIDIA GPU architectures with compute capability 6.0 or higher and
CUDA Toolkit version 11.0 or higher.**
CUDA Toolkit version 12.2 or higher.**

In order to import the CUDA-enabled AMReX library into your CMake project, you need to include
the following code into the appropriate CMakeLists.txt file:
Expand Down
4 changes: 2 additions & 2 deletions Docs/sphinx_documentation/source/GPU_Chapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ NVIDIA, AMD, and Intel GPUs using their native vendor languages and therefore
requires CUDA, HIP/ROCm, and SYCL for NVIDIA, AMD, and Intel GPUs, respectively.
Users can also use OpenMP and/or OpenACC in their applications if desired.

AMReX supports NVIDIA GPUs with compute capability >= 6 and CUDA >= 11, and
AMD GPUs with ROCm >= 5. While SYCL compilers are still under development in
AMReX supports NVIDIA GPUs with compute capability >= 6 and CUDA >= 12.2, and
AMD GPUs with ROCm >= 6. While SYCL compilers are still under development in
preparation for Aurora, AMReX officially supports only the latest publicly
released version of the oneAPI compiler.

Expand Down
3 changes: 1 addition & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ There are three ways to use AMReX.
Fortran modules via `./configure` followed by `make` and `make
install`. Type `./configure -h` to show help message. An
application code uses its build system to compile and link to the
AMReX library. Because AMReX uses C++17 and Fortran, the linker
AMReX library. Because AMReX uses C++20 and Fortran, the linker
needs to link the libraries. See
`Tutorials/Basic/Build_with_libamrex` for an example of this
approach. Note that this approach relies the make system in
Expand All @@ -20,4 +20,3 @@ There are three ways to use AMReX.
(3) CMake. See the "Building with CMake" page in the AMReX documentation
page at the link below for more details.
https://amrex-codes.github.io/amrex/docs_html/BuildingAMReX.html#building-with-cmake

4 changes: 0 additions & 4 deletions Tests/CTOParFor/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using namespace amrex;
int main (int argc, char* argv[])
{
amrex::Initialize(argc,argv);
#if (__cplusplus >= 201703L)
{
enum A_options: int {
A0 = 0, A1
Expand Down Expand Up @@ -57,8 +56,5 @@ int main (int argc, char* argv[])
}
}
}
#else
amrex::Print() << "This test requires C++17." << '\n';
#endif
amrex::Finalize();
}
6 changes: 3 additions & 3 deletions Tools/CMake/AMReXParallelBackends.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ if ( AMReX_GPU_BACKEND STREQUAL "CUDA"
endforeach()

# Check cuda compiler and host compiler
set_mininum_compiler_version(CUDA NVIDIA 9.0)
set_mininum_compiler_version(CUDA NVIDIA 12.2)
check_cuda_host_compiler()

# Required CUDA flags
Expand Down Expand Up @@ -366,8 +366,8 @@ if (AMReX_HIP)
#
target_compile_options(amrex_${D}d PUBLIC $<$<COMPILE_LANGUAGE:CXX>:-munsafe-fp-atomics>)

# Ensure ROCm builds enable at least C++17 without overriding higher standards
target_compile_features(amrex_${D}d PUBLIC cxx_std_17)
# Ensure ROCm builds enable at least C++20 without overriding higher standards
target_compile_features(amrex_${D}d PUBLIC cxx_std_20)
endforeach()

# Equivalently, relocatable-device-code (RDC) flags are needed for `extern`
Expand Down
2 changes: 1 addition & 1 deletion Tools/CMake/AMReXSYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set(_cxx_sycl "$<AND:$<COMPILE_LANGUAGE:CXX>,${_cxx_sycl}>")
add_library(SYCL INTERFACE)
add_library(AMReX::SYCL ALIAS SYCL)

target_compile_features(SYCL INTERFACE cxx_std_17)
target_compile_features(SYCL INTERFACE cxx_std_20)


#
Expand Down
16 changes: 5 additions & 11 deletions Tools/CMake/AMReX_Config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,18 @@ function (configure_amrex AMREX_TARGET)
#
# Setup compilers
#
# Set C++ standard and disable compiler-specific extensions, like "-std=gnu++17" for GNU
# Set C++ standard and disable compiler-specific extensions, like "-std=gnu++20" for GNU
# This will also enforce the same standard with the CUDA compiler
# Moreover, it will also enforce such standard on all the consuming targets
#
set_target_properties(${AMREX_TARGET} PROPERTIES CXX_EXTENSIONS OFF)
# minimum: C++17
target_compile_features(${AMREX_TARGET} PUBLIC cxx_std_17)

# vir::cvt
# https://github.com/mattkretz/vir-simd/issues/45
if (AMReX_SIMD)
target_compile_features(${AMREX_TARGET} PUBLIC cxx_std_20)
endif()
# minimum: C++20
target_compile_features(${AMREX_TARGET} PUBLIC cxx_std_20)

if (AMReX_CUDA)
set_target_properties(${AMREX_TARGET} PROPERTIES CUDA_EXTENSIONS OFF)
# minimum: C++17
target_compile_features(${AMREX_TARGET} PUBLIC cuda_std_17)
# minimum: C++20
target_compile_features(${AMREX_TARGET} PUBLIC cuda_std_20)
endif()

#
Expand Down
2 changes: 1 addition & 1 deletion Tools/CMake/AMReX_SetupCUDA.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ endif ()
# Check CUDA compiler and host compiler
#
include(AMReXUtils)
set_mininum_compiler_version(CUDA NVIDIA 10.0)
set_mininum_compiler_version(CUDA NVIDIA 12.2)
check_cuda_host_compiler()

#
Expand Down
4 changes: 2 additions & 2 deletions Tools/GNUMake/comps/armclang.mak
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ ifeq ($(WARN_ERROR),TRUE)
endif

# disable some warnings
CXXFLAGS += -Wno-c++17-extensions
# CXXFLAGS += -Wno-c++20-extensions # Do we need it?

########################################################################

ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
else
CXXSTD := c++17
CXXSTD := c++20
endif

CXXFLAGS += -std=$(CXXSTD)
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/cray.mak
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ endif
ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
else
CXXSTD := c++17
CXXSTD := c++20
endif

ifeq ($(CRAY_IS_CLANG_BASED),TRUE)
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/dpcpp.mak
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ endif
ifdef CXXSTD
CXXFLAGS += -std=$(strip $(CXXSTD))
else
CXXFLAGS += -std=c++17
CXXFLAGS += -std=c++20
endif

CXXFLAGS += -fsycl
Expand Down
6 changes: 3 additions & 3 deletions Tools/GNUMake/comps/gnu.mak
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ gcc_major_ge_12 = $(shell expr $(gcc_major_version) \>= 12)
INLINE_LIMIT ?= 43210

ifneq ($(NO_CONFIG_CHECKING),TRUE)
ifneq ($(gcc_major_ge_8),1)
$(error GCC < 8 not supported)
ifneq ($(gcc_major_ge_11),1)
$(error GCC < 11 not supported)
endif
endif

Expand Down Expand Up @@ -148,7 +148,7 @@ ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
CXXFLAGS += -std=$(CXXSTD)
else
CXXFLAGS += -std=c++17
CXXFLAGS += -std=c++20
endif

CFLAGS += -std=c11
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/hip.mak
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ F90 = gfortran
ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
else
CXXSTD := c++17
CXXSTD := c++20
endif

# Generic flags, always used
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/intel-classic.mak
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
CXXFLAGS += -std=$(CXXSTD)
else
CXXFLAGS += -std=c++17
CXXFLAGS += -std=c++20
endif

CFLAGS += -std=c11
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/intel-llvm.mak
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
CXXFLAGS += -std=$(CXXSTD)
else
CXXFLAGS += -std=c++17
CXXFLAGS += -std=c++20
endif

CFLAGS += -std=c11
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/llvm-flang.mak
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif
ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
else
CXXSTD := c++17
CXXSTD := c++20
endif

CXXFLAGS += -std=$(CXXSTD)
Expand Down
4 changes: 2 additions & 2 deletions Tools/GNUMake/comps/llvm.mak
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ ifeq ($(USE_COMPILE_PIC),TRUE)
endif

# disable some warnings
CXXFLAGS += -Wno-c++17-extensions
# CXXFLAGS += -Wno-c++20-extensions # Do we need it?

########################################################################

ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
else
CXXSTD := c++17
CXXSTD := c++20
endif

CXXFLAGS += -std=$(CXXSTD)
Expand Down
2 changes: 1 addition & 1 deletion Tools/GNUMake/comps/nag.mak
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ifdef CXXSTD
CXXSTD := $(strip $(CXXSTD))
CXXFLAGS += -std=$(CXXSTD)
else
CXXFLAGS += -std=c++17
CXXFLAGS += -std=c++20
endif

CFLAGS += -std=c11
Expand Down
Loading
Loading