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

CMake: overhaul options #1490

Merged
merged 21 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
e9ebf97
Doc: move ENABLE_CUDA_FASTMATH to the GPU options section
mic84 Oct 20, 2020
b0801cd
CMake: change all options to include AMReX_ namespace
mic84 Oct 20, 2020
01cb3b7
CMake: remove ENABLE_ACC option
mic84 Oct 20, 2020
ec806ab
CMake: make AMReX_SPACEDIM a multi-valued string
mic84 Oct 20, 2020
e299943
Doc: add option AMReX_ENABLE_TESTS
mic84 Oct 20, 2020
bc96c86
CMake: rename AMReX_Options.cmake to AMReXOptions.cmake
mic84 Oct 20, 2020
b52d0ed
CMake: refactor GPU-related options
mic84 Oct 21, 2020
8353dc0
Merge remote-tracking branch 'upstream/development' into mr/cmake-ove…
mic84 Oct 29, 2020
3dc1aae
CMake: MPI must be turned off if DPCPP is enabled
mic84 Oct 29, 2020
8e43414
CMake: set via precision via selection of value
mic84 Oct 29, 2020
3df0b15
CMake: forgot to update Particles/CMakeLists.txt
mic84 Oct 30, 2020
bb066cf
CMake: append prefix to TL_PROFILE
mic84 Oct 30, 2020
49d414b
Update Docs/sphinx_documentation/source/AMReX_Profiling_Tools.rst
mic84 Nov 2, 2020
632f316
Update Docs/sphinx_documentation/source/AMReX_Profiling_Tools.rst
mic84 Nov 2, 2020
69afd45
Update Docs/sphinx_documentation/source/BuildingAMReX.rst
mic84 Nov 3, 2020
924cf15
CMake: components in Config file shall not have namespace prefix
mic84 Nov 3, 2020
711a71a
Revert "CMake: components in Config file shall not have namespace pre…
mic84 Nov 3, 2020
68a7f9d
Update Tools/CMake/AMReX_SetupCUDA.cmake
mic84 Nov 3, 2020
197b107
CMake: update Doc
mic84 Nov 3, 2020
82a9b6b
Update Tools/CMake/AMReX_SetupCUDA.cmake
mic84 Nov 4, 2020
8e8e103
Merge remote-tracking branch 'upstream/development' into mr/cmake-ove…
mic84 Nov 4, 2020
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
50 changes: 25 additions & 25 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
cmake .. \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \
-DENABLE_MPI=OFF \
-DENABLE_PARTICLES=ON \
-DENABLE_DP=OFF \
-DENABLE_DP_PARTICLES=OFF \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \
-DAMReX_MPI=OFF \
-DAMReX_PARTICLES=ON \
-DAMReX_PRECISION=SINGLE \
-DAMReX_PARTICLES_PRECISION=SINGLE \
-DCMAKE_CXX_STANDARD=14 \
-DCMAKE_C_COMPILER=$(which clang) \
-DCMAKE_CXX_COMPILER=$(which clang++) \
-DCMAKE_Fortran_COMPILER=$(which gfortran)
Expand All @@ -67,7 +67,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON
-DAMReX_PARTICLES=ON
make -j 2

# Build libamrex and all tutorials
Expand All @@ -87,7 +87,7 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON \
-DAMReX_PARTICLES=ON \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_C_COMPILER=$(which gcc-10) \
-DCMAKE_CXX_COMPILER=$(which g++-10) \
Expand All @@ -111,8 +111,8 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_MPI=OFF \
-DENABLE_PARTICLES=ON
-DAMReX_MPI=OFF \
-DAMReX_PARTICLES=ON
make -j 2

# Build libamrex and all tutorials
Expand All @@ -132,8 +132,8 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON \
-DENABLE_FORTRAN=OFF \
-DAMReX_PARTICLES=ON \
-DAMReX_FORTRAN=OFF \
-DCMAKE_CXX_STANDARD=11
make -j 2

Expand All @@ -152,13 +152,13 @@ jobs:
cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON \
-DENABLE_CUDA=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_GPU_BACKEND=CUDA \
-DCMAKE_C_COMPILER=$(which gcc-4.8) \
-DCMAKE_CXX_COMPILER=$(which g++-4.8) \
-DCMAKE_CUDA_HOST_COMPILER=$(which g++-4.8) \
-DCMAKE_Fortran_COMPILER=$(which gfortran-4.8) \
-DCUDA_ARCH=6.0
-DAMReX_CUDA_ARCH=6.0
make -j 2

tutorials-dpcpp:
Expand All @@ -178,12 +178,12 @@ jobs:
cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON \
-DENABLE_DPCPP=ON \
-DAMReX_PARTICLES=ON \
-DAMReX_GPU_BACKEND=SYCL \
-DCMAKE_C_COMPILER=$(which clang) \
-DCMAKE_CXX_COMPILER=$(which dpcpp) \
-DCMAKE_Fortran_COMPILER=$(which gfortran)
make -j 2
make -j 2

tutorials-hip:
name: HIP ROCm@3.8 GFortran@9.3 C++17 [tutorials]
Expand All @@ -201,11 +201,11 @@ jobs:
cmake .. \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON \
-DENABLE_FORTRAN=ON \
-DENABLE_LINEAR_SOLVERS=ON \
-DENABLE_HIP=ON \
-DAMD_ARCH=gfx900 \
-DAMReX_PARTICLES=ON \
-DAMReX_FORTRAN=ON \
-DAMReX_LINEAR_SOLVERS=ON \
-DAMReX_GPU_BACKEND=HIP \
-DAMReX_AMD_ARCH=gfx900 \
-DCMAKE_C_COMPILER=$(which hipcc) \
-DCMAKE_CXX_COMPILER=$(which hipcc) \
-DCMAKE_Fortran_COMPILER=$(which gfortran)
Expand Down Expand Up @@ -281,10 +281,10 @@ jobs:
mkdir build
cd build
cmake .. \
-DENABLE_OMP=ON \
-DAMReX_OMP=ON \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_ENABLE_TESTS=ON \
-DENABLE_PARTICLES=ON
-DAMReX_PARTICLES=ON
make -j 2
- name: Run tests
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DAMReX_BUILD_TUTORIALS=ON \
-DENABLE_PARTICLES=ON
-DAMReX_PARTICLES=ON
make -j 2
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DAMReX_BUILD_TUTORIALS=ON -DENABLE_FORTRAN=OFF -DENABLE_MPI=OFF
cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_VERBOSE_MAKEFILE=ON -DAMReX_BUILD_TUTORIALS=ON -DAMReX_FORTRAN=OFF -DAMReX_MPI=OFF
cmake --build . --config Debug
2 changes: 1 addition & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@

-- Add CUPTI trace for CUDA kernel timing.

-- Implement ENABLE_FORTRAN (BL_NO_FORT) option in CMake.
-- Implement AMReX_FORTRAN (BL_NO_FORT) option in CMake.

-- Fix CUDA build of tools.

Expand Down
25 changes: 5 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ include( AMReX_Utils )
get_amrex_version()


#
# For the time being, set this option here.
# We must do this because we need to provide a default for CMAKE_CXX_COMPILER
#
option( ENABLE_DPCPP "Enable DPCPP support" OFF )
if (ENABLE_DPCPP)
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
# Set default for CMAKE_CXX_COMPILER only if amrex
# is not a subproject
set(CMAKE_CXX_COMPILER dpcpp)
endif ()
message(STATUS "Enabling experimental support for dpc++")
endif ()


########################################################################
#
# AMReX project
Expand Down Expand Up @@ -80,19 +65,19 @@ endif()
#
# Include options, utilities and other stuff we need
#
include( AMReX_Options )
include( AMReXOptions )

#
# Enable Fortran if requested
#
if(ENABLE_FORTRAN)
if(AMReX_FORTRAN)
enable_language(Fortran)
endif ()

#
# Enable CUDA if requested
#
if (ENABLE_CUDA)
if (AMReX_CUDA)
# CMake 3.18+: CMAKE_CUDA_ARCHITECTURES
# https://cmake.org/cmake/help/latest/policy/CMP0104.html
if(POLICY CMP0104)
Expand Down Expand Up @@ -132,9 +117,9 @@ endif ()
#
# Plotfile tools
#
option(ENABLE_PLOTFILE_TOOLS "Enable Plotfile tools" NO)
option(AMReX_PLOTFILE_TOOLS "Enable Plotfile tools" NO)

if (ENABLE_PLOTFILE_TOOLS)
if (AMReX_PLOTFILE_TOOLS)
# If this get executed, it cannot be EXCLUDED_FROM_ALL
# because it needs to get installed
add_subdirectory(Tools/Plotfile)
Expand Down
7 changes: 3 additions & 4 deletions Docs/sphinx_documentation/source/AMReX_Profiling_Tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ in your GNUMakefile. If using cmake then set the following cmake flags

::

AMREX_ENABLE_TINY_PROFILE = ON
AMREX_ENABLE_BASE_PROFILE = OFF
AMReX_TINY_PROFILE = ON
AMReX_BASE_PROFILE = OFF

Note that if you set ``PROFILE = TRUE`` (or ``AMREX_ENABLE_BASE_PROFILE =
Note that if you set ``PROFILE = TRUE`` (or ``AMReX_BASE_PROFILE =
ON``) then this will override the ``TINY_PROFILE`` flag and tiny profiling will
be disabled.

Expand Down Expand Up @@ -245,4 +245,3 @@ parser itself. It has been integrated into Amrvis for visual interpretation of
the data allowing Amrvis to open the bl_prof database like a plotfile but with
interfaces appropriate to profiling data. AMRProfParser and Amrvis can be run
in parallel both interactively and in batch mode.

4 changes: 2 additions & 2 deletions Docs/sphinx_documentation/source/Basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2507,9 +2507,9 @@ overflow). The handling of seg fault, assertion errors and
interruption by control-C are enabled by default. Note that
``AMREX_ASSERT()`` is only on when compiled with ``DEBUG=TRUE`` or
``USE_ASSERTION=TRUE`` in GNU make, or with ``-DCMAKE_BUILD_TYPE=Debug`` or
``-DENABLE_ASSERTIONS=YES`` in CMake. The trapping of floating point exceptions is not
``-DAMReX_ASSERTIONS=YES`` in CMake. The trapping of floating point exceptions is not
enabled by default unless the code is compiled with ``DEBUG=TRUE`` in GNU make, or with
``-DCMAKE_BUILD_TYPE=Debug`` or ``-DENABLE_FPE=YES`` in CMake to turn on compiler flags
``-DCMAKE_BUILD_TYPE=Debug`` or ``-DAMReX_FPE=YES`` in CMake to turn on compiler flags
if supported. Alternatively, one can always use runtime parameters to control the
handling of floating point exceptions: ``amrex.fpe_trap_invalid`` for
NaNs, ``amrex.fpe_trap_zero`` for division by zero and
Expand Down
Loading