Skip to content

Commit 4fc5e8b

Browse files
committed
Document linear algebra in README.md
1 parent 0a6b907 commit 4fc5e8b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,34 @@ as well as a specification document or ["spec"](https://stdlib.fortran-lang.org/
323323
Some discussions and prototypes of proposed APIs along with a list of popular open source Fortran projects are available on the
324324
[wiki](https://github.com/fortran-lang/stdlib/wiki).
325325

326+
## BLAS and LAPACK
327+
328+
`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`.
329+
The 32- and 64-bit implementations may be replaced by external optimized libraries if available, which may allow for faster code.
330+
When linking against external BLAS/LAPACK libraries, the user should define macros `STDLIB_EXTERNAL_BLAS` and `STDLIB_EXTERNAL_LAPACK`,
331+
to ensure that the external library version is used instead of the internal implementation.
332+
333+
- In case of a CMake build, the necessary configuration can be added by ensuring both macros are defined:
334+
```
335+
add_compile_definitions(STDLIB_EXTERNAL_BLAS STDLIB_EXTERNAL_LAPACK)
336+
```
337+
- In case of an `fpm` build, the stdlib dependency should be set as follows:
338+
```toml
339+
[dependencies]
340+
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm", preprocess.cpp.macros=["STDLIB_EXTERNAL_BLAS", "STDLIB_EXTERNAL_LAPACK"] }
341+
```
342+
343+
Support for 64-bit integer size interfaces of all BLAS and LAPACK procedures may also be enabled
344+
by setting the CMake flag `-DWITH_ILP64=True`. The 64-bit integer version is always built in addition to
345+
the 32-bit integer version, that is always available. Additional macros `STDLIB_EXTERNAL_BLAS_I64` and `STDLIB_EXTERNAL_LAPACK_I64`
346+
may be defined to link against an external 64-bit integer library, such as Intel MKL.
347+
348+
- In case of an `fpm` build, 64-bit integer linear algebra support is given via branch `stdlib-fpm-ilp64`:
349+
```toml
350+
[dependencies]
351+
stdlib = { git="https://github.com/fortran-lang/stdlib", branch="stdlib-fpm-ilp64", preprocess.cpp.macros=["STDLIB_EXTERNAL_BLAS_I64", "STDLIB_EXTERNAL_LAPACK"] }
352+
```
353+
326354
## Contributing
327355

328356
* [Guidelines](CONTRIBUTING.md)

0 commit comments

Comments
 (0)