From 82714bd9dc3607ef2d6ab6b4d00312d477963819 Mon Sep 17 00:00:00 2001 From: ZUO Zhihua Date: Sat, 13 Apr 2024 11:24:17 +0800 Subject: [PATCH 1/2] Update linalg.md and example_blas_gemv.f90 --- doc/specs/stdlib_linalg.md | 4 ++++ example/linalg/example_blas_gemv.f90 | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/specs/stdlib_linalg.md b/doc/specs/stdlib_linalg.md index ab52dfb71..0f198e811 100644 --- a/doc/specs/stdlib_linalg.md +++ b/doc/specs/stdlib_linalg.md @@ -41,6 +41,10 @@ These can be enabled during the build process. For example, with CMake, one can The same is possible from the `fpm` branch, where the `cpp` preprocessor is enabled by default. For example, the macros can be added to the project's manifest: ```toml +# Link to blas and lapack libraries; or `link = "openblas"` for openblas +[build] +link = ["blas", "lapack"] + [dependencies] stdlib="*" diff --git a/example/linalg/example_blas_gemv.f90 b/example/linalg/example_blas_gemv.f90 index e5d0e0799..e4594362f 100644 --- a/example/linalg/example_blas_gemv.f90 +++ b/example/linalg/example_blas_gemv.f90 @@ -2,13 +2,13 @@ program example_gemv use stdlib_linalg, only: eye use stdlib_linalg_blas, only: sp,gemv implicit none(type,external) - real(sp) :: A(2, 2), B(2) + real(sp) :: A(2, 2), B(2), C(2) B = [1.0,2.0] A = eye(2) ! Use legacy BLAS interface - call gemv('No transpose',m=size(A,1),n=size(A,2),alpha=1.0,a=A,lda=size(A,1),x=B,incx=1,beta=0.0,y=B,incy=1) + call gemv('No transpose',m=size(A,1),n=size(A,2),alpha=1.0,a=A,lda=size(A,1),x=B,incx=1,beta=0.0,y=C,incy=1) - print *, B ! returns 1.0 2.0 + print *, C ! returns 1.0 2.0 end program example_gemv From 54eaecf46b1fb213d74d84940ae37aad69a15692 Mon Sep 17 00:00:00 2001 From: ZUO Zhihua Date: Sat, 13 Apr 2024 17:10:49 +0800 Subject: [PATCH 2/2] update stdlib_linalg.md Co-authored-by: Federico Perini --- doc/specs/stdlib_linalg.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/specs/stdlib_linalg.md b/doc/specs/stdlib_linalg.md index 0f198e811..defe30758 100644 --- a/doc/specs/stdlib_linalg.md +++ b/doc/specs/stdlib_linalg.md @@ -41,7 +41,7 @@ These can be enabled during the build process. For example, with CMake, one can The same is possible from the `fpm` branch, where the `cpp` preprocessor is enabled by default. For example, the macros can be added to the project's manifest: ```toml -# Link to blas and lapack libraries; or `link = "openblas"` for openblas +# Link against appropriate external BLAS and LAPACK libraries, if necessary [build] link = ["blas", "lapack"]