Devoev
Devoev

Reputation: 554

How to install LAPACK for Fortran on Windows 10

I'm trying to use LAPACK in a Fortran project, but I can't get CMake to find my LAPACK dll. I have very little experience with Fortran, Cmake and linking dll's. I use this template for my project. In the main CMakeLists.txt file, I enabled the option

INCLUDE(${CMAKE_MODULE_PATH}/SetUpLAPACK.cmake)

but I get the following error

Could NOT find BLAS (missing: BLAS_LIBRARIES)

when trying to compile the project. I have tried to put the libblas.dll and liblapack.dll (I got them from this website) in different folders which are on in the PATH. I also tried putting them directly in the folder where the executables should be generated, but I still get the same error.

So my question is: How can I properly install LAPACK on my system, so that the compiler can find it and successfully compile the project?

I use gfortran (MinGW64) and Windows 10/11.

Upvotes: 2

Views: 1277

Answers (1)

Federico Perini
Federico Perini

Reputation: 1416

Best/easiest option AFAICT is to replace MinGW64 with MSYS2, then you can just install lapack with it's package manager:

pacman -Sy mingw-w64-x86_64-lapack

(you should be able to install the MSYS2 gcc/gfortran toolchain as its dependency): the library will be placed in MSYS's shared library folder.

Otherwise, most likely you'll have to build it yourself.

Upvotes: 4

Related Questions