[mlpack-svn] [MLPACK] #297: getting error while trying to compile linear_regression_main.cpp
MLPACK Trac
trac at coffeetalk-1.cc.gatech.edu
Thu Aug 8 10:11:11 EDT 2013
#297: getting error while trying to compile linear_regression_main.cpp
---------------------------------+------------------------------------------
Reporter: sumedhghaisas | Owner:
Type: defect | Status: closed
Priority: minor | Milestone:
Component: mlpack | Resolution: invalid
Keywords: complilation error | Blocking:
Blocked By: |
---------------------------------+------------------------------------------
Changes (by rcurtin):
* status: new => closed
* resolution: => invalid
Comment:
Hello there,
The CMake configuration should be building the linear regression
executable to begin with, so you shouldn't need to call g++ on it
yourself. From your build directory, you should be able to type 'make
linear_regression' and then the executable will be in bin/ (under the
build directory).
As for the actual compilation problem, libxml2 is a little weird in that
it often installs under /usr/include/libxml2/, but doesn't always.
Therefore, we have to use `#include <libxml/parser.h>` instead of
`#include <libxml2/libxml/parser.h>`. The solution for your error is to
add /usr/include/libxml2/ to the list of include directories that GCC
looks in, by adding the "-I /usr/include/libxml2/" option. You'll also
need to link against mlpack (-L/path/to/build/lib/ -lmlpack). The -L
option is necessary to specify linker directories unless you have
installed libmlpack.so in the default search paths (/usr/lib,
/usr/local/lib, /lib, etc.).
{{{
$ g++ -I/usr/include/libxml2/ linear_regression_main.cpp
-L/path/to/build/lib/ -lmlpack
}}}
Hopefully this is helpful. Feel free to respond if you are still having
issues.
Thanks,
Ryan
--
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/297#comment:1>
MLPACK <www.fast-lab.org>
MLPACK is an intuitive, fast, and scalable C++ machine learning library developed at Georgia Tech.
More information about the mlpack-svn
mailing list