How can I successfully use the LAPACK package with gfortran on windows?

Click For Summary
SUMMARY

The discussion focuses on using the LAPACK package with gfortran on Windows, specifically addressing issues encountered during compilation. The user, Ted, reports errors related to undefined references when attempting to link LAPACK subroutines. He mentions following instructions from both a CFD forum and the GCC wiki, but encounters multiple errors, including missing object files and unrecognized commands. The solution proposed includes downloading LAPACK routines with all dependencies or installing the entire LAPACK library to resolve these issues.

PREREQUISITES
  • Familiarity with gfortran command-line usage
  • Understanding of LAPACK subroutine dependencies
  • Basic knowledge of Windows command prompt operations
  • Experience with compiling Fortran code
NEXT STEPS
  • Download LAPACK with dependencies from netlib
  • Install the complete LAPACK library on Windows
  • Review gfortran linking options for external libraries
  • Explore troubleshooting common gfortran compilation errors
USEFUL FOR

This discussion is beneficial for Fortran developers, computational scientists, and anyone working with numerical methods who needs to integrate LAPACK into their projects using gfortran on Windows.

Ted Burgess
Messages
5
Reaction score
0
Hi,

I've been using gfortran on windows through the command line to compile .f95 files using the command

gfortran file.f95

to get an a.exe file which I can then run. However, I'm currently writing some Fortran code which needs some of the subroutines of the LAPACK package. I've been looking for a comprehensible explanation of how to use the LAPACK package with gfortran on windows and have only come across one (which does not work):

http://www.cfd-online.com/Forums/main/70450-gfortran-lapack.html

When i follow steps 3, 4 and 5 of that link with a code which uses LAPACK subroutines, I get an error message,

liblapack.a(dsyev.o):dsyev.f:(.text+0x2ae): undefined reference to 'dlamch_'

and some more of the same form. I've also tried using the procedure described here, http://gcc.gnu.org/wiki/LAPACK on Windows but when I run the makelibs.bat file I get many error messages like

could not find C:\documents and settings\admin\desktop\new\lapack-3.4.0\INSTALL\*.o
'testlsame' is not recognised as an internal or external command, operable program or batch file

...and many more.

Any help would be appreciated.

Thanks,

Ted
 
Technology news on Phys.org
Most LAPACK subroutines rely on other LAPACK subroutines. On netlib, there is an option to download a given LAPACK routine with all dependencies included.

Alternatively, one can install the entire LAPACK as a library.
 

Similar threads

  • · Replies 22 ·
Replies
22
Views
5K
  • · Replies 2 ·
Replies
2
Views
18K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 9 ·
Replies
9
Views
9K
Replies
3
Views
2K
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K