Help me out please
I am facing issues in using stdlib on my local(ubuntu 20.04).
I followed the steps given in the readme file.
I have cloned the repo.
Then I created CMake files.
Create a test program calling stdlib and the CMake file
ipribec@thinkpad:/mnt/d/demo/my_code$ cat hello_stdlib.f90
program main
use stdlib_linalg, only: diag
implicit none
real :: A(3,3), d(3)
A = reshape([1.,2.,3.,4.,5.,6.,7.,8.,9.],[3,3])
d = diag(A)
write(*,*) d
end program
ipribec@thinkpad:/mnt/d/demo/my_code$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.14)
project(
"demo"
LANGUAGES "Fortran"
VERSION "0.1"
)
find_package(fortran_stdlib REQUIRED)
add_executable(hello_stdlib hello_stdlib.f90)
target_link_libraries(
hello_stdlib
PRIVATE fortran_stdlib::fortran_stdlib)
Build and run your program
ipribec@thinkpad:/mnt/d/demo/my_code$ mkdir build
ipribec@thinkpad:/mnt/d/demo/my_code$ cd build
ipribec@thinkpad:/mnt/d/demo/my_code/build$ cmake ..
-- The Fortran compiler identification is GNU 9.3.0
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Check for working Fortran compiler: /usr/bin/f95 - skipped
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 - yes
-- Configuring done
-- Generating done
-- Build files have been written to: /mnt/d/demo/my_code/build
ipribec@thinkpad:/mnt/d/demo/my_code/build$ make hello_stdlib
Scanning dependencies of target hello_stdlib
[ 50%] Building Fortran object CMakeFiles/hello_stdlib.dir/hello_stdlib.f90.o
[100%] Linking Fortran executable hello_stdlib
[100%] Built target hello_stdlib
ipribec@thinkpad:/mnt/d/demo/my_code/build$ ./hello_stdlib
1.00000000 5.00000000 9.00000000