Arun Veeramani
Arun Veeramani

Reputation: 79

Error while installing "nloptr_1.0.4.tar.gz" from local

When i tried to install nloptr_1.0.4.tar.gz from local, It needed another unix library nlopt-2.4.2.tar.gz which I got it resolved from the following thread Error while installing a tar.gz package in R
But, even after that the package is not getting installed
It throws the following error,

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
  unable to load shared object '/home/cloudera/R/x86_64-redhat-linux-gnu-library/3.2/nloptr/libs/nloptr.so':
  /home/cloudera/R/x86_64-redhat-linux-gnu-library/3.2/nloptr/libs/nloptr.so: undefined symbol: nlopt_set_maxtime
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/cloudera/R/x86_64-redhat-linux-gnu-library/3.2/nloptr’

For the above error, I got a lead from the following link:
https://cran.r-project.org/web/packages/ROracle/INSTALL and
http://ab-initio.mit.edu/wiki/index.php/NLopt_Installation

Based on the above links, I had to set LD_LIBRARY_PATH variable to /usr/local/lib and /usr/local/include
Even after setting the above Environment variable, R CMD INSTALL nloptr_1.0.4.tar.gz is not getting installed and throwing the same error.

Upvotes: 0

Views: 477

Answers (1)

Dirk is no longer here
Dirk is no longer here

Reputation: 368409

The fix is easy. On a Debian/Ubuntu system do

sudo apt-get install libnlopt-dev

as you always need the development package to compile a given library. It will then be found, and nloptr will install without a hitch.

Similarly on a RH/FC/CentOS with rpms.

Now, when I helped Jelmer rewrite the configuration for nloptr, we did make sure it worked both ways: with an install nlopt library, and without. You seem to stuck in the middle with one that is installed, but different ("missing symbol"). If you cannot uninstall that 'wrong' libnlopt, I would recommend altering the nloptr sources to not check for it but rather always build itself against a copy of nlopt 2.4.2 which it will download and compile statically.

Upvotes: 1

Related Questions