[mlpack-git] [mlpack] libxml problem compiling kmeans (similar to #285) (#393)

Ryan Curtin notifications at github.com
Tue Jan 27 19:36:35 EST 2015


What you'll need to do is add the include directory `/usr/include/libxml2/` (I assume this is where Arch puts the libxml2 headers) to the compiler's search path.  From the command-line (using g++ or clang) this is easily accomplishable with `-I/usr/include/libxml2/`, and then you can link with `-lxml2`.  If you're using CMake to configure and build your application, then try this snippet:

```
find_package(LibXml2 2.6.0 REQUIRED)
include_directories(${LIBXML2_INCLUDE_DIR})
```

and then when you link your program, add libxml2 to the dependencies:

```
target_link_libraries(your_program
  ... # Other dependencies...
  ${LIBXML2_LIBRARIES})
```

Really this is sort of an unsatisfying solution, and the better solution will be a solution to #315 (or something like that) that makes the libxml2 dependency entirely internal to libmlpack.so.  But unfortunately this hasn't been done yet, so what I've written above is probably the best answer I can give for now...

Hopefully this is helpful.  If not, let me know, and I can elucidate further...

---
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/issues/393#issuecomment-71759440
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20150127/e9b36d0c/attachment.html>


More information about the mlpack-git mailing list