Derzeit versuche ich zu installierenmlpackauf Ubuntu 12.04. Als ich es ausführte make install
, erhielt ich den folgenden Fehler.
[ 0%] Built target mlpack_headers
Linking CXX shared library ../../lib/libmlpack.so
/usr/bin/ld: /usr/local/lib/libboost_program_options.a(cmdline.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libboost_program_options.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/libmlpack.so.1.0] Error 1
make[1]: *** [src/mlpack/CMakeFiles/mlpack.dir/all] Error 2
make: *** [all] Error 2
Wie kann ich diesen Fehler beheben und mlpack erfolgreich installieren?
Antwort1
Ich hatte das gleiche Problem. Ich habe alle Abhängigkeiten neu installiert mit
sudo apt-get install libboost-math-dev libboost-program-options-dev libboost-random-dev
libboost-test-dev libxml2-dev liblapack-dev libblas-dev libarmadillo-dev
Führen Sie im Ordner „mlpack“ den folgenden Befehl aus
mkdir build
cd build
cmake ../
makes
sudo make install
Um anschließend ausführbare Dateien auszuführen, legen Sie den Pfad mit diesem festVerknüpfung... Hat bei mir funktioniert.
Antwort2
kompiliere deinen Boost neu mit -fPIC, zB ./bjamcxxflags=-fPIC--without-python --without-graph_parallel --without-graph --without-wave installieren