The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

porting Linux/Qt/C++/LAPACK project to Windows/Qt/C++/LAPACK

Open discussion regarding features, bugs, issues, vendors, etc.

porting Linux/Qt/C++/LAPACK project to Windows/Qt/C++/LAPACK

Postby peterpeyk » Sat Jun 30, 2007 4:47 am

Hello,

I'm writing a Qt4-application that uses LAPACK (I'm programming on SUSE Linux with kdevelop).
Now I'm trying to compile the project on Windows with MinGW-compiler, but cannot get it to work. I'm not experienced with MinGW - so my knowledge of makefiles etc. is very limited (been compiling almost exclusively with MSVC++ and Kdevelop so far).

On Linux, I've added -llapack and -lgfortran as external libraries and I'm using the uBlas header files

#include <boost/numeric/bindings/traits/ublas_matrix.hpp>
#include <boost/numeric/bindings/traits/ublas_symmetric.hpp>
#include <boost/numeric/bindings/traits/ublas_hermitian.hpp>
#include <boost/numeric/bindings/lapack/posv.hpp>
#include <boost/numeric/bindings/blas/blas.hpp>
#include <boost/numeric/ublas/hermitian.hpp>
#include <boost/numeric/ublas/symmetric.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/storage.hpp>
#include <boost/numeric/ublas/fwd.hpp>
#include <boost/numeric/ublas/expression_types.hpp>
#include <boost/numeric/ublas/triangular.hpp>

On Windows (WinXP) however, I don't know where to get the .dll's, the .lib-files, and how to tell MinGW-compiler to use these. Moreover, I don't know if the fortran support libraries are even named the same for Windows.

Can anyone help me with that information?

Thanks a lot!
Peter
peterpeyk
 
Posts: 2
Joined: Sat Jun 30, 2007 4:35 am
Location: Basel, Switzerland

Postby Julie » Thu Jul 05, 2007 3:30 pm

peterpeyk,
Could you give me the error message and the compilation line?
Also a line of your code that is calling a LAPACK routine may be useful for me to be able to help you? (look for posv in your C/C++ files)
Thanks
Julie
Julie
 
Posts: 299
Joined: Wed Feb 23, 2005 12:32 am
Location: ICL, Denver. Colorado

Postby peterpeyk » Fri Jul 06, 2007 1:46 am

Julie,
thanks for your reply.
since my last post I found a way to use MSVC as a compiler for the project, but the problem remains: I don't know how to include the lapack libraries. I've downloaded the lapack source and compiled it using cygwin - but the file I get as output didn't help me much either. I've also downloaded "binaries" from lapack website (blas_win32.lib and lapack_win32.lib), but I couldn't find the corresponding dll's anywhere. Anyway, here is my code and the compiler error (it's a german compiler message which is a "unresolved external symbol"-error):

////////////////////////////////////////////////////////////////////////////////
// code
////////////////////////////////////////////////////////////////////////////////
namespace lapack = boost::numeric::bindings::lapack;
namespace blas = boost::numeric::bindings::blas;
namespace ublas = boost::numeric::ublas;

ublas::matrix<float, ublas::column_major> UBlasInvCoeffTmp(UBlasInvCoeff);
ublas::symmetric_adaptor<ublas::matrix<float, ublas::column_major>, ublas::upper> sUBlasInvCoeff (UBlasInvCoeffTmp);
ublas::identity_matrix<float> iSLCLambdaApproxMat (NChan);
ublas::matrix<float, ublas::column_major> SLCLambdaApproxMat (iSLCLambdaApproxMat);
ublas::matrix<float, ublas::column_major> Tmp;
ublas::matrix<float> A;
ublas::matrix<float> B;
ublas::matrix<float> C;
Tmp.resize(pNav->NIntervalsRem,NVertices);
SLCLambdaApproxMat *= SLCLambdaApprox;
sUBlasInvCoeff += SLCLambdaApproxMat;
Data2AnalyseList[DataSetInd].resize(NChan,pNav->NIntervalsRem);
ublas::matrix<float, ublas::column_major> Test2 = Data2AnalyseList[0];
Data2AnalyseList[DataSetInd] = (*pView->DataSets)[DataSetInd].UBlasViewMat;
CorticalMapList[DataSetInd].resize(NVertices,pNav->NIntervalsRem,false);

lapack::posv(sUBlasInvCoeff,Data2AnalyseList[DataSetInd]);

blas::gemm('T','N',1.0f,Data2AnalyseList[DataSetInd],UBlasForCoeff,0.0f,Tmp);

////////////////////////////////////////////////////////////////////////////////
// compiler output
////////////////////////////////////////////////////////////////////////////////
qemegs error LNK2019: Nicht aufgelöstes externes Symbol '_sposv', verwiesen in Funktion '"void __cdecl boost::numeric::bindings::lapack::detail::posv(char,int,int,float *,int,float *,int,int *)" (?posv@detail@lapack@bindings@numeric@boost@@YAXDHHPAMH0HPAH@Z)'

qemegs error LNK2019: Nicht aufgelöstes externes Symbol '_sgemm', verwiesen in Funktion '"void __cdecl boost::numeric::bindings::blas::detail::gemm(char,char,int const &,int const &,int const &,float const &,float const *,int const &,float const *,int const &,float const &,float *,int const &)" (?gemm@detail@blas@bindings@numeric@boost@@YAXDDABH00ABMPBM0201PAM0@Z)'


I really appreciate your help!!
Thank you
Peter
peterpeyk
 
Posts: 2
Joined: Sat Jun 30, 2007 4:35 am
Location: Basel, Switzerland


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests