How to install LAPACK for MSVS 2010 on windows?

2019-06-11 10:47发布

问题:

I am using the ITPP library (IT++ library) for one of my projects. For using the eigen_sym() function of this library, it asks for installing the LAPACK. I tried the direct prebuilt libraries for Windows but still get the error. Finally on the following site:

http://icl.cs.utk.edu/lapack-for-windows/lapack/#libraries

I found a solution under "Build Instructions to create LAPACK and LAPACKE 3.5.0 dlls for Windows with MinGW" that might work. I did steps 1 to 5 but got stuck 6 onwards.

My destination of the cmake build is E:/LAPACK

I got an error while in the cmd prompt while entering:

cd E:/LAPACK 3.5.0 >Enter
C:/MinGW/bin/mingw32-make.exe >Enter

i'm getting

mingw32-make.exe> No targets specified and no make file found. Stop.

Can someone explain the step 6 onwards in detail and tell me where i'm going wrong? I finally want to get the .dll and .lib files.

回答1:

I was able to build LAPACK 3.5 for windows using mingw and pretty much the build guide from the LAPACK page. Using the following steps

  1. Download lapack.tgz from here http://netlib.org/lapack/lapack.tgz
  2. Extract to a folder. I used 7zip file manager to extract the tarball to x:/Other/test
  3. Install mingw32. I used this: http://www.mingw.org/download/installer and I selected and installed mingw32-developer-toolkit + mingw32-base + mingw32-gfortran + mingw32-gcc-g++ + msys-base
  4. Open a command prompt
  5. Append mingw to your path

    path=C:/Mingw/bin;%PATH%

  6. change directory to the location you extracted lapack: For me this was X:\Other\Test\lapack-3.5.0 so the command I typed was the following (your path will be different):

    C:\Users\jdrescher>x:
    X:>cd Other\Test\lapack-3.5.0
    X:\Other\Test\lapack-3.5.0>

  7. make a folder for your build. I used build

    X:\Other\Test\lapack-3.5.0>mkdir build

  8. then change directory to the build folder

    X:\Other\Test\lapack-3.5.0>cd build
    X:\Other\Test\lapack-3.5.0\build>

  9. Now configure with CMake

    X:\Other\Test\lapack-3.5.0\build>cmake -G "MinGW Makefiles" -D BUILD_SHARED_LIBS=ON -D CMAKE_GNUtoMS=ON ..

  10. Now use gnu make to build LAPACK

    X:\Other\Test\lapack-3.5.0\build>c:\MinGW\bin\mingw32-make.exe

    Note: This step will take several minutes.

After the above steps completed 100% with no errors, I have the following dlls in the build\bin folder: libblas.dll, liblapack.dll, libtmglib.dll

Also the following libraries, and exp files in the build\lib folder: libblas.exp, libblas.lib, liblapack.exp, liblapack.lib, libtmglib.exp and libtmglib.lib.