Skip to content

Commit bd6c97c

Browse files
author
Jim-215-Fisher
committed
Merge remote-tracking branch 'upstream/master' into Distribution-Uniform
2 parents 7bdfc05 + 8bfcdf9 commit bd6c97c

38 files changed

+2666
-1310
lines changed

.github/ISSUE_TEMPLATE/01_bug.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/01_bug.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Bug Report
2+
description: Something is not working
3+
labels: [bug]
4+
body:
5+
- type: textarea
6+
id: description
7+
attributes:
8+
label: Description
9+
placeholder: Please include steps to reproduce your issue, provide example code snippets if possible
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: expected
14+
attributes:
15+
label: Expected Behaviour
16+
placeholder: What did you expect to happen instead
17+
validations:
18+
required: true
19+
- type: input
20+
id: stdlib-version
21+
attributes:
22+
label: Version of stdlib
23+
placeholder: 86ed2f3af570e2e09bdf03f1b74cdc4c4b13b43d, ...
24+
validations:
25+
required: true
26+
- type: input
27+
id: platform
28+
attributes:
29+
label: Platform and Architecture
30+
placeholder: MacOS/ARM, Windows, OpenBSD, ...
31+
validations:
32+
required: true
33+
- type: textarea
34+
id: additional
35+
attributes:
36+
label: Additional Information
37+
placeholder: Further relevant context, i.e. links to other issues
38+
validations:
39+
required: false

.github/ISSUE_TEMPLATE/02_proposal.md

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Feature Proposal
2+
description: Suggestion for new functionality in stdlib
3+
labels: [idea]
4+
body:
5+
- type: textarea
6+
id: motivation
7+
attributes:
8+
label: Motivation
9+
placeholder: |
10+
What is the purpose of this proposal. Please provide usage examples for the new functionality as well.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: prior-art
15+
attributes:
16+
label: Prior Art
17+
placeholder: |
18+
Include links and references to other package manager or build systems if available.
19+
validations:
20+
required: false
21+
- type: textarea
22+
id: additional
23+
attributes:
24+
label: Additional Information
25+
placeholder: Further relevant context, i.e. links to other issues
26+
validations:
27+
required: false
28+

.github/ISSUE_TEMPLATE/03_free.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
name: Free Form
3+
about: If the topic doesn't fit anything above and is not suitable for the lists below
4+
---

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
contact_links:
2+
- name: Stdlib discussion board
3+
url: https://github.com/fortran-lang/stdlib/discussions
4+
about: Discussion about stdlib related topics
5+
- name: Fortran-lang discourse
6+
url: https://fortran-lang.discourse.group/
7+
about: Discussion about all things Fortran
8+
- name: Fortran-lang mailing list
9+
url: https://groups.io/g/fortran-lang
10+
about: Mailinglist for the Fortran language

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
5050
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
5151
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
52-
--slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
52+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
5353
5454
- name: Install GFortran macOS
5555
if: contains( matrix.os, 'macos')

.github/workflows/fpm-deployment.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: fpm-deployment
2+
3+
on: [push, pull_request]
4+
env:
5+
GCC_V: "10"
6+
7+
jobs:
8+
Build:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout 🛎️
13+
uses: actions/checkout@v2.3.1
14+
15+
- name: Set up Python 3.x
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.x
19+
20+
- name: Install fypp
21+
run: pip install --upgrade fypp
22+
23+
- name: Generate stdlib-fpm package 🔧
24+
run: |
25+
bash ./ci/fpm-deployment.sh
26+
27+
- name: Install GFortran
28+
run: |
29+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ env.GCC_V }} 100 \
30+
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ env.GCC_V }} \
31+
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ env.GCC_V }}
32+
33+
- name: Install fpm latest release
34+
uses: fortran-lang/setup-fpm@v3
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Run fpm test ⚙
39+
run: |
40+
cp -r stdlib-fpm stdlib-fpm-test
41+
cd stdlib-fpm-test
42+
fpm test
43+
fpm test --profile release
44+
45+
# Update and deploy the f90 files generated by github-ci to the `stdlib-fpm` branch.
46+
- name: Deploy 🚀
47+
uses: JamesIves/github-pages-deploy-action@4.1.5
48+
if: github.event_name != 'pull_request'
49+
with:
50+
BRANCH: stdlib-fpm
51+
FOLDER: stdlib-fpm

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ API-doc/
3939

4040
# Build directory for out-of-tree builds
4141
/build
42+
/stdlib-fpm
4243

4344
# Emacs backup files
4445
*~
46+
47+
# Files generated by tests
48+
*log*.txt
49+
*test*.txt
50+
scratch.txt

CONTRIBUTORS.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2019 Fortran stdlib developers
3+
Copyright (c) 2019-2021 stdlib contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [Supported compilers](#supported-compilers)
1212
- [Build with CMake](#build-with-cmake)
1313
- [Build with make](#build-with-make)
14+
- [Build with fortran-lang/fpm](#build-with-fortran-langfpm)
1415
* [Using stdlib in your project](#using-stdlib-in-your-project)
1516
* [Documentation](#documentation)
1617
* [Contributing](#contributing)
@@ -125,7 +126,7 @@ You can pass additional options to CMake to customize the build.
125126
Important options are
126127

127128
- `-G Ninja` to use the Ninja backend instead of the default Make backend. Other build backends are available with a similar syntax.
128-
- `-DCMAKE_INSTALL_PREFIX` is used to provide the install location for the library.
129+
- `-DCMAKE_INSTALL_PREFIX` is used to provide the install location for the library. If not provided the defaults will depend on your operating system, [see here](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html).
129130
- `-DCMAKE_MAXIMUM_RANK` the maximum array rank procedures should be generated for.
130131
The default value is chosen as 4.
131132
The maximum is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.
@@ -170,13 +171,27 @@ Alternatively, you can build using provided Makefiles:
170171
make -f Makefile.manual
171172
```
172173

173-
You can limit the maximum rank by setting ``-DMAXRANK=<num>`` in the ``FYPPFLAGS`` environment variable:
174+
You can limit the maximum rank by setting ``-DMAXRANK=<num>`` in the ``FYPPFLAGS`` environment variable (which can reduce the compilation time):
174175

175176
```sh
176177
make -f Makefile.manual FYPPFLAGS=-DMAXRANK=4
177178
```
178179

180+
### Build with [fortran-lang/fpm](https://github.com/fortran-lang/fpm)
179181

182+
Fortran Package Manager (fpm) is a package manager and build system for Fortran.
183+
You can build `stdlib` using provided `fpm.toml`:
184+
185+
```sh
186+
git checkout stdlib-fpm
187+
fpm build --profile release
188+
```
189+
190+
To use `stdlib` within your `fpm` project, add the following lines to your `fpm.toml` file:
191+
```toml
192+
[dependencies]
193+
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm" }
194+
```
180195

181196
## Using stdlib in your project
182197

@@ -196,7 +211,7 @@ target_link_libraries(
196211
```
197212

198213
To make the installed stdlib project discoverable add the stdlib directory to the ``CMAKE_PREFIX_PATH``.
199-
The usual install localtion of the package files is ``$PREFIX/lib/cmake/fortran_stdlib``.
214+
The usual install location of the package files is ``$PREFIX/lib/cmake/fortran_stdlib``.
200215

201216
For non-CMake build systems (like make) you can use the exported pkg-config file by setting ``PKG_CONFIG_PATH`` to include the directory containing the exported pc-file.
202217
The usual install location of the pc-file is ``$PREFIX/lib/pkgconfig``.

ci/fpm-deployment.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
3+
set -ex
4+
5+
# Target directory to deploy stdlib to
6+
destdir="${DESTDIR:-stdlib-fpm}"
7+
8+
# Get fypp preprocessor
9+
fypp="${FYPP:-$(which fypp)}"
10+
11+
# Arguments for the fypp preprocessor
12+
fyflags="${FYFLAGS:--DMAXRANK=4}"
13+
14+
# Number of parallel jobs for preprocessing
15+
njob="$(nproc)"
16+
17+
# Additional files to include
18+
include=(
19+
"ci/fpm.toml"
20+
"LICENSE"
21+
)
22+
23+
# Files to remove from collection
24+
prune=(
25+
"$destdir/test/test_always_fail.f90"
26+
"$destdir/test/test_always_skip.f90"
27+
"$destdir/test/test_mean_f03.f90"
28+
"$destdir/src/common.f90"
29+
"$destdir/src/f18estop.f90"
30+
)
31+
32+
mkdir -p "$destdir/src" "$destdir/test"
33+
34+
# Preprocess stdlib sources
35+
find src -maxdepth 1 -iname "*.fypp" \
36+
| cut -f1 -d. | xargs -P "$njob" -I{} "$fypp" "{}.fypp" "$destdir/{}.f90" $fyflags
37+
38+
# Collect stdlib source files
39+
find src -maxdepth 1 -iname "*.f90" -exec cp {} "$destdir/src/" \;
40+
find src/tests -name "test_*.f90" -exec cp {} "$destdir/test/" \;
41+
find src/tests -name "*.dat" -exec cp {} "$destdir/" \;
42+
43+
# Include additional files
44+
cp "${include[@]}" "$destdir/"
45+
46+
# Source file workarounds for fpm
47+
rm "${prune[@]}"
48+
49+
# List stdlib-fpm package contents
50+
ls -R "$destdir"

ci/fpm.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name = "stdlib"
2+
version = "0.0.0"
3+
license = "MIT"
4+
author = "stdlib contributors"
5+
maintainer = "@fortran-lang/stdlib"
6+
copyright = "2019-2021 stdlib contributors"

config/CMakeLists.txt

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# SPDX-Identifier: MIT
22

3-
option(
4-
CMAKE_INSTALL_MODULEDIR
5-
"Directory in prefix to install generated module files"
6-
"${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
7-
)
3+
if(NOT DEFINED CMAKE_INSTALL_MODULEDIR)
4+
set(
5+
CMAKE_INSTALL_MODULEDIR
6+
"${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${CMAKE_Fortran_COMPILER_ID}-${CMAKE_Fortran_COMPILER_VERSION}"
7+
CACHE
8+
STRING
9+
"Directory in prefix to install generated module files"
10+
)
11+
endif()
812

913
# Export a pkg-config file
1014
configure_file(

doc/specs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ This is and index/directory of the specifications (specs) for each new module/fe
2727
- [stats_distribution_uniform](./stdlib_stats_distribution_uniform.html) - Uniform probability distribution
2828
- [string\_type](./stdlib_string_type.html) - Basic string support
2929
- [strings](./stdlib_strings.html) - String handling and manipulation routines
30+
- [stringlist_type](./stdlib_stringlist_type.html) - 1-Dimensional list of strings
3031

3132
## Released/Stable Features & Modules
3233

0 commit comments

Comments
 (0)