Question

I need to use sparse algorithms for storage and multiplying many matrices in Fortran 90. I have seen that it can be done using Sparse Blas library. I would like to know where I can find some examples for compiling and using this library (I am quite new with Fortran). I have tried to implement by myself, and it has been impossible for me to compile even the first line. This is my program:

program main
use sparse_blas
IMPLICIT NONE
integer::istat
integer::i,j,NonZA,NonZB,nonZmul
double precision::A(4,4),B(4,4),mul(4,4)
!initialization of matrices

call DUSCR_BEGIN(4,4,A,istat)
end program main

And the makefile I use:

objects = test.o
f90 = gfortran
fflags = -g -wall


test.x: $(objects)
    $(f90) -o test.x $(objects) -lblas

test.o: test.f90 
$(f90) -c test.f90 -lblas
Was it helpful?

Solution

To compile file that uses MODULE (e.g. sparse_blas), you have to specify correct include path in your makefile.

change the last line in your makefile to

$(f90) -c test.f90 $(fflags) -Idirectory_which_contains_sparse_blas.mod
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top