[mlpack] Follow-up: compilation / linking issue "undefined reference"

Hearn, David J. DHearn at towson.edu
Tue Sep 10 00:18:16 EDT 2019


Hi Ryan,


Thank you very much for your help!


In case this is of use, I ended up removing my new boost installation, reinstalling an older boost (using yum), switching to an older gcc (4.8.5), and using the following cmake:


 cmake ../ -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/software/mlpack -DUSE_OPENMP=OFF -DARMADILLO_INCLUDE_DIR=/usr/local/software/armadillo-9.600.6/include/ -DARMADILLO_LIBRARY=/usr/local/software/armadillo-9.600.6/lib64/libarmadillo.so -DBUILD_PYTHON_BINDINGS=OFF -DBoost_NO_BOOST_CMAKE=1 -DBUILD_TESTS=OFF


No matter what I tried, gcc 9.2 would not finish the compilation.


Mlpack tests still would not compile.


The reuters_example.cpp would not compile unless I commented out:

CLI::ParseCommandLine(argc, argv);


Now the mlpack-examples seem to compile and run without a core dump, so this is definite progress, although the output from knn_example appears to be different from the provided "expected" output.


Many thanks again! I think I'm to a place where I can begin using mlpack.

David








David Hearn
Associate Professor
Director BALT Herbarium
Towson University
Department of Biological Sciences
8000 York Road
Baltimore, MD 21252
USA

phone: 410-704-2997
fax: 410-704-2405

email: dhearn at towson.edu
________________________________
From: Ryan Curtin <ryan at ratml.org>
Sent: Friday, September 6, 2019 11:44:48 AM
To: Hearn, David J. <DHearn at towson.edu>
Cc: mlpack at lists.mlpack.org <mlpack at lists.mlpack.org>
Subject: Re: [mlpack] Follow-up: compilation / linking issue "undefined reference"

[EXTERNAL EMAIL - USE CAUTION]

On Fri, Sep 06, 2019 at 03:31:40PM +0000, Hearn, David J. wrote:
> Hello,
>
> I'm very sorry to post a repeat request. i know you all are very busy,
> but for the life of me, I cannot get mlpack code - or the library
> itself - to compile correctly on my system. I'm reposting my previous
> message in the hopes in won't get lost in the transition between
> August and September posts. I've done quite a bit of coding and have
> not run into this issue before.

Hey David,

Sorry for the slow response.  I hadn't had a chance to respond yet, but
I was able to take a minute now.

> When I tried to compile this code with:
> g++ knn_example.cpp -o knn_example -std=c++11 -larmadillo -lmlpack -lboost_serialization -fopenmp
>
> ...
>
> , the error I get is as follows:
>
> /tmp/cckP4kAv.o: In function `main':
> knn_example.cpp:(.text+0x317): undefined reference to `bool mlpack::data::Load<double>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, arma::Mat<double>&, bool, bool)'
> ...

That's very strange.  I tried to reproduce this in a fedora rawhide
docker container and couldn't---it compiles correctly on my system.

Is it possible that there are multiple versions of libmlpack.so
installed on your system in different places?

> I've also tried compiling mlpack itself from source using
> boost_1_71_0, but even after giving cmake the BOOST_ROOT, boost is not
> linking appropriately when 'make' is run. Although this is a separate
> issue, if anyone has suggestions about either of these approaches to
> using mlpack, I'd be very grateful.

I haven't figured it out yet, but Boost's interactions with CMake after
1.70.0 have gotten... weird.  I now configure with
-DBoost_NO_BOOST_CMAKE=1 and this seems to make things a little bit more
sane.

Hope this helps!

Thanks,

Ryan

--
Ryan Curtin    | "I am the luckiest man alive!"
ryan at ratml.org |   - General Borzov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://knife.lugatgt.org/pipermail/mlpack/attachments/20190910/14772fa2/attachment.html>


More information about the mlpack mailing list