wo80/vs-suitesparse

cannot open file 'libf2c.lib'

Closed this issue · 5 comments

i get the following errors when building cholmod/umfpack/klu/spqr

LNK1104	cannot open file 'libf2c.lib'	libcholmod	
LNK1104	cannot open file 'libf2c.lib'	libumfpack
LNK1104	cannot open file 'libf2c.lib'	libklu	
LNK1104	cannot open file 'libf2c.lib'	libspqr	

i have the following libraries in my lib/ folder
image

wo80 commented

If you want to use custom BLAS/LAPACK config, for each of the 4 projects:

  • Open the project properties
  • Go to VC++ Directories property page and make sure, that Library Directories contains the path to the static libraries.
  • Go to Linker > Input, add missing library names and remove any libraries that don't exist (like libf2c.lib).

I prefer to build my own BLAS/LAPACK libraries as desribed in the wiki, since I don't want the dependencies on the other DLLs.

sorry i didn't notice that it required the c version not the fortran one, i built it manually and it's working well now

btw do you know where can i obtain the mkl dlls ? i already have mkl installed but don't know how to get their optimized blas/lapack libraries

wo80 commented

All MKL dlls are in the C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows\redist subdirectories. Your best option might be the Single Dynamic Library interface. I think you'd have to link with mkl_rt.lib and use the mkl_rt.dll. There are also some examples on how to call MKL from C#: Using Intel MKL in your C# program.

Another good way to get started is the MKL Link Line Advisor.

wo80 commented

Ok, I just checked and it works. I have an environment variable %MKLROOT% defined as C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2018\windows.

Open the project settings (for example libcholmod):

  • VC++ Directories: add $(MKLROOT)\mkl\lib\ia32_win for x86 and $(MKLROOT)\mkl\lib\intel64_win for x64.
  • Linker > Input: replace the BLAS/LAPACK libraries with mkl_rt.lib.

The project should compile. I haven't run any tests, though.