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.

Home Page:https://astamm.github.io/nloptr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

there is no package called ‘nloptr’

darlington1221 opened this issue · comments

I recently re-installed R and R studio to the most recent version. I am now unable to install nloptr, therefore I cannot run lme4. Any suggestions?

Can you please tell us

  • what operating system you are on
  • what CRAN mirror you use
  • whether you typically install source or binary packages on your platform.

As the CRAN package page for nloptr shows it is available everywhere but not yet at build 2.0.0 everywhere.

You can always try this: install.packages("nloptr", type="source", repos="https://cloud.r-project.org") to try a source installation using the cloud mirror (guaranteed to be 'close' to you irrespective of your location).

Thank you for your help.

I am using a maxOS version 11.4 operating system.
CRAN mirror: http://lib.stat.cmu.edu/R/CRAN/ | Statlib, Carnegie Mellon University, Pittsburgh, PA
I typically install source packages.
I tried the code you sent. I am getting the same error message.

This is the error I get when attempting to run lme4:

library(lme4)
Error: package or namespace load failed for ‘lme4’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘nloptr’

This is what I get when I try to install nloptr:
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 '-L/usr/local/gfortran/lib'
ld: library not found for -lgfortran
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

R suggested I download CMake, which I did. This did not fix the problem.

Sorry. Correction. I am using the "Global (CDN)" CRAN repository.

Ok -- you also lack libgfortran as is also shown. So you can either follow the guidelines for setting up a compilation environment for R on macOS, or just wait for CRAN to produce the binary for you. That usually takes only a few days. In the meantime you can use the previous binary -- you can download it by hand and point install.packages(pathtofile, repos=NULL) at it.

Thank you.