Skip to content

Commit

Permalink
Merge branch 'master' into load-npz-files
Browse files Browse the repository at this point in the history
  • Loading branch information
minhqdao committed Apr 17, 2024
2 parents dc70f0b + 19f84ce commit 807ff8c
Show file tree
Hide file tree
Showing 120 changed files with 563,445 additions and 376 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
cxx: [icpc]
env:
MACOS_HPCKIT_URL: >-
https://registrationcenter-download.intel.com/akdlm/irc_nas/18242/m_HPCKit_p_2021.4.0.3389_offline.dmg
https://registrationcenter-download.intel.com/akdlm/IRC_NAS/a99cb1c5-5af6-4824-9811-ae172d24e594/m_HPCKit_p_2023.1.0.44543.dmg
MACOS_FORTRAN_COMPONENTS: all
FC: ${{ matrix.fc }}
CC: ${{ matrix.cc }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Install dependencies
run: |
pip install -v ford==6.1.10
pip install -v ford==7.0.5
pip install fypp
python --version
ford --version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fpm-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ env.GCC_V }}
- name: Install fpm latest release
uses: fortran-lang/setup-fpm@v3
uses: fortran-lang/setup-fpm@v5
with:
fpm-version: 'v0.4.0'
fpm-version: 'v0.10.0'

- name: Run fpm test ⚙
run: |
Expand Down
10 changes: 9 additions & 1 deletion API-doc-FORD-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ exclude_dir: src/tests
output_dir: API-doc
page_dir: doc
media_dir: doc/media
exclude: src/stdlib_linalg_lapack.fypp
src/stdlib_linalg_lapack_aux.fypp
src/stdlib_linalg_lapack_c.fypp
src/stdlib_linalg_lapack_d.fypp
src/stdlib_linalg_lapack_q.fypp
src/stdlib_linalg_lapack_s.fypp
src/stdlib_linalg_lapack_w.fypp
src/stdlib_linalg_lapack_z.fypp
fpp_extensions: fypp
preprocess: true
macro: MAXRANK=3
Expand Down Expand Up @@ -36,7 +44,7 @@ favicon: doc/media/favicon.ico
license: by-sa
author: fortran-lang/stdlib contributors
author_pic: https://fortran-lang.org/assets/img/fortran_logo_512x512.png
author_email: [email protected]
email: [email protected]
github: https://github.com/fortran-lang
twitter: https://twitter.com/fortranlang
website: https://fortran-lang.org
Expand Down
97 changes: 97 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,100 @@
# Version 0.5.0

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

[v0.5.0]: https://github.com/fortran-lang/stdlib/releases/tag/v0.5.0

- new module `stdlib_linalg_state`
[#774](https://github.com/fortran-lang/stdlib/pull/774)
- new derived type: `linalg_state_type`
- new procedure: `linalg_error_handling`

Changes to existing scripts and modules
- addition of `implicit none` to all example programs
[#780](https://github.com/fortran-lang/stdlib/pull/780)
- change in module `stdlib_hashmaps`
- fix the procedure `remove_chaining_entry`
[#788](https://github.com/fortran-lang/stdlib/pull/788)
- change in module `stdlib_linalg`
- addition of the BLAS/LAPACK backends and interfaces
[#772](https://github.com/fortran-lang/stdlib/pull/772)
- change in module `stdlib_str2num`
- fix the procedure `to_${k1}$_from_stream`
[#789](https://github.com/fortran-lang/stdlib/pull/789)
- upgrade of the Intel-classic compiler in macOS CI
[#777](https://github.com/fortran-lang/stdlib/pull/777)

Changes to existing documentation
- Improvement of the documentation
[#784](https://github.com/fortran-lang/stdlib/pull/784)
[#781](https://github.com/fortran-lang/stdlib/pull/781)
[#786](https://github.com/fortran-lang/stdlib/pull/786)
- Improvement of the support of `fpm`
[#787](https://github.com/fortran-lang/stdlib/pull/787)
[#790](https://github.com/fortran-lang/stdlib/pull/790)

# Version 0.4.0

Full release notes available at [v0.4.0] tag.

[v0.4.0]: https://github.com/fortran-lang/stdlib/releases/tag/v0.4.0

- new module `stdlib_str2num`
[#743](https://github.com/fortran-lang/stdlib/pull/743)
- new procedures: `to_num`, `to_num_from_stream`

Changes to existing scripts and modules

- change in .gitignore
- addition of the file extensions `.dat` and `.stream`
[#768](https://github.com/fortran-lang/stdlib/pull/768)
- addition of `.gitignore` to `stdlib-fpm`
[#769](https://github.com/fortran-lang/stdlib/pull/769)
- change in CI/CD
- support of GCC 13
[#737](https://github.com/fortran-lang/stdlib/pull/737)
- support of Intel compiler `ifx`
[#752](https://github.com/fortran-lang/stdlib/pull/752)
- change in script `fpm-deployment.sh`
- changes to facilitate `fypp` preprocessing for the `fpm` deployment
[#758](https://github.com/fortran-lang/stdlib/pull/758)
- change in module `stdlib_ascii`
- Improved procedures `to_lower` and `to_upper`
[#733](https://github.com/fortran-lang/stdlib/pull/733)
- change in module `stdlib_bitsets`
- initialization in `bitset_type`
[#753](https://github.com/fortran-lang/stdlib/pull/753)
- improved procedure `bit_count_large`
[#756](https://github.com/fortran-lang/stdlib/pull/756)
- change in module `stdlib_hashmaps`
- new procedure `get_all_keys`
[#741](https://github.com/fortran-lang/stdlib/pull/741)
- new file permissions
[#762](https://github.com/fortran-lang/stdlib/pull/762)
- change in module `stdlib_math`
- new procedure `meshgrid`
[#764](https://github.com/fortran-lang/stdlib/pull/764)
- change in module `stdlib_specialfunctions_gamma`
- fix procedure `gamma`
[#730](https://github.com/fortran-lang/stdlib/pull/730)
- change in module `stdlib_string_type`
- fix procedure `move`
[#736](https://github.com/fortran-lang/stdlib/pull/736)
[#773](https://github.com/fortran-lang/stdlib/pull/773)
- change in `SpookyV2Test.cpp`
- Fix undefined use of <cstdint> types
[#747](https://github.com/fortran-lang/stdlib/pull/747)

Changes to the existing documentation

- change in the specs `stdlib_hashmaps`
- Correction of an intent of the variable "conflict"
[#739](https://github.com/fortran-lang/stdlib/pull/739)
- change in README.md
- instructions to build `stdlib` with `fpm` through the `fpm-deployment.sh` script
[#757](https://github.com/fortran-lang/stdlib/pull/757)


# Version 0.3.0

Full release notes available at [v0.3.0] tag.
Expand Down
78 changes: 64 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ GCC Fortran | 10, 11, 12, 13 | macOS 12.6.3 (21G419) | x86_64
GCC Fortran (MSYS) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64
GCC Fortran (MinGW) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64, i686
Intel oneAPI LLVM | 2024.0 | Ubuntu 22.04.2 LTS | x86_64
Intel oneAPI classic | 2021.1 | macOS 12.6.3 (21G419) | x86_64
Intel oneAPI classic | 2023.1 | macOS 12.6.3 (21G419) | x86_64

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

Expand Down Expand Up @@ -201,6 +201,30 @@ fpm run --example prog
with `prog` being the name of the example program (e.g., `example_sort`).


## Using stdlib in your project

### Using stdlib with CMake

The stdlib project exports CMake package files and pkg-config files to make stdlib usable for other projects.
The package files are located in the library directory in the installation prefix.

For CMake builds of stdlib you can find a local installation with

```cmake
find_package(fortran_stdlib REQUIRED)
...
target_link_libraries(
${PROJECT_NAME}
PRIVATE
fortran_stdlib::fortran_stdlib
)
```

To make the installed stdlib project discoverable add the stdlib directory to the ``CMAKE_PREFIX_PATH``.
The usual install location of the package files is ``$PREFIX/lib/cmake/fortran_stdlib``.

### Using stdlib with fpm

To use `stdlib` within your `fpm` project, add the following lines to your `fpm.toml` file:
```toml
[dependencies]
Expand All @@ -215,25 +239,51 @@ stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm" }
>
> [see also](https://fpm.fortran-lang.org/spec/metapackages.html)
## Using stdlib in your project
### Using stdlib with a regular Makefile

The stdlib project exports CMake package files and pkg-config files to make stdlib usable for other projects.
The package files are located in the library directory in the installation prefix.
After the library has been built, it can be included in a regular Makefile.
The recommended way to do this is using the [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/) tool, for which an example is shown below.
```make
# Necessary if the installation directory is not in PKG_CONFIG_PATH
install_dir := path/to/install_dir
export PKG_CONFIG_PATH := $(install_dir)/lib/pkgconfig:$(PKG_CONFIG_PATH)

For CMake builds of stdlib you can find a local installation with
STDLIB_CFLAGS := `pkg-config --cflags fortran_stdlib`
STDLIB_LIBS := `pkg-config --libs fortran_stdlib`

```cmake
find_package(fortran_stdlib REQUIRED)
# Example definition of Fortran compiler and flags
FC := gfortran
FFLAGS := -O2 -Wall -g

# Definition of targets etc.
...
target_link_libraries(
${PROJECT_NAME}
PRIVATE
fortran_stdlib::fortran_stdlib
)

# Example rule to compile object files from .f90 files
%.o: %.f90
$(FC) -c -o $@ $< $(FFLAGS) $(STDLIB_CFLAGS)

# Example rule to link an executable from object files
%: %.o
$(FC) -o $@ $^ $(FFLAGS) $(STDLIB_LIBS)

```

To make the installed stdlib project discoverable add the stdlib directory to the ``CMAKE_PREFIX_PATH``.
The usual install location of the package files is ``$PREFIX/lib/cmake/fortran_stdlib``.
The same can also be achieved without pkg-config.
If the library has been installed in a directory inside the compiler's search path,
only a flag `-lfortran_stdlib` is required.
If the installation directory is not in the compiler's search path, one can add for example
```make
install_dir := path/to/install_dir
libdir := $(install_dir)/lib
moduledir := $(install_dir)/include/fortran_stdlib/<compiler name and version>
```
The linker should then look for libraries in `libdir` (using e.g.`-L$(libdir)`) and the compiler should look for module files in `moduledir` (using e.g. `-I$(moduledir)`).
Alternatively, the library can also be included from a build directory without installation with
```make
build_dir := path/to/build_dir
libdir := $(build_dir)/src
moduledir := $(build_dir)/src/mod_files
```

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.5.0
29 changes: 29 additions & 0 deletions ci/fpm-deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,27 @@ prune=(
"$destdir/src/f18estop.f90"
)

# Files that need preprocessed Fortran extension -> .F90
preprocessed=(
"$destdir/src/stdlib_linalg_constants"
"$destdir/src/stdlib_linalg_blas"
"$destdir/src/stdlib_linalg_blas_aux"
"$destdir/src/stdlib_linalg_blas_s"
"$destdir/src/stdlib_linalg_blas_d"
"$destdir/src/stdlib_linalg_blas_q"
"$destdir/src/stdlib_linalg_blas_c"
"$destdir/src/stdlib_linalg_blas_z"
"$destdir/src/stdlib_linalg_blas_w"
"$destdir/src/stdlib_linalg_lapack"
"$destdir/src/stdlib_linalg_lapack_aux"
"$destdir/src/stdlib_linalg_lapack_s"
"$destdir/src/stdlib_linalg_lapack_d"
"$destdir/src/stdlib_linalg_lapack_q"
"$destdir/src/stdlib_linalg_lapack_c"
"$destdir/src/stdlib_linalg_lapack_z"
"$destdir/src/stdlib_linalg_lapack_w"
)

major=$(cut -d. -f1 VERSION)
minor=$(cut -d. -f2 VERSION)
patch=$(cut -d. -f3 VERSION)
Expand Down Expand Up @@ -66,5 +87,13 @@ cp "${include[@]}" "$destdir/"
# Source file workarounds for fpm; ignore missing files
rm "${prune[@]}"

# Capitalize .f90 -> .F90 for preprocessed files
for pp_source in "${preprocessed[@]}"
do
# workaround for case-insensitive fs
mv "$pp_source.f90" "$pp_source.rename"
mv "$pp_source.rename" "$pp_source.F90"
done

# List stdlib-fpm package contents
ls -R "$destdir"
3 changes: 3 additions & 0 deletions ci/fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ copyright = "2019-2021 stdlib contributors"
[dev-dependencies]
test-drive.git = "https://github.com/fortran-lang/test-drive"
test-drive.tag = "v0.4.0"

[preprocess]
[preprocess.cpp]
7 changes: 7 additions & 0 deletions cmake/stdlib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,10 @@ function (fypp_f90 fyppopts fyppfiles f90files)
preprocess("${FYPP}" "${fyppopts}" "fypp" "f90" "${fyppfiles}" _f90files)
set(${f90files} ${_f90files} PARENT_SCOPE)
endfunction()

# For fortran sources that contain C preprocessor flags: create ".F90" files
function (fypp_f90pp fyppopts fyppfiles F90files)
preprocess("${FYPP}" "${fyppopts}" "fypp" "F90" "${fyppfiles}" _F90files)
set(${F90files} ${_F90files} PARENT_SCOPE)
endfunction()

1 change: 1 addition & 0 deletions doc/specs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ This is an index/directory of the specifications (specs) for each new module/fea
- [io](./stdlib_io.html) - Input/output helper & convenience
- [kinds](./stdlib_kinds.html) - Kind parameters
- [linalg](./stdlib_linalg.html) - Linear Algebra
- [linalg_state_type](./stdlib_linalg_state_type.html) - Linear Algebra state and error handling
- [logger](./stdlib_logger.html) - Runtime logging system
- [math](./stdlib_math.html) - General purpose mathematical functions
- [optval](./stdlib_optval.html) - Fallback value for optional arguments
Expand Down
2 changes: 1 addition & 1 deletion doc/specs/stdlib_ansi.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Generic interface to turn a style, foreground or background enumerator into an a

#### Syntax

`string = [[stdlib_string_colors(module):to_string(interface)]] (code)`
`string =` [[stdlib_ansi(module):to_string(interface)]] `(code)`

#### Class

Expand Down
4 changes: 2 additions & 2 deletions doc/specs/stdlib_array.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The built-in / intrinsics are usually preferable to `trueloc`, unless the access

#### Syntax

`loc = [[trueloc(function)]] (array[, lbound])`
`loc =` [[trueloc(function)]] `(array[, lbound])`

#### Class

Expand Down Expand Up @@ -64,7 +64,7 @@ The built-in / intrinsics are usually preferable to `falseloc`, unless the acces

#### Syntax

`loc = [[falseloc(function)]] (array[, lbound])`
`loc =` [[falseloc(function)]] `(array[, lbound])`

#### Class

Expand Down
Loading

0 comments on commit 807ff8c

Please sign in to comment.