I imagine this to be a standard noob problem but after spending all morning searching the web, I decided to bug you anyway. I'm on Mac OS 10.9 and I'd like to call a LAPACK eigenvalue routine from a Fortran program. I had the pleasure of being introduced to Fortran just yesterday, so please excuse any foolish mistakes.
This is the minimal example I want to get to run:
program eigtest
complex A(3,3)
real eigs(3)
A(1,1) = cmplx(1,0)
A(1,2) = cmplx(0,2)
A(1,3) = cmplx(3,0)
A(2,1) = cmplx(0,-2)
A(2,2) = cmplx(5,0)
A(2,3) = cmplx(1,-1)
A(3,1) = cmplx(3,0)
A(3,2) = cmplx(1,1)
A(3,3) = cmplx(7,0)
call heevd(A, eigs)
write(*,*) eigs
end
I learned that on OS X, LAPACK is part of the Accelerate framework, so I tried things like:
gfortran -o eigtest -framework accelerate eigtest.f95
but the linker complains:
Undefined symbols for architecture x86_64:
"_heevd_", referenced from:
_MAIN__ in ccleuVFO.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status