Skip to content

Commit 6eb25dd

Browse files
authored
Merge branch 'master' into add_close
2 parents 122837d + f58da3b commit 6eb25dd

Some content is hidden

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

73 files changed

+11962
-6910
lines changed

.github/workflows/fpm-deployment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install fpm latest release
3434
uses: fortran-lang/setup-fpm@v3
3535
with:
36-
github-token: ${{ secrets.GITHUB_TOKEN }}
36+
fpm-version: 'v0.4.0'
3737

3838
- name: Run fpm test ⚙
3939
run: |

CHANGELOG.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Unreleased
2+
3+
4+
# Version 0.1.0
5+
6+
Full release notes available at [v0.1.0] tag.
7+
8+
[v0.1.0]: https://github.com/fortran-lang/stdlib/releases/tag/v0.1.0
9+
10+
- new module `stdlib_ascii`
11+
[#32](https://github.com/fortran-lang/stdlib/pull/32)
12+
- new module `stdlib_bitsets`
13+
[#239](https://github.com/fortran-lang/stdlib/pull/239)
14+
- new derived types `bitset_64` and `bitset_large`
15+
- new abstract base class `bitset_type`
16+
- new module `stdlib_error`
17+
[#53](https://github.com/fortran-lang/stdlib/pull/53)
18+
- new module `stdlib_io`
19+
- new procedures `loadtxt` and `savetxt`
20+
[#23](https://github.com/fortran-lang/stdlib/pull/23)
21+
[#37](https://github.com/fortran-lang/stdlib/pull/37)
22+
- new procedure `open`
23+
[#71](https://github.com/fortran-lang/stdlib/pull/71)
24+
[#77](https://github.com/fortran-lang/stdlib/pull/77)
25+
- new module `stdlib_kinds`
26+
[#63](https://github.com/fortran-lang/stdlib/pull/63)
27+
- new module `stdlib_linalg`
28+
- new procedures `diag`, `eye` and `trace`
29+
[#170](https://github.com/fortran-lang/stdlib/pull/170)
30+
- new procedure `outer_product`
31+
[#432](https://github.com/fortran-lang/stdlib/pull/432)
32+
- new module `stdlib_logger`
33+
- new derived type `logger_type`
34+
[#228](https://github.com/fortran-lang/stdlib/pull/228)
35+
[#261](https://github.com/fortran-lang/stdlib/pull/261)
36+
- new module `stdlib_math`
37+
- new procedure `clip`
38+
[#355](https://github.com/fortran-lang/stdlib/pull/355)
39+
- new procedures `linspace` and `logspace`
40+
[#420](https://github.com/fortran-lang/stdlib/pull/420)
41+
- new procedure `arange`
42+
[#480](https://github.com/fortran-lang/stdlib/pull/480)
43+
- new procedure `gcd`
44+
[#539](https://github.com/fortran-lang/stdlib/pull/539)
45+
- new module `stdlib_optval`
46+
[#73](https://github.com/fortran-lang/stdlib/pull/73)
47+
[#96](https://github.com/fortran-lang/stdlib/pull/96)
48+
[#139](https://github.com/fortran-lang/stdlib/pull/139)
49+
- new module `stdlib_quadrature`
50+
- new procedures `trapz`, `trapz_weights`, `simps` and `simps_weights`
51+
[#146](https://github.com/fortran-lang/stdlib/pull/146)
52+
- new procedures `gauss_legendre`, `gauss_legendre_lobatto`
53+
[#313](https://github.com/fortran-lang/stdlib/pull/313)
54+
- new module `stdlib_random`
55+
[#271](https://github.com/fortran-lang/stdlib/pull/271)
56+
- new module `stdlib_sorting`
57+
- new procedures `sort`, `ord_sort` and `sort_index`
58+
[#408](https://github.com/fortran-lang/stdlib/pull/408)
59+
- new module `stdlib_specialfunctions`
60+
- new procedures `legendre` and `dlegendre`
61+
[#313](https://github.com/fortran-lang/stdlib/pull/313)
62+
- new module `stdlib_stats`
63+
- new procedure `mean`
64+
[#124](https://github.com/fortran-lang/stdlib/pull/124)
65+
[#130](https://github.com/fortran-lang/stdlib/pull/130)
66+
[#132](https://github.com/fortran-lang/stdlib/pull/132)
67+
- new procedure `var`
68+
[#144](https://github.com/fortran-lang/stdlib/pull/144)
69+
- new procedure `moment`
70+
[#153](https://github.com/fortran-lang/stdlib/pull/153)
71+
- new procedure `corr`
72+
[#191](https://github.com/fortran-lang/stdlib/pull/191)
73+
- new procedure `median`
74+
[#426](https://github.com/fortran-lang/stdlib/pull/426)
75+
- new module `stdlib_string_type`
76+
- new derived types `string_type`
77+
[#320](https://github.com/fortran-lang/stdlib/pull/320)
78+
- new procedure `move`
79+
[#467](https://github.com/fortran-lang/stdlib/pull/467)
80+
- new module `stdlib_stringlist_type`
81+
- new derived types `stringlist_type` and `stringlist_index_type`
82+
[#470](https://github.com/fortran-lang/stdlib/pull/470)
83+
- new module `stdlib_strings`
84+
- new procedure `to_string`
85+
[#444](https://github.com/fortran-lang/stdlib/pull/444)
86+
- new procedures `strip` and `chomp`
87+
[#343](https://github.com/fortran-lang/stdlib/pull/343)
88+
- new procedures `starts_with` and `ends_with`
89+
[#384](https://github.com/fortran-lang/stdlib/pull/384)
90+
- new procedure `slice`
91+
[#414](https://github.com/fortran-lang/stdlib/pull/414)
92+
- new procedure `find`
93+
[#433](https://github.com/fortran-lang/stdlib/pull/433)
94+
- new procedure `replace_all`
95+
[#436](https://github.com/fortran-lang/stdlib/pull/436)
96+
- new procedures `padl` and `padr`
97+
[#441](https://github.com/fortran-lang/stdlib/pull/441)
98+
- new procedure `count`
99+
[#453](https://github.com/fortran-lang/stdlib/pull/453)
100+
- new module `stdlib_system`
101+
- new procedure `sleep`
102+
[#54](https://github.com/fortran-lang/stdlib/pull/54)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.14.0)
22
project(fortran_stdlib
33
LANGUAGES Fortran
4-
VERSION 0
4+
VERSION 0.1.0
55
DESCRIPTION "Community driven and agreed upon de facto standard library for Fortran"
66
)
77
enable_testing()

ci/fpm-deployment.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ include=(
2424
prune=(
2525
"$destdir/test/test_always_fail.f90"
2626
"$destdir/test/test_always_skip.f90"
27-
"$destdir/test/test_mean_f03.f90"
2827
"$destdir/src/common.f90"
2928
"$destdir/src/f18estop.f90"
3029
)
@@ -43,7 +42,7 @@ find src/tests -name "*.dat" -exec cp {} "$destdir/" \;
4342
# Include additional files
4443
cp "${include[@]}" "$destdir/"
4544

46-
# Source file workarounds for fpm
45+
# Source file workarounds for fpm; ignore missing files
4746
rm "${prune[@]}"
4847

4948
# List stdlib-fpm package contents

ci/fpm.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name = "stdlib"
2-
version = "0.0.0"
2+
version = "0.1.0"
33
license = "MIT"
44
author = "stdlib contributors"
55
maintainer = "@fortran-lang/stdlib"
66
copyright = "2019-2021 stdlib contributors"
7+
8+
[dev-dependencies]
9+
test-drive.git = "https://github.com/fortran-lang/test-drive"

config/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ if(NOT DEFINED CMAKE_INSTALL_MODULEDIR)
1010
)
1111
endif()
1212

13+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
14+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" PARENT_SCOPE)
15+
1316
# Export a pkg-config file
1417
configure_file(
1518
"${CMAKE_CURRENT_SOURCE_DIR}/template.pc"

config/cmake/Findtest-drive.cmake

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# SPDX-Identifier: MIT
2+
3+
#[[.rst:
4+
Find test-drive
5+
---------------
6+
7+
Makes the test-drive project available.
8+
9+
Imported Targets
10+
^^^^^^^^^^^^^^^^
11+
12+
This module provides the following imported target, if found:
13+
14+
``test-drive::test-drive``
15+
The test-drive library
16+
17+
18+
Result Variables
19+
^^^^^^^^^^^^^^^^
20+
21+
This module will define the following variables:
22+
23+
``TEST_DRIVE_FOUND``
24+
True if the test-drive library is available
25+
26+
``TEST_DRIVE_SOURCE_DIR``
27+
Path to the source directory of the test-drive project,
28+
only set if the project is included as source.
29+
30+
``TEST_DRIVE_BINARY_DIR``
31+
Path to the binary directory of the test-drive project,
32+
only set if the project is included as source.
33+
34+
Cache variables
35+
^^^^^^^^^^^^^^^
36+
37+
The following cache variables may be set to influence the library detection:
38+
39+
``TEST_DRIVE_FIND_METHOD``
40+
Methods to find or make the project available. Available methods are
41+
- ``cmake``: Try to find via CMake config file
42+
- ``pkgconf``: Try to find via pkg-config file
43+
- ``subproject``: Use source in subprojects directory
44+
- ``fetch``: Fetch the source from upstream
45+
46+
``TEST_DRIVE_DIR``
47+
Used for searching the CMake config file
48+
49+
``TEST_DRIVE_SUBPROJECT``
50+
Directory to find the test-drive subproject, relative to the project root
51+
52+
#]]
53+
54+
set(_lib "test-drive")
55+
set(_pkg "TEST_DRIVE")
56+
set(_url "https://github.com/fortran-lang/test-drive")
57+
58+
if(NOT DEFINED "${_pkg}_FIND_METHOD")
59+
if(DEFINED "${PROJECT_NAME}-dependency-method")
60+
set("${_pkg}_FIND_METHOD" "${${PROJECT_NAME}-dependency-method}")
61+
else()
62+
set("${_pkg}_FIND_METHOD" "cmake" "pkgconf" "subproject" "fetch")
63+
endif()
64+
set("_${_pkg}_FIND_METHOD")
65+
endif()
66+
67+
foreach(method ${${_pkg}_FIND_METHOD})
68+
if(TARGET "${_lib}::${_lib}")
69+
break()
70+
endif()
71+
72+
if("${method}" STREQUAL "cmake")
73+
message(STATUS "${_lib}: Find installed package")
74+
if(DEFINED "${_pkg}_DIR")
75+
set("_${_pkg}_DIR")
76+
set("${_lib}_DIR" "${_pkg}_DIR")
77+
endif()
78+
find_package("${_lib}" CONFIG QUIET)
79+
if("${_lib}_FOUND")
80+
message(STATUS "${_lib}: Found installed package")
81+
break()
82+
endif()
83+
endif()
84+
85+
if("${method}" STREQUAL "pkgconf")
86+
find_package(PkgConfig QUIET)
87+
pkg_check_modules("${_pkg}" QUIET "${_lib}")
88+
if("${_pkg}_FOUND")
89+
message(STATUS "Found ${_lib} via pkg-config")
90+
91+
add_library("${_lib}::${_lib}" INTERFACE IMPORTED)
92+
target_link_libraries(
93+
"${_lib}::${_lib}"
94+
INTERFACE
95+
"${${_pkg}_LINK_LIBRARIES}"
96+
)
97+
target_include_directories(
98+
"${_lib}::${_lib}"
99+
INTERFACE
100+
"${${_pkg}_INCLUDE_DIRS}"
101+
)
102+
103+
break()
104+
endif()
105+
endif()
106+
107+
if("${method}" STREQUAL "subproject")
108+
if(NOT DEFINED "${_pkg}_SUBPROJECT")
109+
set("_${_pkg}_SUBPROJECT")
110+
set("${_pkg}_SUBPROJECT" "subprojects/${_lib}")
111+
endif()
112+
set("${_pkg}_SOURCE_DIR" "${PROJECT_SOURCE_DIR}/${${_pkg}_SUBPROJECT}")
113+
set("${_pkg}_BINARY_DIR" "${PROJECT_BINARY_DIR}/${${_pkg}_SUBPROJECT}")
114+
if(EXISTS "${${_pkg}_SOURCE_DIR}/CMakeLists.txt")
115+
message(STATUS "Include ${_lib} from ${${_pkg}_SUBPROJECT}")
116+
add_subdirectory(
117+
"${${_pkg}_SOURCE_DIR}"
118+
"${${_pkg}_BINARY_DIR}"
119+
)
120+
121+
add_library("${_lib}::${_lib}" INTERFACE IMPORTED)
122+
target_link_libraries("${_lib}::${_lib}" INTERFACE "${_lib}")
123+
124+
# We need the module directory in the subproject before we finish the configure stage
125+
if(NOT EXISTS "${${_pkg}_BINARY_DIR}/include")
126+
make_directory("${${_pkg}_BINARY_DIR}/include")
127+
endif()
128+
129+
break()
130+
endif()
131+
endif()
132+
133+
if("${method}" STREQUAL "fetch")
134+
message(STATUS "Retrieving ${_lib} from ${_url}")
135+
include(FetchContent)
136+
FetchContent_Declare(
137+
"${_lib}"
138+
GIT_REPOSITORY "${_url}"
139+
GIT_TAG "HEAD"
140+
)
141+
FetchContent_MakeAvailable("${_lib}")
142+
143+
add_library("${_lib}::${_lib}" INTERFACE IMPORTED)
144+
target_link_libraries("${_lib}::${_lib}" INTERFACE "${_lib}")
145+
146+
# We need the module directory in the subproject before we finish the configure stage
147+
FetchContent_GetProperties("${_lib}" SOURCE_DIR "${_pkg}_SOURCE_DIR")
148+
FetchContent_GetProperties("${_lib}" BINARY_DIR "${_pkg}_BINARY_DIR")
149+
if(NOT EXISTS "${${_pkg}_BINARY_DIR}/include")
150+
make_directory("${${_pkg}_BINARY_DIR}/include")
151+
endif()
152+
153+
break()
154+
endif()
155+
156+
endforeach()
157+
158+
if(TARGET "${_lib}::${_lib}")
159+
set("${_pkg}_FOUND" TRUE)
160+
else()
161+
set("${_pkg}_FOUND" FALSE)
162+
endif()
163+
164+
if(DEFINED "_${_pkg}_SUBPROJECT")
165+
unset("${_pkg}_SUBPROJECT")
166+
unset("_${_pkg}_SUBPROJECT")
167+
endif()
168+
if(DEFINED "_${_pkg}_DIR")
169+
unset("${_lib}_DIR")
170+
unset("_${_pkg}_DIR")
171+
endif()
172+
if(DEFINED "_${_pkg}_FIND_METHOD")
173+
unset("${_pkg}_FIND_METHOD")
174+
unset("_${_pkg}_FIND_METHOD")
175+
endif()
176+
unset(_lib)
177+
unset(_pkg)
178+
unset(_url)

doc/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: Changelog
3+
---
4+
5+
{!CHANGELOG.md!}

doc/specs/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ This is and index/directory of the specifications (specs) for each new module/fe
2121
- [math](./stdlib_math.html) - General purpose mathematical functions
2222
- [optval](./stdlib_optval.html) - Fallback value for optional arguments
2323
- [quadrature](./stdlib_quadrature.html) - Numerical integration
24+
- [random](./stdlib_random.html) - Probability Distributions random number generator
2425
- [sorting](./stdlib_sorting.html) - Sorting of rank one arrays
2526
- [stats](./stdlib_stats.html) - Descriptive Statistics
26-
- [stats_distribution_PRNG](./stdlib_stats_distribution_PRNG.html) - Probability Distributions random number generator
27+
- [stats_distributions_uniform](./stdlib_stats_distribution_uniform.html) - Uniform Probability Distribution
2728
- [string\_type](./stdlib_string_type.html) - Basic string support
2829
- [strings](./stdlib_strings.html) - String handling and manipulation routines
2930
- [stringlist_type](./stdlib_stringlist_type.html) - 1-Dimensional list of strings

doc/specs/stdlib_math.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Experimental
152152

153153
#### Class
154154

155-
Function.
155+
Pure function.
156156

157157
#### Argument(s)
158158

@@ -224,7 +224,7 @@ Experimental
224224

225225
#### Class
226226

227-
Function.
227+
Pure function.
228228

229229
#### Argument(s)
230230

0 commit comments

Comments
 (0)