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

In summary, the conversation discusses the use of gfortran on windows to compile .f95 files and the need to incorporate LAPACK subroutines. The individual has attempted to follow instructions from online sources but has encountered errors. They are seeking assistance in properly using LAPACK with gfortran on windows.
  • #1
Ted Burgess
5
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
  • #2
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.
 

1. What is LAPACK in gfortran and how does it differ from regular gfortran?

LAPACK (Linear Algebra PACKage) is a library of algorithms for performing linear algebra operations, such as solving systems of linear equations and computing eigenvalues, in Fortran. It is an extension of the gfortran compiler and provides optimized and efficient implementations of these operations for use in scientific and engineering applications. Regular gfortran is a compiler that is used to translate Fortran code into executable programs, while LAPACK is a library that provides additional functionality for performing linear algebra operations.

2. Can LAPACK be used on a Windows operating system?

Yes, LAPACK can be used on a Windows operating system. The gfortran compiler, which includes LAPACK, is available for Windows as well as other operating systems such as Linux and macOS. However, some additional steps may be required to install and set up gfortran and LAPACK on a Windows system.

3. Is LAPACK in gfortran free to use?

Yes, LAPACK in gfortran is free to use. It is an open-source library that is distributed under the Modified BSD License, which allows for both personal and commercial use. However, some restrictions may apply for redistribution and modification of the library.

4. What are the benefits of using LAPACK in gfortran?

There are several benefits to using LAPACK in gfortran. First, it provides highly optimized and efficient implementations of common linear algebra operations, making it faster and more accurate than writing these operations from scratch. Additionally, it is widely used and has been extensively tested and validated, making it a reliable tool for scientific and engineering applications. Finally, as an extension of the gfortran compiler, it integrates easily with other Fortran code and can be used in conjunction with other libraries and tools.

5. How can I learn more about using LAPACK in gfortran?

There are many resources available for learning more about using LAPACK in gfortran. One option is to consult the official LAPACK website, which includes documentation, user guides, and tutorials. Another option is to search for online tutorials or courses specifically focused on using LAPACK in gfortran. Additionally, many books and academic papers cover the use of LAPACK in various applications and may provide more in-depth information on specific topics.

Back
Top