在 ubuntu16.04 上生成 运行-time armadillo 库时出错

Error while generating the run-time armadillo library on ubuntu16.04

根据 Linux 和 macOS:犰狳在 Debian 机器上的安装指南(ubuntu-16.04) 我尝试安装犰狳库并在执行命令后:$cmake. 用 space 与 "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

此库在 Ubuntu 中可用。就这样

sudo apt install libarmadillo-dev

P.S。永远不要 运行 sudo make,这是一个非常糟糕的做法。