When I link the following code
PROGRAM MAIN
implicit none
integer(8), PARAMETER :: N=2**9
complex(8) ::A(N,N),B(N,N),C(N,N)
C=matmul(A,B)
end program MAIN
with Lapack and OpenMP via:
gfortran test.f95 -O3 -Wall -g -std=f95 -cpp -I /usr/include/ -L /usr/lib -lm -fopenmp -lpthread -lblas -llapack -fexternal-blas
I get a segmentation fault. Reducing the dimension of the array to 2**8 or removing OpenMP removes the error. What is the reason for this?
-I /usr/include/ -L /usr/lib -lm -lpthread
? Why? Try to use as few flags as possible to be sure what causes it. This was enough for me :gfortran statica.f90 -frecursive
. Ceterum censeointeger(8)
orkind=8
is very ugly code smell. – Vladimir F