[mlpack-svn] [MLPACK] #357: error building mlpack

MLPACK Trac trac at coffeetalk-1.cc.gatech.edu
Mon Aug 4 11:31:26 EDT 2014


#357: error building mlpack
-----------------------+----------------------------------------------------
  Reporter:  ftrovato  |        Owner:     
      Type:  defect    |       Status:  new
  Priority:  major     |    Milestone:     
 Component:  mlpack    |   Resolution:     
  Keywords:            |     Blocking:     
Blocked By:            |  
-----------------------+----------------------------------------------------

Comment (by ftrovato):

 Hi again,
 I fixed the problem described above.
 The solution that likely worked for me was to uninstall and re-intall
 gfortran. After that I configured and built mlpack and running ldconfig -p
 | grep libgfortran I got:

 libgfortran.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-
 gnu/libgfortran.so.3
 libgfortran.so.3 (libc6) => /usr/lib/i386-linux-gnu/libgfortran.so.3

 and the library was correctly linked, thus solving my problem.

 ------------------------------------------------------------------------------

 However I am now facing a different problem:

 I tried to write a small .cpp program containing the example found in your
 documentation. The few program lines are listed here:

 #include <mlpack/core.hpp>
 using namespace mlpack;
 int main(int argc, char** argv)
 {
 CLI::ParseCommandLine(argc, argv);
 Log::Debug << "Compiled with debugging symbols." << std::endl;
 Log::Info << "Some test informational output." << std::endl;
 Log::Warn << "A warning!" << std::endl;
 Log::Fatal << "Program has crashed." << std::endl;
 Log::Warn

 1) I compiled the program with g++ mlapack_test.cpp and got the error
 below:

 In file included from /usr/local/include/mlpack/core.hpp:179:0,
                  from mlapack_test.cpp:1:
 /usr/local/include/mlpack/core/util/save_restore_utility.hpp:34:27: fatal
 error: libxml/parser.h: No such file or directory
  #include <libxml/parser.h>
                            ^
 compilation terminated.

 2) I solved the error in (1) with g++ -I/usr/include/libxml2/
 mlapack_test.cpp. Is there a way to avoid the explicit inclusion of
 libxml2/ where libxml is? Second, although error (1) was eliminated I got
 a new error:

 /tmp/ccUxXPUI.o: In function `main':
 mlapack_test.cpp:(.text+0x2e5): undefined reference to
 `mlpack::CLI::ParseCommandLine(int, char**)'
 mlapack_test.cpp:(.text+0x2ef): undefined reference to
 `mlpack::Log::Debug'
 mlapack_test.cpp:(.text+0x30b): undefined reference to `mlpack::Log::Info'
 mlapack_test.cpp:(.text+0x310): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(char const*)'
 mlapack_test.cpp:(.text+0x31d): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(std::ostream&
 (*)(std::ostream&))'
 mlapack_test.cpp:(.text+0x327): undefined reference to `mlpack::Log::Warn'
 mlapack_test.cpp:(.text+0x32c): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(char const*)'
 mlapack_test.cpp:(.text+0x339): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(std::ostream&
 (*)(std::ostream&))'
 mlapack_test.cpp:(.text+0x343): undefined reference to
 `mlpack::Log::Fatal'
 mlapack_test.cpp:(.text+0x348): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(char const*)'
 mlapack_test.cpp:(.text+0x355): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(std::ostream&
 (*)(std::ostream&))'
 mlapack_test.cpp:(.text+0x35f): undefined reference to `mlpack::Log::Warn'
 mlapack_test.cpp:(.text+0x364): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(char const*)'
 mlapack_test.cpp:(.text+0x371): undefined reference to
 `mlpack::util::PrefixedOutStream::operator<<(std::ostream&
 (*)(std::ostream&))'
 /tmp/ccUxXPUI.o: In function
 `__static_initialization_and_destruction_0(int, int)':
 mlapack_test.cpp:(.text+0xd28): undefined reference to
 `mlpack::util::CLIDeleter::CLIDeleter()'
 mlapack_test.cpp:(.text+0xd37): undefined reference to
 `mlpack::util::CLIDeleter::~CLIDeleter()'
 collect2: error: ld returned 1 exit status

 I guess that something is wrong with some libraries.
 mlpack was installed with sudo, so the binaries are in /usr/local/bin/.
 Since the lib path is ~/mlpack-1.0.9/build/lib, I also defined
 LD_LIBRARY_PATH=~/mlpack-1.0.9/build/lib in order to be able to run the
 executables (actually I tried pca --help, and it worked with
 LD_LIBRARY_PATH defined this way).

 I do not have a clue on what is going on. Can you help me solving this
 problem? I am surely missing something important that could potentially
 affect also the future programs I intend to write using mlpack library.

 Thanks you,
 Fabio

-- 
Ticket URL: <http://trac.research.cc.gatech.edu/fastlab/ticket/357#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