Run time errors in fortran program with LAPACK on Windows

435 views Asked by At

I want to run a fortran program (GNU GCC fortran compiler) with LAPACK library on Windows platform. I followed the instructions outlined in on the webpage http://icl.cs.utk.edu/lapack-for-windows/lapack/ Build Instructions to create LAPACK and LAPACKE 3.5.0 dlls for Windows with MinGW I tried using method Configuring LAPACK in Eclipse-Photran for fortran compiler on Windows.

Compiling a program test1.f90 with cygwin goes fine, here is command:

gfortran test1.f90 -o test1 -L "C:\MinGW\lapack-3.5.0\bin" -llapack
  • I have lapack installed at "C:\MinGW\lapack-3.5.0", under lapack-3.5.0\, libs are in lib folder, dlls are in bin folder
  • "C:\MinGW\bin" is added to PATH variable

But I got errors,

  • Running with cygwin gives error error while loading shared libraries: ?: cannot open shared object file: No such file or directory
  • Running with Windows terminal gives error The program cannot start because liblapack.dll is missing from your computer. Try reinstalling the program to fix this problem,

When I checked "C:\MinGW\lapack-3.5.0\bin", liblapack.dll is there. Any idea what is happening here? Do I need to add the directory of library to the PATH variable? Thanks.

1

There are 1 answers

0
fishermanhat On

This is just a conjecture, but you might try changing the "C:\" to a Linux directory naming convention, namely from

    "C:\MinGW\lapack-3.5.0\bin"

to

    "/MinGW/lapack-3.5.0/bin"

in Settings->C/C++ Build->MinGW C++ Linker-> Libraries -> Library Search Path if you are using Photran.