Skip to content

Commit 87192e9

Browse files
committed
Merge branch 'master' into hashap-keytype-generic
2 parents df7fb6b + c79c8b9 commit 87192e9

Some content is hidden

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

56 files changed

+4544
-1074
lines changed

.github/workflows/CI.yml

+22-178
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,25 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
os: [ubuntu-latest, macos-12]
23-
gcc_v: [10, 11, 12, 13] # Version of GFortran we want to use.
23+
toolchain:
24+
- {compiler: gcc, version: 10}
25+
- {compiler: gcc, version: 11}
26+
- {compiler: gcc, version: 12}
27+
- {compiler: gcc, version: 13}
28+
- {compiler: intel, version: '2024.1'}
29+
- {compiler: intel-classic, version: '2021.9'}
2430
build: [cmake]
2531
include:
2632
- os: ubuntu-latest
27-
gcc_v: 10
2833
build: cmake-inline
34+
toolchain:
35+
- {compiler: gcc, version: 10}
36+
exclude:
37+
- os: macos-12
38+
toolchain: {compiler: intel, version: '2024.1'}
39+
- os: macos-12
40+
toolchain: {compiler: gcc, version: 13}
2941
env:
30-
FC: gfortran-${{ matrix.gcc_v }}
31-
CC: gcc-${{ matrix.gcc_v }}
32-
CXX: g++-${{ matrix.gcc_v }}
33-
GCC_V: ${{ matrix.gcc_v }}
3442
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
3543

3644
steps:
@@ -43,29 +51,19 @@ jobs:
4351
python-version: 3.x
4452

4553
- name: Install fypp
46-
run: pip install --upgrade fypp
54+
run: pip install --upgrade fypp ninja
4755

48-
- name: Install GCC compilers Linux
49-
if: contains( matrix.os, 'ubuntu')
50-
run: |
51-
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
52-
sudo apt-get update
53-
sudo apt-get install -y gcc-${GCC_V} g++-${GCC_V} gfortran-${GCC_V}
54-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
55-
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
56-
--slave /usr/bin/g++ g++ /usr/bin/g++-${GCC_V} \
57-
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
58-
59-
- name: Install GCC compilers macOS
60-
if: contains( matrix.os, 'macos')
61-
run: |
62-
brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
63-
brew link gcc@${GCC_V}
56+
- name: Setup Fortran compiler
57+
uses: fortran-lang/[email protected]
58+
id: setup-fortran
59+
with:
60+
compiler: ${{ matrix.toolchain.compiler }}
61+
version: ${{ matrix.toolchain.version }}
6462

6563
- name: Configure with CMake
6664
if: ${{ contains(matrix.build, 'cmake') }}
6765
run: >-
68-
cmake -Wdev
66+
cmake -Wdev -G Ninja
6967
-DCMAKE_BUILD_TYPE=Release
7068
-DCMAKE_MAXIMUM_RANK:String=4
7169
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
@@ -91,157 +89,3 @@ jobs:
9189
- name: Install project
9290
if: ${{ contains(matrix.build, 'cmake') }}
9391
run: cmake --install ${{ env.BUILD_DIR }}
94-
95-
intel-build-llvm:
96-
runs-on: ${{ matrix.os }}
97-
strategy:
98-
fail-fast: false
99-
matrix:
100-
os: [ubuntu-latest]
101-
fc: [ifx]
102-
cc: [icx]
103-
cxx: [icpx]
104-
env:
105-
FC: ${{ matrix.fc }}
106-
CC: ${{ matrix.cc }}
107-
CXX: ${{ matrix.cxx }}
108-
109-
steps:
110-
- name: Checkout code
111-
uses: actions/checkout@v4
112-
113-
- name: Set up Python 3.x
114-
uses: actions/setup-python@v5
115-
with:
116-
python-version: 3.x
117-
118-
- name: Add Intel repository (Linux)
119-
if: contains(matrix.os, 'ubuntu')
120-
run: |
121-
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
122-
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
123-
sudo apt-get update
124-
125-
- name: Install Intel oneAPI compiler (Linux)
126-
if: contains(matrix.os, 'ubuntu')
127-
run: |
128-
sudo apt-get install intel-oneapi-compiler-fortran
129-
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp
130-
131-
- name: Setup Intel oneAPI environment
132-
run: |
133-
source /opt/intel/oneapi/setvars.sh
134-
printenv >> $GITHUB_ENV
135-
136-
- name: Install fypp
137-
run: pip install --upgrade fypp
138-
139-
- name: Configure with CMake
140-
run: >-
141-
cmake -Wdev
142-
-DCMAKE_BUILD_TYPE=Release
143-
-DCMAKE_MAXIMUM_RANK:String=4
144-
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
145-
-S . -B build
146-
147-
- name: Build and compile
148-
run: cmake --build build
149-
150-
- name: catch build fail
151-
run: cmake --build build --verbose --parallel 1
152-
if: failure()
153-
154-
- name: test
155-
run: ctest --parallel --output-on-failure --no-tests=error
156-
working-directory: build
157-
158-
- name: Install project
159-
run: cmake --install build
160-
161-
intel-build-classic:
162-
runs-on: ${{ matrix.os }}
163-
strategy:
164-
fail-fast: false
165-
matrix:
166-
os: [macos-12]
167-
fc: [ifort]
168-
cc: [icc]
169-
cxx: [icpc]
170-
env:
171-
MACOS_HPCKIT_URL: >-
172-
https://registrationcenter-download.intel.com/akdlm/IRC_NAS/a99cb1c5-5af6-4824-9811-ae172d24e594/m_HPCKit_p_2023.1.0.44543.dmg
173-
MACOS_FORTRAN_COMPONENTS: all
174-
FC: ${{ matrix.fc }}
175-
CC: ${{ matrix.cc }}
176-
CXX: ${{ matrix.cxx }}
177-
178-
steps:
179-
- name: Checkout code
180-
uses: actions/checkout@v4
181-
182-
- name: Set up Python 3.x
183-
uses: actions/setup-python@v5
184-
with:
185-
python-version: 3.x
186-
187-
- name: Prepare for cache restore (OSX)
188-
if: contains(matrix.os, 'macos')
189-
run: |
190-
sudo mkdir -p /opt/intel
191-
sudo chown $USER /opt/intel
192-
193-
- name: Cache Intel install (OSX)
194-
if: contains(matrix.os, 'macos')
195-
id: cache-install
196-
uses: actions/cache@v2
197-
with:
198-
path: /opt/intel/oneapi
199-
key: install-${{ env.MACOS_HPCKIT_URL }}-${{ env.MACOS_FORTRAN_COMPONENTS }}
200-
201-
- name: Install Intel oneAPI compiler (OSX)
202-
if: contains(matrix.os, 'macos') && steps.cache-install.outputs.cache-hit != 'true'
203-
run: |
204-
curl --output webimage.dmg --url "$URL" --retry 5 --retry-delay 5
205-
hdiutil attach webimage.dmg
206-
if [ -z "$COMPONENTS" ]; then
207-
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --eula=accept --continue-with-optional-error=yes --log-dir=.
208-
installer_exit_code=$?
209-
else
210-
sudo /Volumes/"$(basename "$URL" .dmg)"/bootstrapper.app/Contents/MacOS/bootstrapper -s --action install --components="$COMPONENTS" --eula=accept --continue-with-optional-error=yes --log-dir=.
211-
installer_exit_code=$?
212-
fi
213-
hdiutil detach /Volumes/"$(basename "$URL" .dmg)" -quiet
214-
exit $installer_exit_code
215-
env:
216-
URL: ${{ env.MACOS_HPCKIT_URL }}
217-
COMPONENTS: ${{ env.MACOS_FORTRAN_COMPONENTS }}
218-
219-
- name: Setup Intel oneAPI environment
220-
run: |
221-
source /opt/intel/oneapi/setvars.sh
222-
printenv >> $GITHUB_ENV
223-
224-
- name: Install fypp
225-
run: pip install --upgrade fypp
226-
227-
- name: Configure with CMake
228-
run: >-
229-
cmake -Wdev
230-
-DCMAKE_BUILD_TYPE=Release
231-
-DCMAKE_MAXIMUM_RANK:String=4
232-
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
233-
-S . -B build
234-
235-
- name: Build and compile
236-
run: cmake --build build
237-
238-
- name: catch build fail
239-
run: cmake --build build --verbose --parallel 1
240-
if: failure()
241-
242-
- name: test
243-
run: ctest --parallel --output-on-failure --no-tests=error
244-
working-directory: build
245-
246-
- name: Install project
247-
run: cmake --install build

.github/workflows/fpm-deployment.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ jobs:
3535
with:
3636
fpm-version: 'v0.10.0'
3737

38-
- run: |
38+
- run: | # Just for deployment: create stdlib-fpm folder
3939
python config/fypp_deployment.py --deploy_stdlib_fpm
40-
fpm test --profile release
40+
41+
- run: | # Use fpm gnu ci to check xdp and qp
42+
python config/fypp_deployment.py --with_xdp --with_qp
43+
fpm test --profile release --flag '-DWITH_XDP -DWITH_QP'
4144
4245
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
4346
- name: Deploy 🚀

CHANGELOG.md

+50
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,53 @@
1+
# Version 0.6.1
2+
3+
Full release notes available at [v0.6.1] tag.
4+
5+
[v0.6.1]: https://github.com/fortran-lang/stdlib/releases/tag/v0.6.1
6+
7+
Changes to existing scripts and modules
8+
- changes in module `stdlib_linalg_lapack`
9+
- Renamed variable for compiler compliance
10+
[#812](https://github.com/fortran-lang/stdlib/pull/812)
11+
- change of the format in some example programs
12+
[#813](https://github.com/fortran-lang/stdlib/pull/813)
13+
14+
15+
# Version 0.6.0
16+
17+
Full release notes available at [v0.6.0] tag.
18+
19+
[v0.6.0]: https://github.com/fortran-lang/stdlib/releases/tag/v0.6.0
20+
21+
22+
- new script `fypp_deployment.py` to support `fpm` in combination with `fypp`
23+
files
24+
[#802](https://github.com/fortran-lang/stdlib/pull/802)
25+
26+
27+
Changes to existing scripts and modules
28+
- change in module `stdlib_hashmap_wrappers`
29+
- addition of `int32` hashmap key type
30+
[#778](https://github.com/fortran-lang/stdlib/pull/778)
31+
- changes in module `stdlib_linalg`
32+
- addition of the procedure `det` to compute determinants
33+
[#798](https://github.com/fortran-lang/stdlib/pull/798)
34+
- addition of the procedures `lstsq` and `lstsq_space`
35+
[#801](https://github.com/fortran-lang/stdlib/pull/801)
36+
[#809](https://github.com/fortran-lang/stdlib/pull/809)
37+
- addition of the procedures `solve` and `solve_lu`
38+
[#806](https://github.com/fortran-lang/stdlib/pull/806)
39+
- change in module `stdlib_linalg_blas`
40+
- addition of the documentation for `rotm` and `rotmg`
41+
[#795](https://github.com/fortran-lang/stdlib/pull/795)
42+
- use of macOS 12 in macOS CI
43+
[#807](https://github.com/fortran-lang/stdlib/pull/807)
44+
45+
46+
Changes to existing documentation
47+
- Improvement of the documentation `linalg`
48+
[#797](https://github.com/fortran-lang/stdlib/pull/797)
49+
50+
151
# Version 0.5.0
252

353
Full release notes available at [v0.5.0] tag.

VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.0
1+
0.6.1

doc/specs/index.md

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ This is an index/directory of the specifications (specs) for each new module/fea
1414
- [ansi](./stdlib_ansi.html) - Terminal color and style escape sequences
1515
- [array](./stdlib_array.html) - Procedures for index manipulation and array handling
1616
- [ascii](./stdlib_ascii.html) - Procedures for handling ASCII characters
17+
- [constants](./stdlib_constants.html) - Constants
1718
- [bitsets](./stdlib_bitsets.html) - Bitset data types and procedures
1819
- [error](./stdlib_error.html) - Catching and handling errors
1920
- [hash](./stdlib_hash_procedures.html) - Hashing integer

doc/specs/stdlib_constants.md

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
---
2+
title: constants
3+
---
4+
5+
[TOC]
6+
7+
## Introduction
8+
9+
10+
The [[stdlib_constants]] module provides mathematical constants and the most common physical constants.
11+
12+
**Warning**: The names of the most common physical constants are kept short as they are inside a dedicated module.
13+
Nonetheless, in case of overlapping names, they can always be renamed as following:
14+
15+
```fortran
16+
use stdlib_constants, only: clight => c
17+
```
18+
19+
## Codata
20+
21+
The [[stdlib_codata(module)]] module defines all codata (physical) constants as derived
22+
type. The module is automatically generated with a simple
23+
[parser written in Python](https://github.com/MilanSkocic/codata/)
24+
The latest codata constants were released in 2022 by the [NIST](http://physics.nist.gov/constants)
25+
All values for the codata constants are provided as double precision reals.
26+
The names are quite long and can be aliased with shorter names.
27+
28+
The derived type [[stdlib_codata_type(module):codata_constant_type(type)]] defines:
29+
30+
* 4 members:
31+
32+
* `name` (string)
33+
* `value` (double precision real)
34+
* `uncertainty` (double precision real)
35+
* `unit` (string)
36+
37+
* 2 type-bound procedures:
38+
39+
* `print`: to print the values of the constant members;
40+
* `to_real`: to get the value or the uncertainty to the desired precision.
41+
42+
A module level interface [[stdlib_codata_type(module):to_real(interface)]] is
43+
available for getting the constant value or uncertainty of a constant.
44+
45+
## `to_real` - Get the constant value or its uncertainty.
46+
47+
### Status
48+
49+
Experimental
50+
51+
### Description
52+
53+
Convert a [[stdlib_codata_type(module):codata_constant_type(type)]] to a `real` (at least `sp`, or `dp`) scalar.
54+
**Warning**: Some constants cannot be converted to single precision `sp` reals due to the value of the exponents.
55+
56+
### Syntax
57+
58+
`r = ` [[stdlib_codata_type(module):to_real(interface)]] `(c, mold [, uncertainty])`
59+
60+
### Arguments
61+
62+
`c`: argument has `intent(in) ` and shall be of type [[stdlib_codata_type(module):codata_constant_type(type)]].
63+
64+
`mold`: argument has `intent(in)` and shall be of `real` type.
65+
**Note**: The type of the `mold` argument defines the type of the result.
66+
67+
`uncertainty` (optional): argument has `intent(in)` and shall be of `logical` type.
68+
It specifies if the uncertainty needs to be returned instead of the value. Default to `.false.`.
69+
70+
### Return value
71+
72+
Returns a scalar of `real` type which is either the value or the uncertainty of a codata constant.
73+
74+
## Example
75+
76+
```fortran
77+
{!example/constants/example_constants.f90!}
78+
```

0 commit comments

Comments
 (0)