简体   繁体   中英

Installing LAPACK to Visual Studio 2015

I seem to have problem with installing LAPACK library to my Visual Studio 2015 (C++, Windows 10).

I have downloaded precompiled libraries from here: https://icl.cs.utk.edu/lapack-for-windows/lapack/#libraries

I have also written "liblapack.lib" and "libblas.lib" to Project properties -> Linker -> Input -> Additional Dependencies and written C:\\Documents\\LAPACK (which is where libraries are located) to Project properties -> Linker -> General -> Additional Library Directories . I still get error

LNK1104 cannot open file 'liblapack.lib'

Changing "liblapack.lib" to "LAPACK.lib" or "LAPACKd.lib" didn't work anyway Any help please?

Here is an example visual studio 2015 solution that builds a simple main.cpp using the LAPACK libraries and dlls: https://bitbucket.org/aperezrathke/vs-lapack

Basically, the VS solution adds a Post-Build Event to copy the relevant dlls into your exe folder ( https://msdn.microsoft.com/en-us/library/h7dhf0ty.aspx )

To see this, open the solution file and navigate to the Project > Properties page (Alt+F7). Then navigate to Configuration Properties > Build Events > Post-Build Event .

In the Command Line field, there is:

xcopy "$(SolutionDir)Binaries" "$(TargetDir)" /Y

Assuming the necessary LAPACK dlls are in $(SolutionDir)Binaries , then this will copy the dlls to the executable folder every time the build is successful.

If instead you don't want to copy the dlls every time, then the folder containing the dlls should be added to your PATH environment variable.

It might be enough to use clapack for your purposes. See all details here: http://icl.cs.utk.edu/lapack-for-windows/clapack/index.html

  1. install msvc 2015, I used community edition
  2. install cmake https://cmake.org/files/v3.6/cmake-3.6.1-win64-x64.msi
  3. download http://icl.cs.utk.edu/lapack-for-windows/clapack/clapack-3.2.1-CMAKE.tgz
  4. run cmake gui, point to folder with unzipped tgz, set some other folder as output. generate solution, open it in msvc, build all projects (takes few minutes)
  5. use this sample project for testing http://icl.cs.utk.edu/lapack-for-windows/clapack/CLAPACK-EXAMPLE.zip (put your built .libs to /lib folder)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM