Installing nloptr on Linux

前端 未结 7 761
醉话见心
醉话见心 2021-02-01 03:52

I am trying to install the R package nloptr on a CentOS Linux machine that doesn\'t have internet connection as follows:

install.packages(\"/hom         


        
7条回答
  •  执笔经年
    2021-02-01 04:05

    I had exactly the same problem, on a production machine without direct Internet access, with Red Hat Enterprise Linux Server release 6.6 (Santiago). The fixups proposed above did not work: when installing the nlopt library on the system, the subsequent attempt to install nloptr fail with the "nlopt_set_maxtime" error. I tried to fiddle with compilation options for nlopt, to no avail. I even reproduced the problem on a Ubuntu machine with Internet connection: I uninstalled nloptr, installed nlopt on the system and then the nloptr installation failed.

    At last I solved the issue taking the following steps:

    1. Un-install nlopt from the operating system (make sure that it is thoroughly removed).
    2. Manually download nlopt-2.4.2.tar.gz and copy it to /tmp/
    3. Manually download nloptr_1.0.4.tar.gz to a work directory and unpack it; this creates the directory "nloptr/".
    4. Edit "nloptr/configure", comment out the row

      $("${R_HOME}/bin/Rscript" --vanilla -e "download.file(url='${NLOPT_URL}', destfile='${NLOPT_TGZ}')")

      and insert a new row:

      $("${R_HOME}/bin/Rscript" --vanilla -e "file.copy(from='/tmp/nlopt-2.4.2.tar.gz', to='${NLOPT_TGZ}')")

    5. Install with "R CMD INSTALL nloptr".

提交回复
热议问题