0

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
user3209698
  • 127
  • 4
  • 3
    Use your favourite search engine to look for such examples, they're not difficult to find. SO does not aspire to replace search engines, not even for such programming questions as yours. Your question is, according to local etiquette, off-topic. – High Performance Mark Mar 20 '14 at 15:09
  • It is not a problem about searching, it is a problem about compiling. I will change the question to make it clear – user3209698 Mar 20 '14 at 16:10
  • How does the problem look like? Do you have any error mesage? Why do you link with regular BALS? – Vladimir F Героям слава Mar 20 '14 at 16:28
  • The compiler is not able to find sparse_blas.mod. And when I download the module from the website http://www.netlib.org/blas/blast-forum/ It cannot understand the subroutine 'DUSCR_BEGIN'. I link with regular BLAS because I thought these sparse subroutines were implemented in this library – user3209698 Mar 20 '14 at 16:38
  • 1
    Do you have the Sparse BLAS installed? – Vladimir F Героям слава Mar 20 '14 at 19:42

1 Answers1

1

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
Community
  • 1
  • 1
Peter Petrik
  • 9,701
  • 5
  • 41
  • 65