簡體   English   中英

無法在沒有root權限的群集上安裝nloptr / nlopt

[英]Unable to install nloptr / nlopt on a cluster without root rights

我正在嘗試安裝(在基於Linux的集群上)R包FactoMineR,它需要nloptr,而后者又需要nlopt。 只使用install.packages("nloptr")不起作用,並產生以下錯誤:

> install.packages("nloptr")
Installing package into ‘/beegfs/group/home/username/.R/3.3.2/R_LIBS_USER’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/src/contrib/nloptr_1.0.4.tar.gz'
Content type 'application/x-gzip' length 353957 bytes (345 KB)
==================================================
downloaded 345 KB

* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no
configure: Need to download and build NLopt
trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Error in download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz",  : 
  cannot open URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Execution halted
/usr/bin/gtar: This does not look like a tar archive

gzip: stdin: unexpected end of file
/usr/bin/gtar: Child returned status 1
/usr/bin/gtar: Error is not recoverable: exiting now
Warning message:
In untar(tarfile = "nlopt-2.4.2.tar.gz") :
  '/usr/bin/gtar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2
configure: Starting to install library to /tmp/RtmpazbyAy/R.INSTALL2d6f734a93606/nloptr/nlopt-2.4.2
./configure: line 3325: cd: nlopt-2.4.2: No such file or directory

此時R凍結並且必須重新啟動。 因此,我嘗試手動安裝nlopt並遵循官方網站上的指南。 我在家庭文件夾中安裝了所有內容,因為我對群集沒有root權限。 nloptr安裝仍然失敗,同樣的錯誤是找不到nlopt。 這個問題似乎是一樣的,但使用

install.packages('nloptr', dependencies = TRUE, 
                 configure.args = "--with-nlopt-cflags='-I/$HOME/include' --with-nlopt-libs='-L/$HOME/lib64 -lnlopt'")

仍然會產生相同的錯誤。
$HOME/include文件夾包含以下文件: nlopt.f nlopt.h nlopt.hpp$HOME/lib64包含以下內容: cmake/ libnlopt.so@ libnlopt.so.0@ libnlopt.so.0.9.0* pkgconfig/ python2.7/

我已經多次重試,在相關問題上使用了其他一些技巧,但到目前為止沒有任何工作,任何提示都會受到高度贊賞。 謝謝!

編輯:有沒有人有想法?

這個問題可能有點舊,但我想澄清一下以后的參考資料。

轉移使用packrat創建的項目時遇到同樣的問題,在公司集群中執行nloptr unbundle()時我看到我需要安裝包nloptr ,正如你所提到的那樣它只是nlopt一個接口圖書館。

“NLopt是一個用於非線性局部和全局優化的庫,用於包含和不包含梯度信息的函數。”

該庫是在系統中安裝它所必需的,為此必須具有root權限。 否則,在安裝nloptr時會出現錯誤消息,或者您將無法完成安裝並停留在阻止R / Rstudio會話的那個階段。

我不知道是否有可能在“本地”為用戶安裝該庫,並使用它來安裝nloptr或任何其他依賴它的包。

我看到的唯一解決方案是您應該聯系IT經理並要求他安裝它。

我希望我已經清楚並能夠幫助一點。

如果你不能使用install.packages(“nloptr”)在Cluster中安裝R包,我建議2種值得嘗試的方法。

  1. 在本地安裝該軟件包

    • 首先加載要安裝包的R版本的模塊;
    • 下載軟件包“nloptr_1.0.4.tar.gz”並將其保存到VSC目錄中;
    • 接下來,確保您位於包含該包的目錄中;
    • 最后,運行命令R CMD install nloptr_1.0.4.tar.gz(在R外運行)
  2. 嘗試通過運行命令直接加載NLopt模塊:模塊加載Nlopt / 2.4.2-foss-2015a通常它會工作,否則你必須聯系技術人員來幫助你用C ++構建它。

我看到了類似的錯誤,但安裝github版本對我有用。

https://cran.r-project.org/web/packages/nloptr/README.html上的自述文件說:

library(devtools)
devtools::install_github("jyypma/nloptr")

這對我有用。 我確實在本地安裝了nlopt作為模塊,但我不知道這是否有所作為; 我安裝的nlopt版本是2.5.0。

希望這很有用!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM