I'm using the directions referenced there: http://icl.cs.utk.edu/lapack-for-windows/lapack/#build with little success.
Summary of what I'm trying to do:
- Get Lapack up and running in support of 64-bit C++ software I'm writing in Visual Studio 2013.
I'm using the pre-built libraries that are given there at http://icl.cs.utk.edu/lapack-for-window ... #libraries by downloading x64.dll & x64.lib for Ref BLAS, LAPACK & LAPACKE. (I'm also downloading the 4 LAPACKE headers that are there <= but I think these are not critical for this 1st project I'm trying to run). I put these library files in appropriate lib, bin, and include folders.
Visual Studio steps I'm taking:
- I start a new project - picking the Visual C++ Empty Project template
In project properties, I first go to Configuration Manager and create a new solution platform of x64 (copying the Win32 settings)
Then for all configurations and for all platforms I point the Linker Additional Library Dependencies to where I put the prebuilt *.lib files. I also add to the Linker => Input the libblas.lib and liblapack.lib libraries
Note 1: I'm not adding any of the Lapacke stuff yet since I don't believe the simple example program I'm trying to run will need that stuff (and adding those paths did not seem to help in earlier attempts.)
Note 2: I know that the libraries I downloaded are 64-bit only - but I applied these project properties to 'all platforms' (meaning including the 32-bit platform) to demonstrate something, below...
Then in Visual Studio, I added a single C++ source file 'source.cpp' with the code provided at http://www.cs.rochester.edu/~bh/cs400/using_lapack.html
I added the 'extern "C" ' text before the two Lapack prototypes (for dgesv_ & dgels_)
And then I try to compile this program (in either Debug or Release configuration) - for an x64 platform and get the error:
- Code: Select all
error LNK2019: unresolved external symbol dgesv_ referenced in function main
which seems to indicate that the prebuilt libraries do not contain these functions.
The very odd thing is that if I change the platform to 'win32', the project compiles! (huh?)
Btw, adding an underscore before dgesv_ in the code also does not seem to work - giving me the error upon compilation:
- Code: Select all
fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'
which also tracks with some of the discussion at viewtopic.php?f=12&t=4260
Again, this all seems to track the discussion at viewtopic.php?f=12&t=4260 and folks there seemed to indicate that building the libraries yourself with CMAKE is a solution (I'm trying that but running into issues there with it not finding the proper fortran compiler <= that's probably appropriate for a different post!). More importantly, in the last post of that thread, 'admin' indicated that they corrected any previous problem with these pre-built libaries and that they should work now. So I must be doing something incorrect, right? Does anyone see a problem in the workflow I'm using here?