2016-07-12 6 views
7

nloptr 패키지를 Linux (Ubuntu 14.04.4 LTS)에 설치하는 데 도움이 필요합니다. 나는 많은 질문을 보았지만 이것을위한 해결책을 찾을 수 없었다.Linux에서 nloptr 설치 - 치명적인 오류 : nlopt.h : 해당 파일 또는 디렉토리가 없음

설치의 nloptr의 종료 상태가 0이 아니므로 R (버전 3.3.1/Rstudio 버전 0.99.902)에 lme4 패키지를 설치할 수 없습니다. 내가

install.package("nloptr") 
을 때 나는 다음과 같은 얻을 :

Installing package into ‘/home/rd14/R/x86_64-pc-linux-gnu-library/3.3’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/src/contrib/nloptr_1.0.4.tar.gz' 
Content type 'unknown' length 353942 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... /bin/grep 
checking for egrep... /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' 
Content type 'application/x-gzip' length 2361992 bytes (2.3 MB) 
================================================== 
downloaded 2.3 MB 

configure: Starting to install library to /tmp/Rtmp7A1ldT/R.INSTALL66fffc391ed/nloptr/nlopt-2.4.2 
configure: Done installing library to /tmp/Rtmp7A1ldT/R.INSTALL66fffc391ed/nloptr/nlopt-2.4.2 
configure: creating ./config.status 
config.status: creating src/Makevars 
** libs 
g++ -I/usr/share/R/include -DNDEBUG  -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c dummy.cpp -o dummy.o 
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG  -I/tmp/Rtmp7A1ldT/R.INSTALL66fffc391ed/nloptr/nlopt-2.4.2/include -fpic -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g -c nloptr.c -o nloptr.o 
nloptr.c:42:19: fatal error: nlopt.h: No such file or directory 
#include "nlopt.h" 
       ^
compilation terminated. 
make: *** [nloptr.o] Error 1 
ERROR: compilation failed for package ‘nloptr’ 
* removing ‘/home/rd14/R/x86_64-pc-linux-gnu-library/3.3/nloptr’ 
Warning in install.packages : 
    installation of package ‘nloptr’ had non-zero exit status 

The downloaded source packages are in 
    ‘/tmp/Rtmp4Y3TXJ/downloaded_packages’ 
은 는

는 당신의 도움이 많이 감사합니다! 감사합니다.

+0

시스템이 무엇입니까? –

+0

우분투 14.04.4 LTS – user1442363

+0

/tmp/Rtmp7A1ldT/R.INSTALL66fffc391ed/nloptr/nlopt-2.4.2/include에있는 항목을 찾을 수 있습니까? 아니면 설치 프로세스가 실패한 후 임시 파일이 삭제 되었습니까? –

답변

10

Jelmer와 내가이 설정을 만들었을 때 우분투 컴퓨터에서만 작동했으며 다운로드 및 빌드가 nlopt이거나 시스템 라이브러리를 통해 계속 수행되었습니다.

우분투에서 가장 쉽게 해결할 수있는 것은 nloptr 패키지가 감지하여 사용하는 시스템 nlopt 라이브러리를 설치하는 것입니다. 그래야합니까

sudo apt-get install libnlopt-dev 

그리고 나서 nlopt를 다시 설치하십시오.

마찬가지로 CRAN의 README for Ubuntu에 설명 된대로 Michael Rutter가 적절한 PPA에서 r-cran-lme4으로 lme4을 가져올 수 있어야합니다.

+0

RETO에서'carets' 패키지를 설치하려했으나'nloptr'가 나에게 오류를주기 때문에 설치를 완료 할 수 없었습니다. 이 솔루션을 사용해 본 후 작동했습니다. –

관련 문제