Skip to content
Merged
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
49 changes: 40 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,58 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# GCC 12
- cc: gcc-12
# GCC 12 (default standard)
- os: ubuntu-24.04
cc: gcc-12
cxx: g++-12
f77: gfortran-12
packages: gcc-12 g++-12 gfortran-12
# GCC 14
- cc: gcc-14
# GCC 14 (C++14)
- os: ubuntu-24.04
cc: gcc-14
cxx: g++-14
f77: gfortran-14
packages: gcc-14 g++-14 gfortran-14
# Clang 18
- cc: clang-18
cxx_std: 14
# GCC 16 (C++17)
- os: ubuntu-26.04
cc: gcc-16
cxx: g++-16
f77: gfortran-16
packages: gcc-16 g++-16 gfortran-16
cxx_std: 17
# GCC 16 (C++20)
- os: ubuntu-26.04
cc: gcc-16
cxx: g++-16
f77: gfortran-16
packages: gcc-16 g++-16 gfortran-16
cxx_std: 20
# Clang 18 (C++14)
- os: ubuntu-24.04
cc: clang-18
cxx: clang++-18
f77: gfortran-14
packages: gfortran-14 clang-18
cxx_std: 14
# Clang 22 (C++20)
- os: ubuntu-26.04
cc: clang-22
cxx: clang++-22
f77: gfortran-15
packages: gfortran-15 clang-22
cxx_std: 20

env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
FC: ${{ matrix.f77 }}
UCX_TLS: tcp,self,sm

steps:
- uses: actions/checkout@v4
Expand All @@ -45,7 +72,7 @@ jobs:
- name: Set up ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.cc }}
key: ${{ matrix.os }}-${{ matrix.cc }}-cxx${{ matrix.cxx_std }}

- name: Configure ccache symlinks
run: |
Expand Down Expand Up @@ -73,7 +100,11 @@ jobs:
run: |
ccache -s
mkdir build && cd build
cmake -DEL_TESTS=ON -DEL_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/Install .. || \
STD_FLAG=""
if [ -n "${{ matrix.cxx_std }}" ]; then
STD_FLAG="-DCMAKE_CXX_STANDARD=${{ matrix.cxx_std }}"
fi
cmake $STD_FLAG -DEL_TESTS=ON -DEL_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/Install .. || \
(cat CMakeFiles/CMakeError.log; exit 1)
make -j$(nproc)
make install
Expand Down
29 changes: 26 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,33 @@ endif()
# --------------
include(detect/Fortran)

# Detect C++11
# ------------
# Select the C++ standard
# -----------------------
# Default to C++14; override with -DCMAKE_CXX_STANDARD=17 (or 20). This must
# precede detect/CXX so that its feature checks compile at the selected
# standard (CMP0067).
if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# CMAKE_CXX_STANDARD only affects this build, so also append the flag to
# CXX_FLAGS, which is what gets exported to downstream consumers via
# Elemental_COMPILE_FLAGS and ElVars' EL_COMPILE_FLAGS.
# GNU needs extended mode (-std=gnu++XX) for libquadmath literals.
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(CMAKE_CXX_EXTENSIONS ON)
set(CXX_FLAGS
"${CXX_FLAGS} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_EXTENSION_COMPILE_OPTION}")
else()
set(CMAKE_CXX_EXTENSIONS OFF)
set(CXX_FLAGS
"${CXX_FLAGS} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}")
endif()
message(STATUS "Building with C++${CMAKE_CXX_STANDARD}")

# Detect C++ features
# -------------------
include(detect/CXX)
set(CXX_FLAGS "${CXX_FLAGS} ${CXX14_COMPILER_FLAGS}")

# Detect MPI
# ----------
Expand Down
7 changes: 2 additions & 5 deletions cmake/detect/CXX.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
# which can be found in the LICENSE file in the root directory, or at
# http://opensource.org/licenses/BSD-2-Clause
#
include(FindCXXFeatures)
include(CheckCXXSourceCompiles)

message(STATUS "CXX11_COMPILER_FLAGS=${CXX11_COMPILER_FLAGS}")
message(STATUS "CXX14_COMPILER_FLAGS=${CXX14_COMPILER_FLAGS}")
set(CMAKE_REQUIRED_FLAGS ${CXX14_COMPILER_FLAGS})
# NOTE: the checks below compile at ${CMAKE_CXX_STANDARD}, which CMake
# propagates into try_compile() via CMP0067.

# TODO(poulson): Test for C++14 features such as [[deprecated]]

Expand Down Expand Up @@ -131,5 +129,4 @@ set(PRETTY_FUNCTION_CODE
}")
check_cxx_source_compiles("${PRETTY_FUNCTION_CODE}" EL_HAVE_PRETTY_FUNCTION)

unset(CMAKE_REQUIRED_FLAGS)
unset(CMAKE_REQUIRED_DEFINITIONS)
1 change: 1 addition & 0 deletions cmake/external_projects/ElMath/BLIS_LAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ elseif(EL_HAVE_F90_INTERFACE AND
TMP_DIR ${LAPACK_BINARY_DIR}/tmp
UPDATE_COMMAND ""
CMAKE_ARGS
-D CMAKE_POLICY_VERSION_MINIMUM=3.5
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-D CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
-D CMAKE_C_FLAGS=${CMAKE_C_FLAGS}
Expand Down
1 change: 1 addition & 0 deletions cmake/external_projects/ElMath/METIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ elseif(NOT EL_PREVENT_METIS_DOWNLOAD)
TMP_DIR ${METIS_BINARY_DIR}/tmp
UPDATE_COMMAND ""
CMAKE_ARGS
-D CMAKE_POLICY_VERSION_MINIMUM=3.5
-D PCRE=${METIS_PCRE}
-D GKREGEX=${METIS_GKREGEX}
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
Expand Down
1 change: 1 addition & 0 deletions cmake/external_projects/ElMath/ParMETIS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ elseif(NOT EL_PREVENT_PARMETIS_DOWNLOAD)
UPDATE_COMMAND ""
LIST_SEPARATOR ^^
CMAKE_ARGS
-D CMAKE_POLICY_VERSION_MINIMUM=3.5
-D PCRE=${METIS_PCRE}
-D GKREGEX=${METIS_GKREGEX}
-D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
Expand Down
1 change: 1 addition & 0 deletions cmake/external_projects/ElMath/ScaLAPACK.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ elseif(EL_HAVE_F90_INTERFACE AND EL_HAVE_MPI_FORTRAN AND
UPDATE_COMMAND ""
LIST_SEPARATOR ^^
CMAKE_ARGS
-D CMAKE_POLICY_VERSION_MINIMUM=3.5
-D CMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-D CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}
-D CMAKE_C_FLAGS=${CMAKE_C_FLAGS}
Expand Down
206 changes: 0 additions & 206 deletions cmake/modules/FindCXXFeatures.cmake

This file was deleted.

11 changes: 0 additions & 11 deletions cmake/modules/FindCXXFeatures/cxx11-auto.cxx

This file was deleted.

Loading
Loading