[mlpack] How to link c++ files with mlpack?

Jaskaran Singh jaskaranvirdi1 at gmail.com
Fri Feb 13 08:27:25 EST 2015


Hi Marcus,
Even after compiling with the command which you gave.I get a lot of errors.
These errors are of the type
undefined reference to 'wrapper_dsyrk'
undefined reference to 'wrapper_dgemm'

On 3 February 2015 at 16:17, Marcus Edel <marcus at virtual-artz.de> wrote:

> Hello Jaskaran,
>
> What you'll need to do is add the include directory /usr/include/libxml2/
> or
> /usr/include/libxml2 in your case to the compiler's search path. From the
> command-line (using g++ or clang) this is easily accomplishable with
> -I/usr/include/libxml2/ or -I/usr/include/libxml2/, and then you can link
> with
> -lxml2.
>
> The command should look something like this:
>
> g++ -I/usr/include/libxml2/ -lxml2  -lmlpack covariance_comp.cpp
>
>
> Hopefully this is helpful. Feel free to respond if you are still having
> issues.
>
> Thanks,
> Marcus
>
>
> On 03 Feb 2015, at 10:01, Jaskaran Singh <jaskaranvirdi1 at gmail.com> wrote:
>
> Hi
> After installing mlpack, I tried to run the covariance example given here
> http://www.mlpack.org/doxygen.php?doc=sample.html
>
> I first tried:
> $g++ covariance_comp.cpp -lmlpack
>
> I got the error
>
> In file included from /usr/local/include/mlpack/core.hpp:171:0,
>                  from covariance_comp.cpp:2:
> /usr/local/include/mlpack/core/util/save_restore_utility.hpp:26:27: fatal
> error: libxml/parser.h: No such file or directory
> compilation terminated.
>
> But I already have libxml/parser.h in /usr/include/libxml2
>
> I also tried
>
> $g++ -I /usr/include/libxml2/ covariance_comp.cpp -lmlpack
>
> Then I get this error
> /usr/bin/ld: /tmp/cc0ARZzq.o: undefined reference to symbol
> 'wrapper_dgemm_'
> /usr/bin/ld: note: 'wrapper_dgemm_' is defined in DSO
> /usr/lib/libarmadillo.so.4 so try adding it to the linker command line
> /usr/lib/libarmadillo.so.4: could not read symbols: Invalid operation
> collect2: ld returned 1 exit status
>
>
> *Jaskaran Singh Virdi*
> *Final Year Undergrad Computer Science*
> *IIT Ropar*
> *GitHub:*https://github.com/jaskaran1
>  _______________________________________________
> mlpack mailing list
> mlpack at cc.gatech.edu
> https://mailman.cc.gatech.edu/mailman/listinfo/mlpack
>
>
>


-- 
Cheers
*Jaskaran Singh Virdi*
*Final Year Undergrad Computer Science*
*IIT Ropar*
*GitHub:*https://github.com/jaskaran1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cc.gatech.edu/pipermail/mlpack/attachments/20150213/df37c1b7/attachment-0003.html>


More information about the mlpack mailing list