[mlpack] Problem building MLPACK - CF linking error

Sylvana Alpert SAlpert at blackrockmicro.com
Mon Aug 18 18:52:20 EDT 2014


Dear MLPACKERS,

Thanks so much for your help. 
That helped and I was able to compile libmlpack.a. 

Now, I have a follow-up question. I am trying to link MLPACK with my project in Qt Creator using MinGW and I keep getting a linking error that relates to Armadillo and LAPACK/BLAS libraries. 
I used armadillo to compile the example that comes with it and everything runs smoothly but for some reason, when compiled with MLPACK, it gives me those errors. Please see the attached txt file with the details. 
In line 1985 you can see that I am adding the proper libraries. 

Any suggestion will be really helpful.
Thanks in advance for your help!

Below are the lines in my .pro file: 

## Armadillo
unix|win32: LIBS += -L$$PWD/MLPACK/dependencies/armadillo/lib/ -larmadillo
INCLUDEPATH += $$PWD/MLPACK/dependencies/armadillo/include
DEPENDPATH += $$PWD/MLPACK/dependencies/armadillo/include
unix|win32-g++: PRE_TARGETDEPS += $$PWD/MLPACK/dependencies/armadillo/lib/libarmadillo.a

# LAPACK
unix|win32: LIBS += -L$$PWD/MLPACK/dependencies/lapack/x86/ -llapack

# BLAS
unix|win32: LIBS += -L$$PWD/MLPACK/dependencies/blas/x86/ -lblas

## MLPACK
unix|win32: LIBS += -L$$PWD/MLPACK/lib/ -lmlpack
INCLUDEPATH += $$PWD/MLPACK/include
DEPENDPATH += $$PWD/MLPACK/include
unix|win32-g++: PRE_TARGETDEPS += $$PWD/MLPACK/lib/libmlpack.a

# Boost
INCLUDEPATH += C:\boost_1_54_0

# LibXML2
unix|win32: LIBS += -L$$PWD/MLPACK/dependencies/libxml2/lib/ -lxml2
INCLUDEPATH += $$PWD/MLPACK/dependencies/libxml2/include
DEPENDPATH += $$PWD/MLPACK/dependencies/libxml2/include
unix|win32-g++: PRE_TARGETDEPS += $$PWD/MLPACK/dependencies/libxml2/lib/libxml2.a





-----Original Message-----
From: Ryan Curtin [mailto:gth671b at mail.gatech.edu] 
Sent: Monday, August 18, 2014 8:33 AM
To: Gilles Barges
Cc: Sylvana Alpert; mlpack at cc.gatech.edu
Subject: Re: [mlpack] Problem building MLPACK - CF linking error

On Sat, Aug 16, 2014 at 06:22:19AM +0200, Gilles Barges wrote:
> > 
> >  I have attached the text file containing all the details. 
> 
> I forgot yo say you should use 'VERBOSE=1 make ….' to have an echo of the commands that are issued.
> 
> > I checked my installation of MinGW and I only have one installation C:\MinGW. In this directory, there is C:\MinGW\mingw32\bin which contains some duplicate executables (also in C:\MinGW\bin) but from what I read online this is how MinGW installs by default. 
> 
> Sorry, it's me that cannot count the ../ :-)
> 
> > Any ideas of what might be going wrong? 
> 
> Yes, the build assumes that on Windows, automatic linking is used (as
> MSVC++), but MinGW does not do that.
> 
> Edit the file CMakeLists.txt and comment set(Boost_LIBRARIES "") near 
> line 190 re-run cmake after that.

Ah, okay.  I have updated the CMakeLists.txt file in trunk (r17062) so that Boost_LIBRARIES is only set to "" when MSVC is the generator that's being used.  Hopefully this should fix the issue, but I don't have a MinGW system to test with (yet); let me know if it doesn't fix that particular issue.

-- 
Ryan Curtin    | "This is how Number One works!"
ryan at ratml.org |   - Number One
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: compiler_output.txt
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20140818/ffa99218/attachment-0001.txt>


More information about the mlpack mailing list