无法安装nloptr(R4.0.3,Ubuntu 20.04)

无法安装nloptr(R4.0.3,Ubuntu 20.04),r,R,我试图在R4.0.3上安装nloptr,但出现以下错误: /usr/bin/ld: /usr/local/lib/libnlopt.a(general.o): relocation R_X86_64_TPOFF32 against `nlopt_srand_called' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: /usr/local/lib/libnlopt.a(mt19937a

我试图在R4.0.3上安装nloptr,但出现以下错误:

/usr/bin/ld: /usr/local/lib/libnlopt.a(general.o): relocation R_X86_64_TPOFF32 against `nlopt_srand_called' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libnlopt.a(mt19937ar.o): relocation R_X86_64_TPOFF32 against `mti' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libnlopt.a(timer.o): relocation R_X86_64_TPOFF32 against `start_inited.4301' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
make: *** [/usr/share/R/share/make/shlib.mk:10: nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/home/giovanni/R/x86_64-pc-linux-gnu-library/4.0/nloptr’
Warning in install.packages :
  installation of package ‘nloptr’ had non-zero exit status
有人能告诉我一个解决办法吗

提前感谢。

libnlopt dev的最新(2.6.2)包在Ubuntu 20中被破坏,出于某种原因,它被编译到一个静态库中(.so shared object missing) 几天前我遇到了类似的问题。快速修复方法是从Github下载NLOPT并自己编译
至少,它对我有用。

非常感谢!