Skip to content

Commit

Permalink
Merge branch 'main' into cmake-cache-source-compilation-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tclune committed Mar 3, 2024
2 parents 702f26b + 3979699 commit 9fe53d4
Show file tree
Hide file tree
Showing 30 changed files with 428 additions and 56 deletions.
166 changes: 149 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,147 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, macos-10.15, macos-11]
compiler: [gfortran-8, gfortran-9, gfortran-10]
os: [ubuntu-22.04, macos-11, macos-12]
compiler: [gfortran-10, gfortran-11, gfortran-12, gfortran-13]
exclude:
- os: macos-10.15
compiler: gfortran-8
- os: macos-11
compiler: gfortran-8
compiler: gfortran-13
- os: macos-12
compiler: gfortran-10

# fail-fast if set to 'true' here is good for production, but when
# debugging, set to 'false'. fail-fast means if *any* ci test in the matrix fails
# GitHub Actions will stop any other test immediately. So good for production, bad
# when trying to figure something out. For more info see:
# https://www.edwardthomson.com/blog/github_actions_6_fail_fast_matrix_workflows.html

fail-fast: false
env:
FC: ${{ matrix.compiler }}
LANGUAGE: en_US.UTF-8
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LC_TYPE: en_US.UTF-8
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none

name: ${{ matrix.os }} / ${{ matrix.compiler }}
steps:
- name: Install GCC 8 on Ubuntu 20
if: matrix.os == 'ubuntu-20.04' && matrix.compiler == 'gfortran-8'
run: |
sudo apt-get install gfortran-8 -y
- name: Install GCC 11 on Ubuntu 20
if: matrix.os == 'ubuntu-20.04' && matrix.compiler == 'gfortran-11'
run: |
sudo apt-get install gfortran-11 -y
- name: Versions
- name: Compiler Versions
run: |
${FC} --version
cmake --version
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set all directories as git safe
run: |
git config --global --add safe.directory '*'
- name: Build gFTL-shared
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_Fortran_COMPILER=${FC}
make -j$(nproc)
- name: Build Tests
run: |
cd build
make -j$(nproc) tests
- name: Run Tests
run: |
cd build
ctest -j1 --output-on-failure --repeat until-pass:4
- name: Archive log files on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: logfiles
path: |
build/**/*.log
Intel:
runs-on: ubuntu-20.04

env:
FC: ifx
CC: icx

name: Intel Fortran
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set all directories as git safe
run: |
git config --global --add safe.directory '*'
- name: Setup Intel oneAPI repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
sudo apt-get update
- name: Install Intel oneAPI compilers
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-compiler-fortran intel-oneapi-compiler-dpcpp-cpp

# optional
- name: Install Intel MPI
timeout-minutes: 5
run: sudo apt-get install intel-oneapi-mpi intel-oneapi-mpi-devel

- name: Setup Intel oneAPI environment
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
printenv | grep intel
- name: Versions
run: |
${FC} --version
${CC} --version
mpirun --version
cmake --version
- name: Build gFTL-shared
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_Fortran_COMPILER=${FC}
make -j$(nproc)
- name: Build Tests
run: |
cd build
make -j$(nproc) tests
- name: Run Tests
run: |
cd build
ctest -j1 --output-on-failure --repeat until-pass:4
- name: Archive log files on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: logfiles
path: |
build/**/*.log
Nvidia:
runs-on: ubuntu-20.04
container: nvcr.io/nvidia/nvhpc:20.11-devel-cuda11.1-ubuntu20.04
container: nvcr.io/nvidia/nvhpc:24.1-devel-cuda12.3-ubuntu22.04
env:
FC: nvfortran

Expand All @@ -62,13 +164,43 @@ jobs:
run: |
${FC} --version
cmake --version
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set all directories as git safe
run: |
git config --global --add safe.directory '*'
- name: Add python-is-python3 package
run: |
apt-get update
apt-get install -y python-is-python3
- name: Build gFTL-shared
run: |
mkdir -p build
cd build
cmake .. -DCMAKE_Fortran_COMPILER=${FC}
make -j$(nproc)
- name: Build Tests
run: |
cd build
make -j$(nproc) tests
- name: Run Tests
run: |
cd build
ctest -j1 --output-on-failure --repeat until-pass:4
- name: Archive log files on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: logfiles
path: |
build/**/*.log
16 changes: 11 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.0)
# the library gftl-shared retain the hyphen (and lower case)

project (GFTL_SHARED
VERSION 1.3.6
VERSION 1.7.0
LANGUAGES Fortran)


Expand All @@ -35,8 +35,18 @@ set(CMAKE_MODULE_PATH "${GFTL_SHARED_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(${CMAKE_Fortran_COMPILER_ID} RESULT_VARIABLE found)
include(check_intrinsic_kinds RESULT_VARIABLE found)

# We attempt to use find_package() first for each dependency. But all
# dependencies are also available as submodules.
include(build_submodule)
build_submodule(extern/gFTL PROJECT GFTL TARGET GFTL::gftl)

add_subdirectory (src)

# The following is needed for external projects using *nix make when
# parent project builds gFTL-shared as a subproject.
set (top_dir GFTL_SHARED-${GFTL_SHARED_VERSION_MAJOR}.${GFTL_SHARED_VERSION_MINOR})
set (GFTL_SHARED_TOP_DIR "${CMAKE_INSTALL_PREFIX}/${top_dir}" CACHE PATH "")

include(CMakePackageConfigHelpers)
configure_package_config_file(GFTL_SHAREDConfig.cmake.in GFTL_SHAREDConfig.cmake
INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/GFTL_SHAREDConfig.cmake
Expand All @@ -46,14 +56,10 @@ write_basic_package_version_file(GFTL_SHAREDConfig-version.cmake
COMPATIBILITY SameMajorVersion
)

set (top_dir GFTL_SHARED-${GFTL_SHARED_VERSION_MAJOR}.${GFTL_SHARED_VERSION_MINOR})
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/GFTL_SHAREDConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/GFTL_SHAREDConfig-version.cmake
DESTINATION "${top_dir}/cmake")

# The following is needed for external projects using *nix make when
# parent project builds gFTL-shared as a subproject.
set (GFTL_SHARED_TOP_DIR "${CMAKE_INSTALL_PREFIX}/${top_dir}" CACHE PATH "")
configure_file (GFTL_SHARED.mk.in ${CMAKE_CURRENT_BINARY_DIR}/GFTL_SHARED.mk @ONLY)
install (
FILES ${CMAKE_CURRENT_BINARY_DIR}/GFTL_SHARED.mk ${CMAKE_CURRENT_BINARY_DIR}/GFTL_SHARED.mk
Expand Down
72 changes: 72 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,78 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Fujitsu compiler support

## Changed
- Results from running trial sources during CMake config are now stored in the CMake cache

## [1.7.0] - 2023-11-29

### Fixed

- Add `-check nouninit` for Intel LLVM to work around [`ifx` bug](https://github.com/HPC-Bugs/reproducers/tree/main/compiler/Fortran/ifx/allocatable).

### Changed

- Updated gFTL submodule to v1.11.0

## [1.6.1] - 2023-07-18

### Fixed

- Fixed issue where the names of some iterators for containers were not being correctly named. E.g., StringSetIterator was only named SetIterator.

### Added
## [1.6.0] - 2023-04-13

### Added

- Added `IntelLLVM.cmake` file as a copy of `Intel.cmake` to support the LLVM Intel compiler frontends

### Changed

- Updated gFTL submodule to v1.10.0

## [1.5.1] - 2023-01-23

### Fixed

- Fixes for GNU Make builds
- Update gFTL submodule to v1.8.2

## [1.5.0] - 2022-05-31

### Fixed

- Fix use of `-Od` flag with Intel on non-Windows machines

### Changed

- NAG compiler flags - to reduce useless warning messages.
- Updated gFTL submodule to v1.8.0
- Updated GitHub Actions
- OSs
- Remove macos-10.15
- Add ubuntu-22.04 and macos-12
- Compilers
- Removed gfortran-8
- Added gfortran-11
- Added gfortran-12 (for ubuntu-22.04)

## [1.4.1] - 2022-03-23

### Changed

- Updated gFTL submodule to v1.6.0

## [1.4.0] - 2022-03-23

### Added

- Add `NVHPC.cmake` file for NVHPC support

## [1.3.6] - 2021-11-16

### Fixed
Expand Down
2 changes: 2 additions & 0 deletions GFTL_SHARED.mk.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ GFTL_SHARED_VERSION := @GFTL_SHARED_VERSION_MAJOR@.@GFTL_SHARED_VERSION_MINOR@
GFTL_SHARED_TOP_DIR := $(GFTL_SHARED_INSTALL_PREFIX)/GFTL_SHARED-$(GFTL_SHARED_VERSION)
GFTL_SHARED_INCLUDE_DIR := $(GFTL_SHARED_TOP_DIR)/include/v1
GFTL_SHARED_V1_INCLUDE_DIR := $(GFTL_SHARED_TOP_DIR)/include/v1
GFTL_SHARED_V2_INCLUDE_DIR := $(GFTL_SHARED_TOP_DIR)/include/v2
GFTL_SHARED_LIBRARIES := -L$(GFTL_SHARED_TOP_DIR)/lib -lgftl-shared-v1
GFTL_SHARED_V1_LIBRARIES := -L$(GFTL_SHARED_TOP_DIR)/lib -lgftl-shared-v1
GFTL_SHARED_V2_LIBRARIES := -L$(GFTL_SHARED_TOP_DIR)/lib -lgftl-shared-v2


14 changes: 14 additions & 0 deletions cmake/Fujitsu.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
if (CMAKE_Fortran_COMPILER_ID MATCHES Fujitsu)
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 4.10.0)
message(FATAL_ERROR "${CMAKE_Fortran_COMPILER_ID} version must be at least 4.10.0!")
endif ()
endif ()

# Compiler specific flags for Fujitsu Fortran compiler

set(check_all "-Nquickdbg")
set(cpp "-Cfpp")

set(CMAKE_Fortran_FLAGS_DEBUG "-O0 ${check_all}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS "-g ${cpp} -Nalloc_assign -Free")
2 changes: 1 addition & 1 deletion cmake/Intel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if(WIN32)
set(save-temps "-Qsave-temps")
set(disable_warning_for_long_names "-Qdiag-disable:5462")
else()
set(no_optimize "-Od")
set(no_optimize "-O0")
set(check_all "-check all")
set(cpp "-cpp")
set(save-temps "-save-temps")
Expand Down
24 changes: 24 additions & 0 deletions cmake/IntelLLVM.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Compiler specific flags for Intel Fortran compiler

if(WIN32)
set(no_optimize "-Od")
set(check_all "-check:all")
set(cpp "-fpp")
set(save-temps "-Qsave-temps")
set(disable_warning_for_long_names "-Qdiag-disable:5462")
else()
set(no_optimize "-O0")
set(check_all "-check all,nouninit")
set(cpp "-cpp")
set(save-temps "-save-temps")
set(disable_warning_for_long_names "-diag-disable 5462")
endif()

set(traceback "-traceback")

set(CMAKE_Fortran_Flags_ALL "${cpp} ${disable_warning_for_long_names}")
set(CMAKE_Fortran_FLAGS_DEBUG "${no_optimize} ${check_all} ${save-temps} ${CMAKE_Fortran_Flags_ALL}")
set(CMAKE_Fortran_FLAGS_RELEASE "-O3 ${CMAKE_Fortran_Flags_ALL}")

add_definitions(-D_INTEL)
add_definitions(-D__ifort_18)
5 changes: 3 additions & 2 deletions cmake/NAG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ set (CRAY_POINTER "")
set (EXTENDED_SOURCE "-132")

set (check_kinds "-kind=unique")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C=all") # -C=undefined")
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -g")
set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C=all -Wp,-P") # -C=undefined")
#set (CMAKE_Fortran_FLAGS_DEBUG "-O0 -g -C=all") # -C=undefined")
set (CMAKE_Fortran_FLAGS_RELEASE "-O3 -g -Wp,-P")

Loading

0 comments on commit 9fe53d4

Please sign in to comment.