Skip to content

Commit ce62e1f

Browse files
committed
Merge branch 'fortran-lang:master' into master
2 parents a4cc366 + 1df277f commit ce62e1f

31 files changed

+1351
-137
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: [7, 8, 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

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,16 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
2424
add_compile_options(-Wconversion-extra)
2525
# -pedantic-errors triggers a false positive for optional arguments of elemental functions,
2626
# see test_optval and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95446
27-
add_compile_options(-pedantic-errors)
27+
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 11.0)
28+
add_compile_options(-pedantic-errors)
29+
endif()
2830
if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0)
2931
add_compile_options(-std=f2018)
3032
else()
3133
add_compile_options(-std=f2008ts)
3234
endif()
3335
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL Intel)
3436
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()
3837
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 18.0)
3938
add_compile_options(-stand f15)
4039
else()

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: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,13 @@ The following combinations are tested on the default branch of stdlib:
8787

8888
Name | Version | Platform | Architecture
8989
--- | --- | --- | ---
90-
GCC Fortran | 7, 8, 9, 10 | Ubuntu 18.04 | x86_64
91-
GCC Fortran | 7, 8, 9, 10 | MacOS Catalina 10.15 | x86_64
90+
GCC Fortran | 7, 8, 9, 10, 11 | Ubuntu 20.04 | x86_64
91+
GCC Fortran | 7, 8, 9, 10, 11 | MacOS Catalina 10.15 | x86_64
9292
GCC Fortran | 8 | Windows Server 2019 | x86_64
9393
GCC Fortran (MSYS) | 10 | Windows Server 2019 | x86_64
9494
GCC Fortran (MinGW) | 10 | Windows Server 2019 | x86_64, i686
9595
Intel oneAPI classic | 2021.1 | Ubuntu 20.04 | x86_64
96+
Intel oneAPI classic | 2021.1 | MacOS Catalina 10.15 | x86_64
9697

9798
The following combinations are known to work, but they are not tested in the CI:
9899

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

219220
## Contributing
220221

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

WORKFLOW.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,74 @@ PR and proposal was approved by "vast majority".
5959

6060
You are welcome to propose changes to this workflow by opening an
6161
[issue](https://github.com/fortran-lang/stdlib/issues).
62+
63+
64+
## Build system
65+
66+
This project supports two build systems right now, CMake and make.
67+
Eventually, stdlib will be using the Fortran package manager
68+
([fpm](https://github.com/fortran-lang/fpm)) as build system as well.
69+
The effort of supporting fpm is tracked in issue
70+
[#279](https://github.com/fortran-lang/stdlib/issues/279).
71+
72+
73+
### CMake build files
74+
75+
The build files for CMake allow both in-tree, *i.e.* build artifacts share
76+
the same tree as the source files, and out-of-tree builds, *i.e.* build artifacts
77+
exist in a separate directory tree.
78+
Both build types are explicitly supported and tested, the latter strategy
79+
is recommended for local development.
80+
81+
Sources for the main library target are added in ``src/CMakeLists.txt``
82+
relative to the library target, *i.e.* no absolute paths are required.
83+
84+
To add tests, the macro ``ADDTEST`` should be used instead of the CMake function
85+
``add_test``, the macro hides creation of the executable target, linking against the
86+
main library target and registering the test.
87+
The tests themselves are defined as standalone executables in the subdirectories
88+
in ``src/tests``, a new subdirectory with tests has to be registred in
89+
``src/tests/CMakeLists.txt``.
90+
91+
The source tree should be considered read-only. References to ``PROJECT_SOURCE_DIR``
92+
and ``CMAKE_CURRENT_SOURCE_DIR`` should only be used for accessing source files,
93+
never to write build outputs, use ``PROJECT_BINARY_DIR`` and ``CMAKE_CURRENT_BINARY_DIR``
94+
to write build artifacts instead.
95+
To fully support in-tree builds, build artifacts must never have the same name as
96+
source files to avoid accidentally overwriting them, *e.g.* when preprocessing or
97+
configuring a file.
98+
99+
The ``CMAKE_INSTALL_PREFIX`` should only be written to on install, never in the build
100+
process. To install generated files, create a build output in the build tree and
101+
install it with the ``install`` function.
102+
This project follows the GNU install conventions, this means that the variables
103+
``CMAKE_INSTALL_BINDIR``, ``CMAKE_INSTALL_LIBDIR``, and ``CMAKE_INSTALL_INCLUDEDIR``
104+
must be used instead of ``bin``, ``lib``, and ``include``, respectively.
105+
Library targets should be exported on install to allow correct inclusion of the
106+
project in other CMake projects.
107+
Prefer dashes as in ``project-config`` or ``project-targets`` over camel-case as in
108+
``projectConfig`` or ``projectTarget`` for file names as the former allows easier
109+
construction from the ``PROJECT_NAME`` variable by concatenation.
110+
111+
The project is usable as CMake subproject. Explicit references to
112+
``CMAKE_SOURCE_DIR`` and ``CMAKE_BINARY_DIR`` must be avoided to not
113+
break subproject builds.
114+
An example project is available [here](https://github.com/fortran-lang/stdlib-cmake-example)
115+
to test the CMake subproject integration.
116+
117+
118+
### Make build files
119+
120+
The build files for ``make`` are using the name ``Makefile.manual`` to
121+
not conflict with the in-tree build of CMake.
122+
This project uses recursive make to transverse the subdirectory structure
123+
from the top-level makefile, called ``Makefile.manual``, and the build
124+
happens in-tree, *i.e.* build artifacts are present along with the source code.
125+
126+
New source files are added in ``src/Makefile.manual`` and include manual
127+
dependency definitions through the object files to allow parallel
128+
compilation.
129+
Tests are generated by the make include file ``src/tests/Makefile.manual.test.mk``
130+
and defined in the subdirectories of the ``src/tests`` as entries in ``PROGS_SRC``.
131+
New subdirectories have to be explicitly added to ``src/tests/Makefile.manual``
132+
or are ignored.

doc/contributing/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
title: Contributing
33
---
44

5-
This page aims to prodive information that are useful for `stdlib` contributors.
5+
This page aims to provide information that are useful for `stdlib` contributors.
66
Issues can be reported on [GitHub](https://github.com/fortran-lang/stdlib/issues).
77

0 commit comments

Comments
 (0)