根据Linux和macOS:Debian机器(ubuntu-16.04)上Armadillo的安装指南,我正在尝试安装armadillo库,并在执行命令后: $ cmake。 句点与“ cmake”之间用空格隔开很重要。 我执行了命令:$ make(也尝试使用root特权),引发了以下错误。
piyush@ubuntu:~/armadillo$ sudo make
Scanning dependencies of target armadillo
[ 33%] Building CXX object CMakeFiles/armadillo.dir/src/wrapper1.cpp.o
[ 66%] Building CXX object CMakeFiles/armadillo.dir/src/wrapper2.cpp.o
[100%] Linking CXX shared library libarmadillo.so
/usr/bin/ld: /usr/local/lib/libsuperlu.a(util.c.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libsuperlu.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
CMakeFiles/armadillo.dir/build.make:123: recipe for target 'libarmadillo.so.9.800.2' failed
make[2]: *** [libarmadillo.so.9.800.2] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/armadillo.dir/all' failed
make[1]: *** [CMakeFiles/armadillo.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2
答案 0 :(得分:0)
该库在Ubuntu中可用。随便
sudo apt install libarmadillo-dev
P.S。永远不要运行sudo make
,这是非常糟糕的做法。