Skip to content

Commit 53874c9

Browse files
authored
Merge branch 'master' into add_close
2 parents adfb820 + 7758a1d commit 53874c9

Some content is hidden

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

71 files changed

+3313
-177
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--
2+
Thank you for contributing to stdlib.
3+
To help us get your pull request merged more quickly, please consider reviewing any of the already open pull requests.
4+
-->

.github/workflows/CI.yml

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,18 @@ jobs:
2121
matrix:
2222
os: [ubuntu-latest, macos-latest]
2323
gcc_v: [9, 10, 11] # Version of GFortran we want to use.
24+
build: [cmake]
25+
include:
26+
- os: ubuntu-latest
27+
gcc_v: 10
28+
build: cmake-inline
29+
- os: ubuntu-latest
30+
gcc_v: 10
31+
build: make
2432
env:
2533
FC: gfortran-${{ matrix.gcc_v }}
2634
GCC_V: ${{ matrix.gcc_v }}
35+
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
2736

2837
steps:
2938
- name: Checkout code
@@ -58,39 +67,38 @@ jobs:
5867
brew link gcc@${GCC_V}
5968
6069
- name: Configure with CMake
70+
if: ${{ contains(matrix.build, 'cmake') }}
6171
run: >-
6272
cmake -Wdev
6373
-DCMAKE_BUILD_TYPE=Release
6474
-DCMAKE_MAXIMUM_RANK:String=4
6575
-DCMAKE_INSTALL_PREFIX=$PWD/_dist
66-
-S . -B build
76+
-S . -B ${{ env.BUILD_DIR }}
6777
6878
- name: Build and compile
69-
run: cmake --build build --parallel
79+
if: ${{ contains(matrix.build, 'cmake') }}
80+
run: cmake --build ${{ env.BUILD_DIR }} --parallel
7081

7182
- name: catch build fail
72-
run: cmake --build build --verbose --parallel 1
73-
if: failure()
83+
run: cmake --build ${{ env.BUILD_DIR }} --verbose --parallel 1
84+
if: ${{ failure() && contains(matrix.build, 'cmake') }}
7485

7586
- name: test
76-
run: ctest --test-dir build --parallel --output-on-failure
87+
if: ${{ contains(matrix.build, 'cmake') }}
88+
run: ctest --test-dir ${{ env.BUILD_DIR }} --parallel --output-on-failure
7789

7890
- name: Install project
79-
run: cmake --install build
80-
81-
- name: Test in-tree builds
82-
if: contains( matrix.gcc_v, '10') # Only test one compiler on each platform
83-
run: |
84-
cmake -DCMAKE_MAXIMUM_RANK=4 .
85-
cmake --build .
86-
cmake --build . --target test
91+
if: ${{ contains(matrix.build, 'cmake') }}
92+
run: cmake --install ${{ env.BUILD_DIR }}
8793

8894
- name: Test manual makefiles
89-
if: contains(matrix.os, 'ubuntu') && contains(matrix.gcc_v, '10')
95+
if: ${{ matrix.build == 'make' }}
9096
run: |
91-
make -f Makefile.manual FYPPFLAGS="-DMAXRANK=4" -j
97+
make -f Makefile.manual -j
9298
make -f Makefile.manual test
9399
make -f Makefile.manual clean
100+
env:
101+
FYPPFLAGS: "-DMAXRANK=4"
94102

95103
intel-build:
96104
runs-on: ${{ matrix.os }}

API-doc-FORD-file.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ media_dir: doc/media
99
fpp_extensions: fypp
1010
preprocess: true
1111
macro: MAXRANK=3
12+
PROJECT_VERSION_MAJOR=0
13+
PROJECT_VERSION_MINOR=0
14+
PROJECT_VERSION_PATCH=0
1215
preprocessor: fypp
1316
display: public
1417
protected

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
# Unreleased
22

3+
Features available from the latest git source
4+
5+
- new module `stdlib_distribution_uniform`
6+
[#272](https://github.com/fortran-lang/stdlib/pull/272)
7+
- new module `stdlib_selection`
8+
[#500](https://github.com/fortran-lang/stdlib/pull/500)
9+
- new procedures `select`, `arg_select`
10+
- new module `stdlib_version`
11+
[#579](https://github.com/fortran-lang/stdlib/pull/579)
12+
- new procedure `get_stdlib_version`
13+
- new module `stdlib_io_npy`
14+
[#581](https://github.com/fortran-lang/stdlib/pull/581)
15+
- new procedures `save_npy`, `load_npy`
16+
17+
Changes to existing modules
18+
19+
- change in module `stdlib_math`
20+
- `linspace` and `logspace` made pure
21+
[#549](https://github.com/fortran-lang/stdlib/pull/549)
22+
- change in module `stdlib_string_type`
23+
- `move` procedure made *pure*/*elemental*
24+
[#562](https://github.com/fortran-lang/stdlib/pull/562)
25+
- support for quadruple precision made optional
26+
[#565](https://github.com/fortran-lang/stdlib/pull/565)
27+
328

429
# Version 0.1.0
530

CMakeLists.txt

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
cmake_minimum_required(VERSION 3.14.0)
22
project(fortran_stdlib
33
LANGUAGES Fortran
4-
VERSION 0.1.0
54
DESCRIPTION "Community driven and agreed upon de facto standard library for Fortran"
65
)
6+
7+
# Read version from file
8+
file(STRINGS "${PROJECT_SOURCE_DIR}/VERSION" PROJECT_VERSION)
9+
string(REPLACE "." ";" VERSION_LIST ${PROJECT_VERSION})
10+
list(GET VERSION_LIST 0 PROJECT_VERSION_MAJOR)
11+
list(GET VERSION_LIST 1 PROJECT_VERSION_MINOR)
12+
list(GET VERSION_LIST 2 PROJECT_VERSION_PATCH)
13+
unset(VERSION_LIST)
14+
715
enable_testing()
816

917
# Follow GNU conventions for installation directories
@@ -24,7 +32,6 @@ if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU)
2432
add_compile_options(-Wall)
2533
add_compile_options(-Wextra)
2634
add_compile_options(-Wimplicit-procedure)
27-
add_compile_options(-Wconversion-extra)
2835
# -pedantic-errors triggers a false positive for optional arguments of elemental functions,
2936
# see test_optval and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95446
3037
if(CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 11.0)
@@ -55,7 +62,7 @@ endif()
5562
# --- find preprocessor
5663
find_program(FYPP fypp)
5764
if(NOT FYPP)
58-
message(FATAL_ERROR "Preprocessor fypp not found!")
65+
message(FATAL_ERROR "Preprocessor fypp not found! Please install fypp following the instructions in https://fypp.readthedocs.io/en/stable/fypp.html#installing")
5966
endif()
6067

6168
add_subdirectory(src)

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ You are welcome to propose changes to the workflow by
8989
* Smaller PRs are better than large PRs, and will lead to a shorter review and
9090
merge cycle.
9191
* Add tests for your feature or bug fix to be sure that it stays functional and useful.
92+
* Include new features and changes in the
93+
[CHANGELOG](https://github.com/fortran-lang/stdlib/blob/master/CHANGELOG.md)
9294
* Be open to constructive criticism and requests for improving your code.
9395
* Again, please follow the
9496
[Fortran stdlib style guide](https://github.com/fortran-lang/stdlib/blob/master/STYLE_GUIDE.md).

Makefile.manual

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ FC ?= gfortran
44
FFLAGS ?= -Wall -Wextra -Wimplicit-interface -fPIC -g -fcheck=all
55
FYPPFLAGS ?=
66

7+
VERSION := $(subst ., ,$(file < VERSION))
8+
FYPPFLAGS += \
9+
-DPROJECT_VERSION_MAJOR=$(word 1,$(VERSION)) \
10+
-DPROJECT_VERSION_MINOR=$(word 2,$(VERSION)) \
11+
-DPROJECT_VERSION_PATCH=$(word 3,$(VERSION))
12+
713
export FC
814
export FFLAGS
915
export FYPPFLAGS

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

ci/fpm-deployment.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,17 @@ fypp="${FYPP:-$(which fypp)}"
1212
fyflags="${FYFLAGS:--DMAXRANK=4}"
1313

1414
# Number of parallel jobs for preprocessing
15-
njob="$(nproc)"
15+
if [ $(uname) = "Darwin" ]; then
16+
njob="$(sysctl -n hw.ncpu)"
17+
else
18+
njob="$(nproc)"
19+
fi
1620

1721
# Additional files to include
1822
include=(
1923
"ci/fpm.toml"
2024
"LICENSE"
25+
"VERSION"
2126
)
2227

2328
# Files to remove from collection
@@ -28,6 +33,11 @@ prune=(
2833
"$destdir/src/f18estop.f90"
2934
)
3035

36+
major=$(cut -d. -f1 VERSION)
37+
minor=$(cut -d. -f2 VERSION)
38+
patch=$(cut -d. -f3 VERSION)
39+
fyflags="${fyflags} -DPROJECT_VERSION_MAJOR=${major} -DPROJECT_VERSION_MINOR=${minor} -DPROJECT_VERSION_PATCH=${patch}"
40+
3141
mkdir -p "$destdir/src" "$destdir/test"
3242

3343
# Preprocess stdlib sources

ci/fpm.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name = "stdlib"
2-
version = "0.1.0"
2+
version = "VERSION"
33
license = "MIT"
44
author = "stdlib contributors"
55
maintainer = "@fortran-lang/stdlib"
66
copyright = "2019-2021 stdlib contributors"
77

88
[dev-dependencies]
99
test-drive.git = "https://github.com/fortran-lang/test-drive"
10+
test-drive.tag = "v0.4.0"

0 commit comments

Comments
 (0)