Skip to content

Commit ad180de

Browse files
Merge pull request fortran-lang#23 from fortran-lang/master
merge
2 parents 7327142 + ce3a106 commit ad180de

File tree

75 files changed

+14798
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+14798
-250
lines changed

.github/ISSUE_TEMPLATE/01_bug.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Something is not working
4+
labels: bug
5+
---
6+
7+
<!-- Thanks for taking the time to report a bug -->
8+
<!-- Fill in all entries in this template to make the process as efficient as possible for everyone involved -->
9+
10+
**Describe the issue**
11+
<!-- Please include steps to reproduce your issue, provide example code snippets if possible -->
12+
13+
**Expected behaviour**
14+
<!-- What did you expect to happen instead -->
15+
16+
**Technical Details**
17+
<!-- Please provide us with some technical details in case we have to reproduce the issue ourselves -->
18+
*stdlib version*
19+
<!-- latest version is subject to change, copy the commit hash here (git show-ref HEAD) -->
20+
21+
*Compiler version*
22+
<!-- e.g. GCC 10.2, Intel Fortran classic 21.1, ... -->
23+
24+
*Platform and Architecture*
25+
<!-- e.g. Windows 10/x86_64, MacOS/aarch64, ... -->

.github/ISSUE_TEMPLATE/02_proposal.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Proposal
3+
about: An idea for a new feature
4+
labels: idea
5+
---
6+
7+
<!-- Thanks for proposing a new feature for stdlib -->
8+
9+
**Description**
10+
<!-- Please describe the feature, please provide examples -->
11+
<!-- Use codefences (```) to add literal codeblocks for examples -->
12+
13+
**Prior Art**
14+
<!-- Are there projects implementing the proposed functionality already -->

.github/workflows/CI.yml

+49-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: CI
33
on: [push, pull_request]
44

55
env:
6-
CI: "ON" # We can detect this in the build system and other vendors implement it
76
CMAKE_BUILD_PARALLEL_LEVEL: "2" # 2 cores on each GHA VM, enable parallel builds
87
CTEST_OUTPUT_ON_FAILURE: "ON" # This way we don't need a flag to ctest
98
CTEST_PARALLEL_LEVEL: "2"
@@ -21,14 +20,14 @@ jobs:
2120
fail-fast: false
2221
matrix:
2322
os: [ubuntu-latest, macos-latest]
24-
gcc_v: [7, 8, 9, 10] # Version of GFortran we want to use.
23+
gcc_v: [9, 10, 11] # Version of GFortran we want to use.
2524
env:
2625
FC: gfortran-${{ matrix.gcc_v }}
2726
GCC_V: ${{ matrix.gcc_v }}
2827

2928
steps:
3029
- name: Checkout code
31-
uses: actions/checkout@v1
30+
uses: actions/checkout@v2
3231

3332
- name: Set up Python 3.x
3433
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
@@ -62,20 +61,19 @@ jobs:
6261
run: >-
6362
cmake -Wdev
6463
-DCMAKE_BUILD_TYPE=Release
65-
-DCMAKE_MAXIMUM_RANK=4
64+
-DCMAKE_MAXIMUM_RANK:String=4
6665
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
6766
-S . -B build
6867
6968
- name: Build and compile
70-
run: cmake --build build
69+
run: cmake --build build --parallel
7170

7271
- name: catch build fail
7372
run: cmake --build build --verbose --parallel 1
7473
if: failure()
7574

7675
- name: test
77-
run: ctest --parallel --output-on-failure
78-
working-directory: build
76+
run: ctest --test-dir build --parallel --output-on-failure
7977

8078
- name: Install project
8179
run: cmake --install build
@@ -99,14 +97,18 @@ jobs:
9997
strategy:
10098
fail-fast: false
10199
matrix:
102-
os: [ubuntu-20.04]
100+
os: [ubuntu-latest, macos-latest]
103101
fc: [ifort]
104102
env:
103+
MACOS_HPCKIT_URL: >-
104+
https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681_offline.dmg
105+
MACOS_FORTRAN_COMPONENTS: >-
106+
intel.oneapi.mac.ifort-compiler
105107
FC: ${{ matrix.fc }}
106108

107109
steps:
108110
- name: Checkout code
109-
uses: actions/checkout@v1
111+
uses: actions/checkout@v2
110112

111113
- name: Set up Python 3.x
112114
uses: actions/setup-python@v1
@@ -117,7 +119,21 @@ jobs:
117119
if: contains(matrix.os, 'ubuntu')
118120
run: ci/install_cmake.sh
119121

120-
- name: Add Intel repository
122+
- name: Prepare for cache restore (OSX)
123+
if: contains(matrix.os, 'macos')
124+
run: |
125+
sudo mkdir -p /opt/intel
126+
sudo chown $USER /opt/intel
127+
128+
- name: Cache Intel install (OSX)
129+
if: contains(matrix.os, 'macos')
130+
id: cache-install
131+
uses: actions/cache@v2
132+
with:
133+
path: /opt/intel/oneapi
134+
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
135+
136+
- name: Add Intel repository (Linux)
121137
if: contains(matrix.os, 'ubuntu')
122138
run: |
123139
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
@@ -126,10 +142,31 @@ jobs:
126142
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
127143
sudo apt-get update
128144
129-
- name: Install Intel oneAPI compiler
145+
- name: Install Intel oneAPI compiler (Linux)
130146
if: contains(matrix.os, 'ubuntu')
131147
run: |
132148
sudo apt-get install intel-oneapi-compiler-fortran
149+
150+
- name: Install Intel oneAPI compiler (OSX)
151+
if: contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
152+
run: |
153+
curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
154+
hdiutil attach webimage.dmg
155+
if [ -z "$COMPONENTS" ]; then
156+
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
157+
installer_exit_code=$?
158+
else
159+
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
160+
installer_exit_code=$?
161+
fi
162+
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
163+
exit $installer_exit_code
164+
env:
165+
URL: ${{ env.MACOS_HPCKIT_URL }}
166+
COMPONENTS: ${{ env.MACOS_FORTRAN_COMPONENTS }}
167+
168+
- name: Setup Intel oneAPI environment
169+
run: |
133170
source /opt/intel/oneapi/setvars.sh
134171
printenv >> $GITHUB_ENV
135172
@@ -140,7 +177,7 @@ jobs:
140177
run: >-
141178
cmake -Wdev
142179
-DCMAKE_BUILD_TYPE=Release
143-
-DCMAKE_MAXIMUM_RANK=4
180+
-DCMAKE_MAXIMUM_RANK:String=4
144181
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
145182
-S . -B build
146183

.github/workflows/PR-review.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- name: Check out code.
9-
uses: actions/checkout@v1
9+
uses: actions/checkout@v2
1010
- name: misspell
1111
uses: reviewdog/action-misspell@v1
1212
with:

.github/workflows/ci_windows.yml

+5-41
Original file line numberDiff line numberDiff line change
@@ -3,45 +3,10 @@ name: CI_windows
33
on: [push, pull_request]
44

55
env:
6-
CI: "ON"
76
CTEST_TIME_TIMEOUT: "5" # some failures hang forever
7+
CMAKE_GENERATOR: Ninja
88

99
jobs:
10-
Build:
11-
runs-on: windows-latest
12-
strategy:
13-
fail-fast: false
14-
15-
steps:
16-
- uses: actions/checkout@v1
17-
18-
- name: Install fypp
19-
run: pip install fypp
20-
21-
- run: cmake -G "MinGW Makefiles" -DCMAKE_SH="CMAKE_SH-NOTFOUND" -Wdev -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace" -DCMAKE_MAXIMUM_RANK=4
22-
23-
env:
24-
FC: gfortran
25-
CC: gcc
26-
CXX: g++
27-
28-
- name: CMake build
29-
run: cmake --build build --parallel
30-
31-
- name: catch build fail
32-
run: cmake --build build --verbose --parallel 1
33-
if: failure()
34-
35-
- name: CTest
36-
run: ctest --output-on-failure --parallel -V -LE quadruple_precision
37-
working-directory: build
38-
39-
- uses: actions/upload-artifact@v1
40-
if: failure()
41-
with:
42-
name: WindowsCMakeTestlog
43-
path: build/Testing/Temporary/LastTest.log
44-
4510
msys2-build:
4611
runs-on: windows-latest
4712
strategy:
@@ -70,6 +35,7 @@ jobs:
7035
mingw-w64-${{ matrix.arch }}-gcc-fortran
7136
mingw-w64-${{ matrix.arch }}-python
7237
mingw-w64-${{ matrix.arch }}-python-pip
38+
mingw-w64-${{ matrix.arch }}-python-setuptools
7339
mingw-w64-${{ matrix.arch }}-cmake
7440
mingw-w64-${{ matrix.arch }}-ninja
7541
@@ -92,13 +58,12 @@ jobs:
9258
run: pip install fypp
9359

9460
- run: >-
95-
cmake -G Ninja
96-
-DCMAKE_SH="CMAKE_SH-NOTFOUND"
61+
cmake
9762
-Wdev
9863
-B build
9964
-DCMAKE_BUILD_TYPE=Debug
10065
-DCMAKE_Fortran_FLAGS_DEBUG="-Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all -fbacktrace"
101-
-DCMAKE_MAXIMUM_RANK=4
66+
-DCMAKE_MAXIMUM_RANK:String=4
10267
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
10368
env:
10469
FC: gfortran
@@ -113,8 +78,7 @@ jobs:
11378
if: failure()
11479

11580
- name: CTest
116-
run: ctest --output-on-failure --parallel -V -LE quadruple_precision
117-
working-directory: build
81+
run: ctest --test-dir build --output-on-failure --parallel -V -LE quadruple_precision
11882

11983
- uses: actions/upload-artifact@v1
12084
if: failure()

CMakeLists.txt

+14-17
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ add_subdirectory(config)
1616

1717
# --- compiler options
1818
if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
19+
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 9.0)
20+
message(FATAL_ERROR "GCC Version 9 or newer required")
21+
endif()
1922
add_compile_options(-fimplicit-none)
2023
add_compile_options(-ffree-line-length-132)
2124
add_compile_options(-Wall)
@@ -24,35 +27,29 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
2427
add_compile_options(-Wconversion-extra)
2528
# -pedantic-errors triggers a false positive for optional arguments of elemental functions,
2629
# see test_optval and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95446
27-
add_compile_options(-pedantic-errors)
28-
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
29-
add_compile_options(-std=f2018)
30-
else()
31-
add_compile_options(-std=f2008ts)
32-
endif()
33-
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
34-
add_compile_options(-warn declarations,general,usage,interfaces,unused)
35-
if(NOT CMAKE_Fortran_COMPILER_VERSION VERSION_EQUAL 20.2.1.20200827)
36-
add_compile_options(-standard-semantics)
30+
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 11.0)
31+
add_compile_options(-pedantic-errors)
3732
endif()
38-
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
39-
add_compile_options(-stand f15)
33+
add_compile_options(-std=f2018)
34+
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
35+
if(WIN32)
36+
add_compile_options(/warn:declarations,general,usage,interfaces,unused)
37+
add_compile_options(/stand:f18)
4038
else()
39+
add_compile_options(-warn declarations,general,usage,interfaces,unused)
4140
add_compile_options(-stand f18)
4241
endif()
43-
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL PGI)
44-
add_compile_options(-Mdclchk)
4542
endif()
4643

4744
# --- compiler feature checks
4845
include(CheckFortranSourceCompiles)
4946
include(CheckFortranSourceRuns)
50-
check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90)
47+
check_fortran_source_runs("i=0; error stop i; end" f18errorstop)
5148
check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90)
5249
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)
5350

54-
if(DEFINED CMAKE_MAXIMUM_RANK)
55-
set(CMAKE_MAXIMUM_RANK ${CMAKE_MAXIMUM_RANK})
51+
if(NOT DEFINED CMAKE_MAXIMUM_RANK)
52+
set(CMAKE_MAXIMUM_RANK 4 CACHE STRING "Maximum array rank for generated procedures")
5653
endif()
5754

5855
# --- find preprocessor

0 commit comments

Comments
 (0)