{"id":13599059,"url":"https://github.com/fortran-lang/stdlib","last_synced_at":"2026-01-26T14:01:16.859Z","repository":{"id":37612203,"uuid":"228099010","full_name":"fortran-lang/stdlib","owner":"fortran-lang","description":"Fortran Standard Library","archived":false,"fork":false,"pushed_at":"2026-01-23T21:42:46.000Z","size":37667,"stargazers_count":1283,"open_issues_count":297,"forks_count":215,"subscribers_count":50,"default_branch":"master","last_synced_at":"2026-01-24T01:41:37.688Z","etag":null,"topics":["blas","fortran","fortran-library","fortran-package-manager","fortran-stdlib","hash","lapack","linear-algebra","numerical-methods","numpy","probability-distribution","quadrature","rng","sorting","statistics","stdlib","strings"],"latest_commit_sha":null,"homepage":"https://stdlib.fortran-lang.org","language":"Fortran","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fortran-lang.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-12-14T22:41:59.000Z","updated_at":"2026-01-23T08:14:07.000Z","dependencies_parsed_at":"2023-01-30T16:43:01.271Z","dependency_job_id":"df7d1b40-93f4-440a-8841-a14094b8e93b","html_url":"https://github.com/fortran-lang/stdlib","commit_stats":{"total_commits":1822,"total_committers":57,"mean_commits":"31.964912280701753","dds":0.7897914379802415,"last_synced_commit":"2fdfab47e263249ab80952c79e7a7638e481ddba"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/fortran-lang/stdlib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fstdlib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fstdlib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fstdlib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fstdlib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fortran-lang","download_url":"https://codeload.github.com/fortran-lang/stdlib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortran-lang%2Fstdlib/sbom","scorecard":{"id":407502,"data":{"date":"2025-08-11","repo":{"name":"github.com/fortran-lang/stdlib","commit":"a8519b673e53116a478606331a0e7ba15e65936b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6.3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":10,"reason":"30 commit(s) and 5 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-288 / GHSA-6hrg-qmvc-2xh8"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T21:45:24.544Z","repository_id":37612203,"created_at":"2025-08-18T21:45:24.544Z","updated_at":"2025-08-18T21:45:24.544Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blas","fortran","fortran-library","fortran-package-manager","fortran-stdlib","hash","lapack","linear-algebra","numerical-methods","numpy","probability-distribution","quadrature","rng","sorting","statistics","stdlib","strings"],"created_at":"2024-08-01T17:00:59.372Z","updated_at":"2026-01-26T14:01:16.841Z","avatar_url":"https://github.com/fortran-lang.png","language":"Fortran","readme":"# Fortran Standard Library\n\n[![Actions Status](https://github.com/fortran-lang/stdlib/workflows/CI/badge.svg)](https://github.com/fortran-lang/stdlib/actions)\n[![Actions Status](https://github.com/fortran-lang/stdlib/workflows/CI_windows/badge.svg)](https://github.com/fortran-lang/stdlib/actions)\n\n* [Goals and Motivation](#goals-and-motivation)\n* [Scope](#scope)\n* [Getting started](#getting-started)\n  - [Get the code](#get-the-code)\n  - [Requirements](#requirements)\n  - [Supported compilers](#supported-compilers)\n  - [Build with CMake](#build-with-cmake)\n  - [Build with fortran-lang/fpm](#build-with-fortran-langfpm)\n* [Using stdlib in your project](#using-stdlib-in-your-project)\n* [Documentation](#documentation)\n* [Contributing](#contributing)\n* [Links](#links)\n\n## Goals and Motivation\n\nThe Fortran Standard, as published by the ISO (https://wg5-fortran.org/), does\nnot have a Standard Library. The goal of this project is to provide a community\ndriven and agreed upon *de facto* \"standard\" library for Fortran, called a\nFortran Standard Library (`stdlib`). We have a rigorous process how `stdlib` is\ndeveloped as documented in our [Workflow](WORKFLOW.md). `stdlib` is both a\nspecification and a reference implementation. We are cooperating with the\nFortran Standards Committee (e.g., the effort\n[started](https://github.com/j3-fortran/fortran_proposals/issues/104) at the J3\ncommittee repository) and the plan is to continue working with the Committee in\nthe future (such as in the step 5. in the [Workflow](WORKFLOW.md) document), so\nthat if the Committee wants to standardize some feature already available in `stdlib`, it would\nbase it on `stdlib`'s implementation.\n\n## Scope\n\nThe goal of the Fortran Standard Library is to achieve the following general scope:\n\n* Utilities (containers, strings, files, OS/environment integration, unit\n  testing \u0026 assertions, logging,  ...)\n* Algorithms (searching and sorting, merging, ...)\n* Mathematics (linear algebra, sparse matrices, special functions, fast Fourier\n  transform, random numbers, statistics, ordinary differential equations,\n  numerical integration, optimization, ...)\n\n\n## Getting started\n\n### Get the code\n\n```sh\ngit clone https://github.com/fortran-lang/stdlib\ncd stdlib\n```\n\n\n### Requirements\n\nTo build the Fortran standard library you need\n\n- a Fortran 2008 compliant compiler, or better, a Fortran 2018 compliant compiler\n  (GCC Fortran and Intel Fortran compilers are known to work for stdlib)\n- CMake version 3.14 or newer (alternatively Make can be used)\n- a build backend for CMake, like Make or Ninja (the latter is recommended on Windows)\n- the [fypp](https://github.com/aradi/fypp) preprocessor (used as meta-programming tool)\n\nIf your system package manager does not provide the required build tools, all build dependencies can be installed with the Python command line installer ``pip``:\n\n```sh\npip install --user fypp cmake ninja\n```\n\nAlternatively, you can install the build tools from the conda-forge channel with the conda package manager:\n\n```sh\nconda config --add channels conda-forge\nconda create -n stdlib-tools fypp cmake ninja\nconda activate stdlib-tools\n```\n\nYou can install conda using the [miniforge installer](https://github.com/conda-forge/miniforge/releases).\nAlso, you can install a Fortran compiler from conda-forge by installing the ``fortran-compiler`` package, which installs GFortran.\n\n\n### Supported Compilers\n\nThe following combinations are tested on the default branch of stdlib:\n\nName | Version | Platform | Architecture\n--- | --- | --- | ---\nGCC Fortran | 10, 11, 12, 13, 14 | Ubuntu 24.04.3 LTS | x86_64\nGCC Fortran | 11, 12, 13, 14, 15 | macOS 14.8.2 (23J126) | Arm64\nGCC Fortran (MSYS) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64\nGCC Fortran (MinGW) | 13 | Windows Server 2022 (10.0.20348 Build 1547) | x86_64\nIntel oneAPI LLVM | 2024.1 | Ubuntu 24.04.3 LTS | x86_64\nIntel oneAPI classic | 2021.10 | Ubuntu 22.04.5 LTS | x86_64\n\nThe following combinations are known to work, but they are not tested in the CI:\n\nName | Version | Platform | Architecture\n--- | --- | --- | ---\nGCC Fortran (MinGW) | 9.3.0, 10.2.0, 11.2.0 | Windows 10 | x86_64\n\nWe try to test as many available compilers and platforms as possible.\nA list of tested compilers which are currently not working and the respective issue are listed below.\n\nName | Version | Platform | Architecture | Status\n--- | --- | --- | --- | ---\nGCC Fortran | \u003c9 | any | any | [#296](https://github.com/fortran-lang/stdlib/issues/296), [#430](https://github.com/fortran-lang/stdlib/pull/430)\nNVIDIA HPC SDK | 20.7, 20.9, 20.11 | Manjaro Linux 20 | x86_64 | [#107](https://github.com/fortran-lang/stdlib/issues/107)\nNAG | 7.0 | RHEL | x86_64 | [#108](https://github.com/fortran-lang/stdlib/issues/108)\nIntel Parallel Studio XE | 16, 17, 18 | OpenSUSE | x86_64 | failed to compile\n\nPlease share your experience with successful and failing builds for compiler/platform/architecture combinations not covered above.\n\n\n### Build with CMake\n\nConfigure the build with\n\n```sh\ncmake -B build\n```\n\nYou can pass additional options to CMake to customize the build.\nImportant options are\n\n- `-G Ninja` to use the Ninja backend instead of the default Make backend. Other build backends are available with a similar syntax.\n- `-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). \n- `-DCMAKE_MAXIMUM_RANK` the maximum array rank procedures should be generated for.\n  The default value is chosen as 4.\n  The maximum is 15 for Fortran 2003 compliant compilers, otherwise 7 for compilers not supporting Fortran 2003 completely yet.\n  The minimum required rank to compile this project is 4.\n  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.\n- `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`).\n- `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`).\n- `-DCMAKE_VERBOSE_MAKEFILE` is by default set to `Off`, but if set to `On` will show commands used to compile the code.\n- `-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`.\n- `-DFIND_BLAS` set to `off` in case you want to disable finding the external BLAS/LAPACK dependency (default: `on`).\n\nFor 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\n\n```sh\nexport FFLAGS=\"-O3\"\ncmake -B build -G Ninja -DCMAKE_MAXIMUM_RANK:String=7 -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_VERBOSE_MAKEFILE=On -DCMAKE_BUILD_TYPE=NoConfig\n```\n\nTo build the standard library run\n\n```sh\ncmake --build build\n```\n\nTo test your build, run the test suite and all example programs after the build has finished with\n\n```sh\ncmake --build build --target test\n```\n\nTo test only the test suite, run\n```sh\nctest --test-dir build/test\n```\n\nPlease 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.\n\nTo install the project to the declared prefix run\n\n```sh\ncmake --install build\n```\n\nNow you have a working version of stdlib you can use for your project.\n\nIf at some point you wish to recompile `stdlib` with different options, you might\nwant to delete the `build` folder. This will ensure that cached variables from\nearlier builds do not affect the new build.\n\n### Build with [fortran-lang/fpm](https://github.com/fortran-lang/fpm)\n\nFortran Package Manager (fpm) is a package manager and build system for Fortran.   \nYou can build `stdlib` using provided `fpm.toml`:\n\n**Option 1**: From root folder\n\nAs `fpm` does not currently support `fypp` natively, `stdlib` now proposes a python script to preprocess and build it.\nThis script enables modification of the different `fypp` macros available in `stdlib`. The preprocessed files will be dumped at `\u003ccurrent_folder\u003e/temp/*.f90` or `*.F90`.\n\nMake sure to install the dependencies from the `requirement.txt`\n```sh\npip install --upgrade -r config/requirements.txt\n```\n\nTo build, you can use the following command line:\n\n```sh\npython config/fypp_deployment.py\nfpm build --profile release\n```\n\nor the short-cut\n\n```sh\npython config/fypp_deployment.py --build\n```\n\nTo modify the `maxrank` macro for instance:\n```sh\npython config/fypp_deployment.py --maxrank 7 --build\n```\n\nTo see all the options:\n```sh\npython config/fypp_deployment.py --help\n```\n\n**Note**: If you use a compiler different than GNU compilers, the script will try to catch it from the environment variables `FPM_FC`, `FPM_CC`, `FPM_CXX`.\n\n**Option 2**: From the `stdlib-fpm` branch which has already been preprocessed with default macros:\n```sh\ngit checkout stdlib-fpm\nfpm build --profile release\n```\n\n\n#### Installing with fpm\n\nEither option you chose for building the `stdlib`, you can install it with:\n```sh\nfpm install --profile release\n```\nThe command above will install the following files:\n- `libstdlib.a` into `~/.local/lib/` (Unix) or `C:\\Users\\\u003cusername\u003e\\AppData\\Roaming\\local\\lib\\` (Windows)\n- all the `.[s]mod` files produced by the compiler into `~/.local/include/` (Unix) or `C:\\Users\\\u003cusername\u003e\\AppData\\Roaming\\local\\include\\` (Windows)\n\nYou can change the installation path by setting the prefix option to `fpm`:\n```sh\nfpm install --profile release --prefix /my/custom/installation/path/\n```\n\nYou can use the `stdlib` by adding the `-lstdlib` flag to your compiler.\nIf your prefix is a non standard path, add also:\n- `-L/my/custom/installation/path/lib`\n- `-I/my/custom/installation/path/include`\n\n#### Running the examples\nYou can run the examples with `fpm` as:\n\n```sh\nfpm run --example prog\n```\n\nwith `prog` being the name of the example program (e.g., `example_sort`).\n\n\n### Preprocessing macros and flags\n\n`stdlib` uses two preprocessing steps:\n\n- *fypp* for meta-programming (templating and feature selection)\n- *C* preprocessing (activated through compiler flags like `-cpp`(GNU) or `-fpp`(Intel) or use of uppercase file suffix .F90) for conditional compilation\n\n*fypp* preprocessing macros and flags are supported through `CMake` or the `python` script `config/fypp_deployment.py`.\n*C* preprocessing macros and flags are supported through `CMake` and `fpm`.\n\nThe table below lists all *fypp* preprocessing macros and flags currently used by `stdlib`:\n\n| Macro/flag Name | Comments |\n| --- | --- |\n| `MAXRANK` |  Maximum array rank generated by templates. Set via CMake `-DCMAKE_MAXIMUM_RANK=\u003cn\u003e` (passed to fypp as `-DMAXRANK=\u003cn\u003e`), or via fypp deployment script `--maxrank \u003cn\u003e`. |\n| `VERSION90` |  Defines the default maximum rank generated when `MAXRANK` is not defined. If defined, the maximum rank generated is 7; otherwise it is 15. Can be passed to fypp as `-DVERSION90` (CMake sets this automatically in some configurations). |\n| `WITH_CBOOL` |  Enables `c_bool` logical support if available. CMake auto-detects this and passes it to fypp; can be overridden at configure time with `-DWITH_CBOOL=ON/OFF`. |\n| `WITH_QP` |  Enables quadruple precision code generation (`real(qp)`, `complex(qp)`). CMake auto-detects this and passes it to fypp; can be overridden at configure time with `-DWITH_QP=ON/OFF`; fypp deployment script: `--with_qp`. |\n| `WITH_XDP` |  Enables extended double precision code generation (`real(xdp)`, `complex(xdp)`). CMake auto-detects this and passes it to fypp; can be overridden at configure time with `-DWITH_XDP=ON/OFF`; fypp deployment script: `--with_xdp`. |\n| `WITH_ILP64` |  Enables generation of 64-bit integer (ILP64) size interfaces for BLAS and LAPACK (in addition to the default 32-bit interface). Set via CMake `-DWITH_ILP64=True` or via  fypp deployment script `--with_ilp64`. |\n| `PROJECT_VERSION_MAJOR` |  Part of the version string passed into fypp templates. Set automatically by CMake from the file `VERSION`. Can be overridden by passing `-DPROJECT_VERSION_MAJOR=\u003cn\u003e`, or via fypp deployment script `--vmajor \u003cn\u003e`. |\n| `PROJECT_VERSION_MINOR` |  See `PROJECT_VERSION_MAJOR`. |\n| `PROJECT_VERSION_PATCH` |  See `PROJECT_VERSION_MAJOR`. |\n\n\nThe table below lists all *C preprocessing* macros and flags currently used by `stdlib`:\n\n| Macro/flag Name | Comments |\n| --- | --- |\n| `STDLIB_EXTERNAL_BLAS` |  Links against an external BLAS (32-bit integer interface). Set automatically by CMake when external BLAS/LAPACK are found, or manually via `add_compile_definitions(STDLIB_EXTERNAL_BLAS)`. In fpm: `preprocess.cpp.macros=[\"STDLIB_EXTERNAL_BLAS\"]`. |\n| `STDLIB_EXTERNAL_LAPACK` |  Links against an external LAPACK (32-bit integer interface). Usually paired with `STDLIB_EXTERNAL_BLAS`. |\n| `STDLIB_EXTERNAL_BLAS_I64` |  Links against an external BLAS with ILP64 (64-bit integer) interfaces. Usually paired with `STDLIB_EXTERNAL_LAPACK_I64`. |\n| `STDLIB_EXTERNAL_LAPACK_I64` |  Links against an external LAPACK with ILP64 (64-bit integer) interfaces. |\n\n\n## Using stdlib in your project\n\n### Using stdlib with CMake\n\nThe stdlib project exports CMake package files and pkg-config files to make stdlib usable for other projects.\nThe package files are located in the library directory in the installation prefix.\n\nFor CMake builds of stdlib you can find a local installation with\n\n```cmake\nfind_package(fortran_stdlib REQUIRED)\n...\ntarget_link_libraries(\n  ${PROJECT_NAME}\n  PRIVATE\n  fortran_stdlib::fortran_stdlib\n)\n```\n\nTo make the installed stdlib project discoverable add the stdlib directory to the ``CMAKE_PREFIX_PATH``.\nThe usual install location of the package files is ``$PREFIX/lib/cmake/fortran_stdlib``.\n\n### Using stdlib with fpm\n\nTo use `stdlib` within your `fpm` project, add the following lines to your `fpm.toml` file:\n```toml\n[dependencies]\nstdlib = { git=\"https://github.com/fortran-lang/stdlib\", branch=\"stdlib-fpm\" }\n```\n\n\u003e **Warning**\n\u003e \n\u003e Fpm 0.9.0 and later implements stdlib as a *metapackage*.\n\u003e To include the standard library metapackage, change the dependency to:\n\u003e `stdlib = \"*\"`.\n\u003e \n\u003e [see also](https://fpm.fortran-lang.org/spec/metapackages.html)\n\n### Using stdlib with a regular Makefile\n\nAfter the library has been built, it can be included in a regular Makefile.\nThe 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.\n```make\n# Necessary if the installation directory is not in PKG_CONFIG_PATH\ninstall_dir := path/to/install_dir\nexport PKG_CONFIG_PATH := $(install_dir)/lib/pkgconfig:$(PKG_CONFIG_PATH)\n# On some OS the pkgconfig file could be installed in lib64 instead of lib\n# export PKG_CONFIG_PATH := $(install_dir)/lib64/pkgconfig:$(PKG_CONFIG_PATH)\n\nSTDLIB_CFLAGS := `pkg-config --cflags fortran_stdlib`\nSTDLIB_LIBS := `pkg-config --libs fortran_stdlib`\n\n# Example definition of Fortran compiler and flags\nFC := gfortran\nFFLAGS := -O2 -Wall -g\n\n# Definition of targets etc.\n...\n\n# Example rule to compile object files from .f90 files\n%.o: %.f90\n    $(FC) -c -o $@ $\u003c $(FFLAGS) $(STDLIB_CFLAGS)\n\n# Example rule to link an executable from object files\n%: %.o\n    $(FC) -o $@ $^ $(FFLAGS) $(STDLIB_LIBS)\n\n```\n\nThe same can also be achieved without pkg-config.\nIf the library has been installed in a directory inside the compiler's search path,\nonly a flag `-lfortran_stdlib` is required.\nIf the installation directory is not in the compiler's search path, one can add for example\n```make\ninstall_dir := path/to/install_dir\nlibdir := $(install_dir)/lib\nmoduledir := $(install_dir)/include/fortran_stdlib/\u003ccompiler name and version\u003e\n```\nThe 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)`).\nAlternatively, the library can also be included from a build directory without installation with\n```make\nbuild_dir := path/to/build_dir\nlibdir := $(build_dir)/src\nmoduledir := $(build_dir)/src/mod_files\n```\n\n## Documentation\n\nDocumentation is a work in progress (see issue [#4](https://github.com/fortran-lang/stdlib/issues/4)) but already available at [stdlib.fortran-lang.org](https://stdlib.fortran-lang.org).\nThis includes API documentation automatically generated from static analysis and markup comments in the source files\nusing the [FORD](https://github.com/Fortran-FOSS-programmers/ford/wiki) tool,\nas well as a specification document or [\"spec\"](https://stdlib.fortran-lang.org/page/specs/index.html) for each proposed feature.\n\nSome discussions and prototypes of proposed APIs along with a list of popular open source Fortran projects are available on the\n[wiki](https://github.com/fortran-lang/stdlib/wiki).\n\n## BLAS and LAPACK\n\n`stdlib` ships full versions of BLAS and LAPACK, for all `real` and `complex` kinds, through generalized interface modules `stdlib_linalg_blas` and `stdlib_linalg_lapack`.\nThe 32- and 64-bit implementations may be replaced by external optimized libraries if available, which may allow for faster code.\nWhen linking against external BLAS/LAPACK libraries, the user should define macros `STDLIB_EXTERNAL_BLAS` and `STDLIB_EXTERNAL_LAPACK`, \nto ensure that the external library version is used instead of the internal implementation. \n\n- In case of a CMake build, the necessary configuration can be added by ensuring both macros are defined:\n  ```\n  add_compile_definitions(STDLIB_EXTERNAL_BLAS STDLIB_EXTERNAL_LAPACK)\n  ```\n- In case of an `fpm` build, the stdlib dependency should be set as follows:\n  ```toml\n  [dependencies]\n  stdlib = { git=\"https://github.com/fortran-lang/stdlib\", branch=\"stdlib-fpm\", preprocess.cpp.macros=[\"STDLIB_EXTERNAL_BLAS\", \"STDLIB_EXTERNAL_LAPACK\"] }\n  ```\n\nSupport for 64-bit integer size interfaces of all BLAS and LAPACK procedures may also be enabled \nby setting the CMake flag `-DWITH_ILP64=True`. The 64-bit integer version is always built in addition to \nthe 32-bit integer version, that is always available. Additional macros `STDLIB_EXTERNAL_BLAS_I64` and `STDLIB_EXTERNAL_LAPACK_I64`  \nmay be defined to link against an external 64-bit integer library, such as Intel MKL. \n\n- In case of an `fpm` build, 64-bit integer linear algebra support is given via branch `stdlib-fpm-ilp64`:\n  ```toml\n  [dependencies]\n  stdlib = { git=\"https://github.com/fortran-lang/stdlib\", branch=\"stdlib-fpm-ilp64\", preprocess.cpp.macros=[\"STDLIB_EXTERNAL_BLAS_I64\", \"STDLIB_EXTERNAL_LAPACK\"] }\n  ```\n\n## Contributing\n\n* [Guidelines](CONTRIBUTING.md)\n* [Issues](https://github.com/fortran-lang/stdlib/issues)\n* [Workflow](WORKFLOW.md)\n* [Style guide](STYLE_GUIDE.md)\n* [Code of conduct](CODE_OF_CONDUCT.md)\n* [License](LICENSE)\n\n## Links\n\n* [Proposals for the Fortran Standard Committee](https://github.com/j3-fortran/fortran_proposals/)\n* [US Fortran Standards Committee](https://j3-fortran.org/)\n* [International Fortran Standard Committee](https://wg5-fortran.org/)\n","funding_links":[],"categories":["Fortran"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortran-lang%2Fstdlib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffortran-lang%2Fstdlib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortran-lang%2Fstdlib/lists"}