2016-07-12 12 views
7

लिनक्स (उबंटू 14.04.4 एलटीएस) पर nloptr पैकेज स्थापित करने में सहायता के लिए एक और रोना। मैंने कई प्रश्नों को देखा लेकिन इसके लिए समाधान खोजने का प्रबंधन नहीं किया।लिनक्स पर nloptr स्थापित करना - घातक त्रुटि: nlopt.h: ऐसी कोई फ़ाइल या निर्देशिका

मैं nloptr की स्थापना के रूप में गैर-शून्य निकास स्थिति के रूप में आर (संस्करण 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 एलटीएस – user1442363

+0

क्या आप /tmp/Rtmp7A1ldT/R.INSTALL66fffc391ed/nloptr/nlopt-2.4.2/include में कुछ भी ढूंढ सकते हैं, या इंस्टॉल प्रक्रिया विफल होने के बाद temp फ़ाइलों को हटा दिया गया? –

उत्तर

10

जब जेल्मर और मैंने इस सेटअप को बनाया तो यह सिर्फ मेरी उबंटू मशीनों पर काम करता था, और ऐसा करने के लिए जारी रहता है - या तो nlopt के डाउनलोड और निर्माण के साथ, या सिस्टम लाइब्रेरी के माध्यम से।

जैसा कि आप उबंटू पर हैं, आपके लिए सबसे आसान फिक्स शायद सिस्टम nlopt लाइब्रेरी स्थापित करने के लिए है, जो nloptr पैकेज का पता लगाएगा और उपयोग करेगा। तो

sudo apt-get install libnlopt-dev 

और फिर nlopt को फिर से स्थापित करने का प्रयास करें।

इसी तरह, आप क्रैन पर README for Ubuntu में वर्णित के रूप r-cran-lme4 माइकल Rutter द्वारा उचित PPAs से के रूप में lme4 प्राप्त करने में सक्षम होना चाहिए।

+0

मैं आर 3.4.0 में 'कैरेट्स' पैकेज स्थापित करने का प्रयास कर रहा था, लेकिन स्थापना को पूरा करने में सक्षम नहीं था क्योंकि 'nloptr' मुझे एक त्रुटि दे रहा था। इस समाधान की कोशिश करने के बाद, यह काम किया !! –

संबंधित मुद्दे