# Fortran Standard Library
[![Actions Status](https://github.com/fortran-lang/stdlib/workflows/CI/badge.svg)](https://github.com/fortran-lang/stdlib/actions)
[![Actions Status](https://github.com/fortran-lang/stdlib/workflows/CI_windows/badge.svg)](https://github.com/fortran-lang/stdlib/actions)
* [Goals and Motivation](#goals-and-motivation)
* [Scope](#scope)
* [Getting started](#getting-started)
- [Get the code](#get-the-code)
- [Requirements](#requirements)
- [Supported compilers](#supported-compilers)
- [Build with CMake](#build-with-cmake)
- [Build with fortran-lang/fpm](#build-with-fortran-langfpm)
* [Using stdlib in your project](#using-stdlib-in-your-project)
* [Documentation](#documentation)
* [Contributing](#contributing)
* [Links](#links)
## Goals and Motivation
The Fortran Standard, as published by the ISO (https://wg5-fortran.org/), does
not have a Standard Library. The goal of this project is to provide a community
driven and agreed upon *de facto* "standard" library for Fortran, called a
Fortran Standard Library (`stdlib`). We have a rigorous process how `stdlib` is
developed as documented in our [Workflow](WORKFLOW.md). `stdlib` is both a
specification and a reference implementation. We are cooperating with the
Fortran Standards Committee (e.g., the effort
[started](https://github.com/j3-fortran/fortran_proposals/issues/104) at the J3
committee repository) and the plan is to continue working with the Committee in
the future (such as in the step 5. in the [Workflow](WORKFLOW.md) document), so
that if the Committee wants to standardize some feature already available in `stdlib`, it would
base it on `stdlib`'s implementation.
## Scope
The goal of the Fortran Standard Library is to achieve the following general scope:
* Utilities (containers, strings, files, OS/environment integration, unit
testing & assertions, logging, ...)
* Algorithms (searching and sorting, merging, ...)
* Mathematics (linear algebra, sparse matrices, special functions, fast Fourier
transform, random numbers, statistics, ordinary differential equations,
numerical integration, optimization, ...)
## Getting started
### Get the code
```sh
git clone https://github.com/fortran-lang/stdlib
cd stdlib
```
### Requirements
To build the Fortran standard library you need
- a Fortran 2008 compliant compiler, or better, a Fortran 2018 compliant compiler
(GCC Fortran and Intel Fortran compilers are known to work for stdlib)
- CMake version 3.14 or newer (alternatively Make can be used)
- a build backend for CMake, like Make or Ninja (the latter is recommended on Windows)
- the [fypp](https://github.com/aradi/fypp) preprocessor (used as meta-programming tool)
If your system package manager does not provide the required build tools, all build dependencies can be installed with the Python command line installer ``pip``:
```sh
pip install --user fypp cmake ninja
```
Alternatively, you can install the build tools from the conda-forge channel with the conda package manager:
```sh
conda config --add channels conda-forge
conda create -n stdlib-tools fypp cmake ninja
conda activate stdlib-tools
```
You can install conda using the [miniforge installer](https://github.com/conda-forge/miniforge/releases).
Also, you can install a Fortran compiler from conda-forge by installing the ``fortran-compiler`` package, which installs GFortran.
### Supported Compilers
The following combinations are tested on the default branch of stdlib:
Name | Version | Platform | Architecture
--- | --- | --- | ---
GCC Fortran | 10, 11, 12, 13 | Ubuntu 22.04.2 LTS | x86_64
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
The following combinations are known to work, but they are not tested in the CI:
Name | Version | Platform | Architecture
--- | --- | --- | ---
GCC Fortran (MinGW) | 9.3.0, 10.2.0, 11.2.0 | Windows 10 | x86_64, i686
We try to test as many available compilers and platforms as possible.
A list of tested compilers which are currently not working and the respective issue are listed below.
Name | Version | Platform | Architecture | Status
--- | --- | --- | --- | ---
GCC Fortran | <9 | any | any | [#296](https://github.com/fortran-lang/stdlib/issues/296), [#430](https://github.com/fortran-lang/stdlib/pull/430)
NVIDIA HPC SDK | 20.7, 20.9, 20.11 | Manjaro Linux 20 | x86_64 | [#107](https://github.com/fortran-lang/stdlib/issues/107)
NAG | 7.0 | RHEL | x86_64 | [#108](https://github.com/fortran-lang/stdlib/issues/108)
Intel Parallel Studio XE | 16, 17, 18 | OpenSUSE | x86_64 | failed to compile
Please share your experience with successful and failing builds for compiler/platform/architecture combinations not covered above.
### Build with CMake
Configure the build with
```sh
cmake -B build
```
You can pass additional options to CMake to customize the build.
Important options are
- `-G Ninja` to use the Ninja backend instead of the default Make backend. Other build backends are available with a similar syntax.
- `-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).
- `-DCMAKE_MAXIMUM_RANK` the maximum array rank procedures should be generated for.
The default value is chosen as 4.
The maximum is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.
The minimum required rank to compile this project is 4.
Compiling with maximum rank 15 can be resource intensive and requires at least 16 GB of memory to allow parallel compilation or 4 GB memory for sequential compilation.
- `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`).
- `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`).
- `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show commands used to compile the code.
- `-DCMAKE_BUILD_TYPE` is by default set to `RelWithDebInfo`, which uses compiler flags suitable for code development (but with only `-O2` optimization). Beware the compiler flags set this way will override any compiler flags specified via `FFLAGS`. To prevent this, use `-DCMAKE_BUILD_TYPE=NoConfig` in conjunction with `FFLAGS`.
For example, to configure a build using the Ninja backend while specifying compiler optimization via `FFLAGS`, generating procedures up to rank 7, installing to your home directory, using the `NoConfig` compiler flags, and printing the compiler commands, use
```sh
export FFLAGS="-O3"
cmake -B build -G Ninja -DCMAKE_MAXIMUM_RANK:String=7 -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_BUILD_TYPE=NoConfig
```
To build the standard library run
```sh
cmake --build build
```
To test your build, run the test suite and all example programs after the build has finished with
```sh
cmake --build build --target test
```
To test only the test suite, run
```sh
ctest --test-dir build/test
```
Please report failing tests on our [issue tracker](https://github.com/fortran-lang/stdlib/issues/new/choose) including details of the compiler used, the operating system and platform architecture.
To install the project to the declared prefix run
```sh
cmake --install build
```
Now you have a working version of stdlib you can use for your project.
If at some point you wish to recompile `stdlib` with different options, you might
want to delete the `build` folder. This will ensure that cached variables from
earlier builds do not affect the new build.
### Build with [fortran-lang/fpm](ht
没有合适的资源?快使用搜索试试~ 我知道了~
Fortran Standard Library
共492个文件
f90:291个
fypp:81个
txt:50个
需积分: 5 1 下载量 50 浏览量
2024-03-07
11:42:14
上传
评论
收藏 575KB ZIP 举报
温馨提示
由 ISO (https://wg5-fortran.org/) 发布的 Fortran 标准没有标准库。该项目的目标是为 Fortran 提供一个社区驱动并达成一致的事实“标准”库,称为 Fortran 标准库 (stdlib)。 stdlib 既是规范,也是参考实现。
资源推荐
资源详情
资源评论
收起资源包目录
Fortran Standard Library (492个子文件)
pengyhash.c 840B
nmhash.c 273B
waterhash.c 139B
Findtest-drive.cmake 5KB
stdlib.cmake 2KB
DefaultFlags.cmake 1KB
template.cmake 269B
SpookyV2.cpp 8KB
generate_hash_arrays.cpp 5KB
SpookyV2Test.cpp 1KB
array3.dat 800B
example.dat 96B
.editorconfig 1KB
stdlib_logger.f90 59KB
test_sorting.f90 58KB
test_moment.f90 53KB
test_stdlib_bitset_large.f90 46KB
test_rawmoment.f90 34KB
test_string_functions.f90 33KB
stdlib_hashmap_open.f90 33KB
stdlib_hashmap_chaining.f90 31KB
test_ascii.f90 31KB
stdlib_hashmaps.f90 30KB
test_var.f90 30KB
test_stdlib_logger.f90 29KB
test_string_intrinsic.f90 28KB
stdlib_stringlist_type.f90 27KB
test_gauss.f90 24KB
test_npy.f90 24KB
test_cov.f90 24KB
test_varn.f90 23KB
test_stdlib_bitset_64.f90 22KB
stdlib_sorting_radix_sort.f90 17KB
test_insert_at.f90 17KB
test_corr.f90 16KB
test_linspace.f90 14KB
test_chaining_maps.f90 14KB
test_open_maps.f90 14KB
stdlib_hashmap_wrappers.f90 12KB
test_append_prepend.f90 11KB
test_string_strip_chomp.f90 9KB
test_logicalloc.f90 9KB
test_hash_functions.f90 9KB
test_logspace.f90 9KB
test_string_to_string.f90 8KB
test_loadtxt.f90 8KB
stdlib_ansi.f90 7KB
test_32_bit_hash_performance.f90 6KB
test_savetxt.f90 6KB
test_64_bit_hash_performance.f90 5KB
test_parse_mode.f90 5KB
test_string_operator.f90 5KB
test_getline.f90 5KB
test_open.f90 5KB
test_string_match.f90 4KB
test_random.f90 4KB
stdlib_quadrature_gauss.f90 4KB
test_string_derivedtype_io.f90 4KB
example_uniform_rvs.f90 3KB
stdlib_ansi_operator.f90 3KB
stdlib_error.f90 2KB
test_colors.f90 2KB
selection_vs_sort.f90 2KB
stdlib_specialfunctions_legendre.f90 2KB
example_exponential_pdf.f90 2KB
example_normal_cdf.f90 2KB
example_exponential_cdf.f90 2KB
example_normal_pdf.f90 2KB
stdlib_array.f90 2KB
example_uniform_pdf.f90 2KB
example_uniform_cdf.f90 2KB
test_sleep.f90 2KB
example_hashmaps_get_all_keys.f90 1KB
stdlib_ansi_to_string.f90 1KB
example_bitsets_write_bitset.f90 1KB
example_bitsets_read_bitset.f90 1KB
example_normal_rvs.f90 1KB
example_to_string.f90 1KB
example_stringlist_type_concatenate_operator.f90 1KB
stdlib_system.F90 1KB
example_hashmaps_get_other_data.f90 1KB
example_bitsets_output.f90 1KB
example_bitsets_input.f90 1KB
example_sort_bitset.f90 1KB
example_log_text_error.f90 1KB
example_meshgrid.f90 965B
example_stringlist_type_inequality_operator.f90 948B
example_stringlist_type_equality_operator.f90 936B
example_fmt_constants.f90 922B
f08estop.f90 900B
example_shuffle.f90 885B
example_stringlist_type_get.f90 880B
example_radix_sort.f90 879B
example_exponential_rvs.f90 874B
example_stringlist_type_insert_at.f90 844B
stdlib_specialfunctions.f90 839B
example_hashmaps_set_other_data.f90 836B
example_bitsets_assignment.f90 824B
example_arg_select.f90 813B
example_math_arange.f90 780B
共 492 条
- 1
- 2
- 3
- 4
- 5
资源评论
AI普惠行者
- 粉丝: 1679
- 资源: 125
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 部署yolov8的tensorrt模型支持检测分割姿态估计的C++源码+部署步骤.zip
- 以简单、易用、高性能为目标、开源的时序数据库,支持Linux及Windows, Time Series Database.zip
- python-leetcode面试题解之第198题打家劫舍-题解.zip
- python-leetcode面试题解之第191题位1的个数-题解.zip
- python-leetcode面试题解之第186题反转字符串中的单词II-题解.zip
- 一个基于python的web后端高性能开发框架,下载可用
- python-leetcode面试题解之第179题最大数-题解.zip
- python-leetcode面试题解之第170题两数之和III数据结构设计-题解.zip
- python-leetcode面试题解之第168题Excel表列名称-题解.zip
- python-leetcode面试题解之第167题两数之和II输入有序数组-题解.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功