astamm / nloptr

nloptr provides an R interface to NLopt, a free/open-source library for nonlinear optimization providing a common interface to a number of different optimization routines which can handle nonlinear constraints and lower and upper bounds for the controls.
https://astamm.github.io/nloptr/
Other
106 stars 34 forks source link

ERROR on package install in MacOS 12.3.1 #116

Closed janikmiet closed 2 years ago

janikmiet commented 2 years ago

I have CMAKE installed but cannot install the package.

CMake Error: Error processing file: /private/var/folders/vj/7vyqwvq510722f81159tbcjc0000gn/T/Rtmpsm8cTN/R.INSTALLfd77502f60d1/nloptr/src/nlopthomeslice-build/cmake_install.cmake
cp: nlopt/include/*: No such file or directory

.....

ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
ld: warning: directory not found for option '-Lnlopt/lib'
ld: library not found for -lnlopt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [nloptr.so] Error 1
ERROR: compilation failed for package ‘nloptr’
* removing ‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/nloptr’
Warning in install.packages :
  installation of package ‘nloptr’ had non-zero exit status
astamm commented 2 years ago

Thanks for reaching out. A little more context would be helpful. It seems you're running on macOS. Do you have a system version of nlopt already installed ? Which version ? What is the version of cmake you are using ? What is the full log of the install process ? In particular, what do the lines written by pkg-config say?

janikmiet commented 2 years ago

Thank you for the answer. It seemed that system version of nlopt wasn't installed. Now I managed to finish package installation.

Initially the problem is trying to push Shiny image to ShinyApps.io and the application depends on nloptrpackage (more specifically ggpubr package depends on nloptr). Now I managed to install the package on local environment, but not yet to the Shinyapps.io (missing CMAKE on Shinyapps.io). But I quess this is not problem of the nloptr package itself, so I can close this issue.