LAPACK integration

LAPACK integration

I'm working to integrate LAPACK and BLAS libraries with a Fortran project in Visual Studio, and I can't seem to get things to work. I have downloaded liblapack.lib and libblas.lib and included their directory in Configuration Properties -> Linker -> General -> Additional Library Directories. I have included "liblapack.lib; libblas.lib" in  Configuration Properties -> Linker -> Input -> Additional Dependencies. However, when I build my program, I get the following errors: "error #11018: Cannot open liblapack.lib;" and "fatal error LNK1181: cannot open input file 'liblapack.lib;'.

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

First, you may want to double-check whether your directory specification for the two lib files is correct, especially whether the  backslashes ("\") in the directory path are accepted properly.  You can look at the command line option within Visual Studio for the linker settings to check this: Project -> Properties -> Linker -> Command Line.

Also, do you have the correct project configuration?  That is, are you building a 64-bit version (configuration = x64) whereas the downloaded libraries are 32-bit, or vice versa?

Why not use mkl (assuming you have ifort)?

Got it, thanks. I didn't realize that VS was running as a 32-bit program.

The final code will be run/compiled with gfortran, so I need to use LAPACK. But building and debugging is a lot easier in VS, so I'm using that for now.
 

Quote:

Francis R. wrote:

Got it, thanks. I didn't realize that VS was running as a 32-bit program.

 

It's not so much VS running as 32 bit but rather the program you are compiling / building. If you have installed the 64 bit compiler then you are able to build 64 bit exes linking to 64 bit libraries all within VS. With the 32 and 64 bit compilers you are able to build both 32bit and 64bit exes as required.

Les

I don't think it's realistic to use (nearly) the same Windows lapack library with gfortran and ifort, other than by ACML or building it yourself from source.  You can test your application using MKL with ifort and whichever lapack you choose with gfortran.  On linux and MacOS,  MKL supports gfortran, but gfortran compiled lapack will not work with ifort.

As Les said, the fact that the VS/ifort build system runs in 32-bit mode and optionally targets Intel64 mode, while gfortran builds in 64-bit mode, should not be of great concern to you.  What does matter is that the libraries you link are built for your target mode and OS.

Take a look on the LAPACK documentation,  I agree that you should take care with the compiler you are using...good look for you!

Ketson Roberto

Leave a Comment

Please sign in to add a comment. Not a member? Join today