Skip to content

Commit 3a9484b

Browse files
committed
Merge branch 'master' of https://github.com/fortran-lang/stdlib into string-list-new
2 parents 90b06ff + 1b93a60 commit 3a9484b

Some content is hidden

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

60 files changed

+11212
-209
lines changed

.github/ISSUE_TEMPLATE/01_bug.md

Lines changed: 25 additions & 0 deletions
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

Lines changed: 14 additions & 0 deletions
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

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
os: [ubuntu-latest, macos-latest]
24-
gcc_v: [7, 8, 9, 10] # Version of GFortran we want to use.
24+
gcc_v: [9, 10, 11] # Version of GFortran we want to use.
2525
env:
2626
FC: gfortran-${{ matrix.gcc_v }}
2727
GCC_V: ${{ matrix.gcc_v }}
@@ -99,9 +99,13 @@ jobs:
9999
strategy:
100100
fail-fast: false
101101
matrix:
102-
os: [ubuntu-20.04]
102+
os: [ubuntu-latest, macos-latest]
103103
fc: [ifort]
104104
env:
105+
MACOS_HPCKIT_URL: >-
106+
https://registrationcenter-download.intel.com/akdlm/irc_nas/17398/m_HPCKit_p_2021.1.0.2681_offline.dmg
107+
MACOS_FORTRAN_COMPONENTS: >-
108+
intel.oneapi.mac.ifort-compiler
105109
FC: ${{ matrix.fc }}
106110

107111
steps:
@@ -117,7 +121,21 @@ jobs:
117121
if: contains(matrix.os, 'ubuntu')
118122
run: ci/install_cmake.sh
119123

120-
- name: Add Intel repository
124+
- name: Prepare for cache restore (OSX)
125+
if: contains(matrix.os, 'macos')
126+
run: |
127+
sudo mkdir -p /opt/intel
128+
sudo chown $USER /opt/intel
129+
130+
- name: Cache Intel install (OSX)
131+
if: contains(matrix.os, 'macos')
132+
id: cache-install
133+
uses: actions/cache@v2
134+
with:
135+
path: /opt/intel/oneapi
136+
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
137+
138+
- name: Add Intel repository (Linux)
121139
if: contains(matrix.os, 'ubuntu')
122140
run: |
123141
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
@@ -126,10 +144,31 @@ jobs:
126144
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
127145
sudo apt-get update
128146
129-
- name: Install Intel oneAPI compiler
147+
- name: Install Intel oneAPI compiler (Linux)
130148
if: contains(matrix.os, 'ubuntu')
131149
run: |
132150
sudo apt-get install intel-oneapi-compiler-fortran
151+
152+
- name: Install Intel oneAPI compiler (OSX)
153+
if: contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
154+
run: |
155+
curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
156+
hdiutil attach webimage.dmg
157+
if [ -z "$COMPONENTS" ]; then
158+
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
159+
installer_exit_code=$?
160+
else
161+
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
162+
installer_exit_code=$?
163+
fi
164+
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
165+
exit $installer_exit_code
166+
env:
167+
URL: ${{ env.MACOS_HPCKIT_URL }}
168+
COMPONENTS: ${{ env.MACOS_FORTRAN_COMPONENTS }}
169+
170+
- name: Setup Intel oneAPI environment
171+
run: |
133172
source /opt/intel/oneapi/setvars.sh
134173
printenv >> $GITHUB_ENV
135174

.github/workflows/ci_windows.yml

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,6 @@ env:
77
CTEST_TIME_TIMEOUT: "5" # some failures hang forever
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

CMakeLists.txt

Lines changed: 7 additions & 11 deletions
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,17 +27,12 @@ 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)
30+
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 11.0)
31+
add_compile_options(-pedantic-errors)
3232
endif()
33+
add_compile_options(-std=f2018)
3334
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
3435
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)
37-
endif()
3836
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
3937
add_compile_options(-stand f15)
4038
else()
@@ -51,9 +49,7 @@ check_fortran_source_runs("i=0; error stop i; end" f18errorstop SRC_EXT f90)
5149
check_fortran_source_compiles("real, allocatable :: array(:, :, :, :, :, :, :, :, :, :); end" f03rank SRC_EXT f90)
5250
check_fortran_source_runs("use, intrinsic :: iso_fortran_env, only : real128; real(real128) :: x; x = x+1; end" f03real128)
5351

54-
if(DEFINED CMAKE_MAXIMUM_RANK)
55-
set(CMAKE_MAXIMUM_RANK ${CMAKE_MAXIMUM_RANK})
56-
endif()
52+
option(CMAKE_MAXIMUM_RANK "Maximum array rank for generated procedures" 4)
5753

5854
# --- find preprocessor
5955
find_program(FYPP fypp)

CONTRIBUTING.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Contributing to the Fortran standard library
2+
3+
Thank you for considering contributing to the Fortran standard library (*stdlib*).
4+
Please review and follow these guidelines to make the contribution process
5+
simple and effective for all involved. It will help communicate that you
6+
respect the time of the community developers. In return, the community will
7+
help to address your problem, evaluate changes, and guide you through your pull
8+
requests.
9+
10+
By contributing to *stdlib*, you certify that you own or are allowed to share the
11+
content of your contribution under the
12+
[stdlib license](https://github.com/fortran-lang/stdlib/blob/master/LICENSE).
13+
14+
* [Style](#style)
15+
* [Reporting a bug](#reporting-a-bug)
16+
* [Suggesting a feature](#suggesting-a-feature)
17+
* [Workflow](#workflow)
18+
* [General guidelines](#general-guidelines)
19+
* [For new contributors](#for-new-contributors)
20+
21+
22+
## Style
23+
24+
Please follow the
25+
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md)
26+
for any Fortran code that you contribute.
27+
This allows the community to focus on substance rather than style.
28+
29+
The style guide is a living document.
30+
You are welcome to propose changes to the style guide by
31+
[opening an issue](https://github.com/fortran-lang/stdlib/issues/new/choose) or
32+
[starting a discussion](https://github.com/fortran-lang/stdlib/discussions/new).
33+
34+
35+
## Reporting a bug
36+
37+
A bug is a *demonstrable problem* caused by the code in this repository.
38+
Good bug reports are extremely valuable to the community—thank you!
39+
40+
Before opening a bug report:
41+
42+
1. Check if the issue has already been reported
43+
([issues](https://github.com/fortran-lang/stdlib/issues)).
44+
2. Check if it is still an issue or it has been fixed?
45+
Try to reproduce it with the latest version from the master branch.
46+
3. Isolate the problem and create a minimal test case.
47+
48+
A good bug report should include all information needed to reproduce the bug.
49+
Please be as detailed as possible:
50+
51+
1. Which version of *stdlib* are you using?
52+
Which compiler version are you using?
53+
Which platform and architecture are you on?
54+
Please be specific.
55+
2. What are the steps to reproduce the issue?
56+
3. What is the expected outcome?
57+
4. What happens instead?
58+
59+
This information will help the community to diagnose the issue quickly and with
60+
minimal back-and-forth.
61+
62+
63+
## Suggesting a feature
64+
65+
Before suggesting a new feature, take a moment to find out if it fits the scope
66+
of the project, or if it has already been discussed. It is up to you to provide
67+
a strong argument to convince the community of the benefits of this feature.
68+
Please provide as many details and context as possible. If applicable, include a
69+
mocked-up snippet of what the output or behavior would look like with this
70+
feature implemented. “Crazy,” out-of-the-box ideas are especially welcome.
71+
It is quite possible we have not considered such solutions yet.
72+
73+
74+
## Workflow
75+
76+
The general workflow is documented in
77+
[this document](https://github.com/fortran-lang/stdlib/blob/master/WORKFLOW.md)
78+
79+
The workflow guide is a living document.
80+
You are welcome to propose changes to the workflow by
81+
[opening an issue](https://github.com/fortran-lang/stdlib/issues/new/choose) or
82+
[starting a discussion](https://github.com/fortran-lang/stdlib/discussions/new).
83+
84+
85+
## General guidelines
86+
87+
* A PR should implement *only one* feature or bug fix.
88+
* Do not commit changes to files that are irrelevant to your feature or bug fix.
89+
* Smaller PRs are better than large PRs, and will lead to a shorter review and
90+
merge cycle.
91+
* Add tests for your feature or bug fix to be sure that it stays functional and useful.
92+
* Be open to constructive criticism and requests for improving your code.
93+
* Again, please follow the
94+
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md).
95+
96+
97+
## For new contributors
98+
99+
If you have never created a pull request before, welcome :tada:.
100+
You can learn how from
101+
[this great tutorial](https://app.egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github).
102+
103+
Don’t know where to start?
104+
You can start by looking through the list of
105+
[open issues](https://github.com/fortran-lang/stdlib/issues).

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@
33
[![Actions Status](https://github.com/fortran-lang/stdlib/workflows/CI/badge.svg)](https://github.com/fortran-lang/stdlib/actions)
44
[![Actions Status](https://github.com/fortran-lang/stdlib/workflows/CI_windows/badge.svg)](https://github.com/fortran-lang/stdlib/actions)
55

6+
* [Goals and Motivation](#goals-and-motivation)
7+
* [Scope](#scope)
8+
* [Getting started](#getting-started)
9+
- [Get the code](#get-the-code)
10+
- [Requirements](#requirements)
11+
- [Supported compilers](#supported-compilers)
12+
- [Build with CMake](#build-with-cmake)
13+
- [Build with make](#build-with-make)
14+
* [Using stdlib in your project](#using-stdlib-in-your-project)
15+
* [Documentation](#documentation)
16+
* [Contributing](#contributing)
17+
* [Links](#links)
618

719
## Goals and Motivation
820

@@ -75,19 +87,25 @@ The following combinations are tested on the default branch of stdlib:
7587

7688
Name | Version | Platform | Architecture
7789
--- | --- | --- | ---
78-
GCC Fortran | 7, 8, 9, 10 | Ubuntu 18.04 | x86_64
79-
GCC Fortran | 7, 8, 9, 10 | MacOS Catalina 10.15 | x86_64
80-
GCC Fortran | 8 | Windows Server 2019 | x86_64
90+
GCC Fortran | 9, 10, 11 | Ubuntu 20.04 | x86_64
91+
GCC Fortran | 9, 10, 11 | MacOS Catalina 10.15 | x86_64
8192
GCC Fortran (MSYS) | 10 | Windows Server 2019 | x86_64
8293
GCC Fortran (MinGW) | 10 | Windows Server 2019 | x86_64, i686
8394
Intel oneAPI classic | 2021.1 | Ubuntu 20.04 | x86_64
95+
Intel oneAPI classic | 2021.1 | MacOS Catalina 10.15 | x86_64
96+
97+
The following combinations are known to work, but they are not tested in the CI:
98+
99+
Name | Version | Platform | Architecture
100+
--- | --- | --- | ---
101+
GCC Fortran (MinGW) | 8.4.0, 9.3.0, 10.2.0 | Windows 10 | x86_64, i686
84102

85103
We try to test as many available compilers and platforms as possible.
86104
A list of tested compilers which are currently not working and the respective issue are listed below.
87105

88106
Name | Version | Platform | Architecture | Status
89107
--- | --- | --- | --- | ---
90-
GCC Fortran | 7.4 | Windows 10 | i686 | [#296](https://github.com/fortran-lang/stdlib/issues/296)
108+
GCC Fortran | <9 | any | any | [#296](https://github.com/fortran-lang/stdlib/issues/296), [#430](https://github.com/fortran-lang/stdlib/pull/430)
91109
NVIDIA HPC SDK | 20.7, 20.9, 20.11 | Manjaro Linux 20 | x86_64 | [#107](https://github.com/fortran-lang/stdlib/issues/107)
92110
NAG | 7.0 | RHEL | x86_64 | [#108](https://github.com/fortran-lang/stdlib/issues/108)
93111
Intel Parallel Studio XE | 16, 17, 18 | OpenSUSE | x86_64 | failed to compile
@@ -109,7 +127,8 @@ Important options are
109127
- `-G Ninja` to use the Ninja backend instead of the default Make backend. Other build backends are available with a similar syntax.
110128
- `-DCMAKE_INSTALL_PREFIX` is used to provide the install location for the library.
111129
- `-DCMAKE_MAXIMUM_RANK` the maximum array rank procedures should be generated for.
112-
The default is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.
130+
The default value is chosen as 4.
131+
The maximum is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.
113132
The minimum required rank to compile this project is 4.
114133
Compiling with maximum rank 15 can be resource intensive and requires at least 16 GB of memory to allow parallel compilation or 4 GB memory for sequential compilation.
115134
- `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`).
@@ -132,7 +151,7 @@ To test your build, run the test suite after the build has finished with
132151
cmake --build build --target test
133152
```
134153

135-
Please report failing tests on our [issue tracker](https://github.com/fortran-lang/stdlib/issues/new/choose) including details on the compiler used, the operating system and platform architecture.
154+
Please report failing tests on our [issue tracker](https://github.com/fortran-lang/stdlib/issues/new/choose) including details of the compiler used, the operating system and platform architecture.
136155

137156
To install the project to the declared prefix run
138157

@@ -200,6 +219,7 @@ Some discussions and prototypes of proposed APIs along with a list of popular op
200219

201220
## Contributing
202221

222+
* [Guidelines](CONTRIBUTING.md)
203223
* [Issues](https://github.com/fortran-lang/stdlib/issues)
204224
* [Workflow](WORKFLOW.md)
205225
* [Style guide](STYLE_GUIDE.md)

0 commit comments

Comments
 (0)