2017-08-23 2 views
0

Ich versuche, Rcpp auf Ubuntu zu installieren. Hier sind einige Umwelt-Details:RcppArmadillo: Fehler bei der Installation auf Ubuntu16.04

R version:3.4.0 
g++ --version: Ubuntu 5.4.0-6ubuntu1~16.04.4 

Wenn ich eine leere Makevars Datei, RcppArmadillo installiert werden kann, aber mit einigen Warnungen über OpenMP

g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o 
In file included from ../inst/include/armadillo:52:0, 
       from ../inst/include/RcppArmadilloForward.h:46, 
       from ../inst/include/RcppArmadillo.h:31, 
       from RcppArmadillo.cpp:22: 
../inst/include/armadillo_bits/compiler_setup.hpp:487:118: note: #pragma message: WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags 
    #pragma message ("WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags") 
                                ^
g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppExports.cpp -o RcppExports.o 
In file included from ../inst/include/armadillo:52:0, 
       from ../inst/include/RcppArmadilloForward.h:46, 
       from ../inst/include/RcppArmadillo.h:31, 
       from RcppExports.cpp:4: 
../inst/include/armadillo_bits/compiler_setup.hpp:487:118: note: #pragma message: WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags 
    #pragma message ("WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags") 
                                ^
g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fastLm.cpp -o fastLm.o 
In file included from ../inst/include/armadillo:52:0, 
       from ../inst/include/RcppArmadilloForward.h:46, 
       from ../inst/include/RcppArmadillo.h:31, 
       from fastLm.cpp:22: 
../inst/include/armadillo_bits/compiler_setup.hpp:487:118: note: #pragma message: WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags 
    #pragma message ("WARNING: support for OpenMP requires C++11/C++14; add -std=c++11 or -std=c++14 to compiler flags") 
                                ^
g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -fopenmp -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR 
installing to /home/march/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/libs 
** R 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (RcppArmadillo) 

Nachdem ich PKG_CXXFLAGS=-std=c++11-Makevars hinzugefügt, bekam ich eine Fehlermeldung wie folgend:

g++ -I/usr/share/R/include -DNDEBUG -I"/home/march/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -std=c++11 -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c RcppArmadillo.cpp -o RcppArmadillo.o 
RcppArmadillo.cpp:22:27: fatal error: RcppArmadillo.h: No such file or directory 
compilation terminated. 
/usr/lib/R/etc/Makeconf:168: recipe for target 'RcppArmadillo.o' failed 
make: *** [RcppArmadillo.o] Error 1 
ERROR: compilation failed for package ‘RcppArmadillo’ 
* removing ‘/home/march/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo’ 
* restoring previous ‘/home/march/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo’ 
Warning in install.packages : 
    installation of package ‘RcppArmadillo’ had non-zero exit status 

die wield Sache ist, dass, wenn ich versuche RcppArmadillo auf meinem mac (10.11), die gleiche probl neu installieren em ist aufgetreten. Könnte mich jemand aufklären?

+0

Sie wissen, Ubuntu ist das Betriebssystem, das ich am meisten meiner Entwicklung (und Arbeit) mache, so kann ich Ihnen ziemlich versichern, dass jede Version von RcppArmadillo, die jemals veröffentlicht wurde, arbeitete .... –

+1

Verwenden Sie stattdessen 'CXX_STD = CXX11' von 'PKG_CXXFLAGS = -std = C++ 11' in' ~/.R/Makevars'. – coatless

+0

Auch "sudo apt-get installieren r-cran-rcpparmadillo" erhalten Sie auch eine Version, entweder leicht aus der Distribution, oder meist aktuell aus Michael's Repos (siehe [README bei CRAN für mehr] (http: // cloud .r-project.org/bin/linux/ubuntu)) so baut es sich eindeutig auf. –

Antwort

0

Dies ist 16.10, die ich hier bei Hone haben, wenn Sie es wünschen ich morgen wiederholen kann es bei der Arbeit mit 16,04:

[email protected]:~$ lsb_release -a 
No LSB modules are available. 
Distributor ID: Ubuntu 
Description: Ubuntu 16.10 
Release: 16.10 
Codename: yakkety 
[email protected]:~$ Rscript -e 'install.packages("RcppArmadillo")' 
Installing package into ‘/usr/local/lib/R/site-library’ 
(as ‘lib’ is unspecified) 
trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.7.960.1.1.tar.gz' 
Content type 'application/x-gzip' length 1115539 bytes (1.1 MB) 
================================================== 
downloaded 1.1 MB 

* installing *source* package ‘RcppArmadillo’ ... 
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked 
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 ccache g++ accepts -g... yes 
checking how to run the C++ preprocessor... ccache g++ -E 
checking whether we are using the GNU C++ compiler... (cached) yes 
checking whether ccache g++ accepts -g... (cached) yes 
checking whether g++ version is sufficient... (6.2.0) yes 
checking LAPACK_LIBS... system LAPACK found 
checking for OpenMP... found 
configure: creating ./config.status 
config.status: creating inst/include/RcppArmadilloLapack.h 
** libs 
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -Werror -march=native -c RcppArmadillo.cpp -o RcppArmadillo.o 
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -Werror -march=native -c RcppExports.cpp -o RcppExports.o 
ccache g++ -I/usr/share/R/include -DNDEBUG -I"/usr/local/lib/R/site-library/Rcpp/include" -I../inst/include -fopenmp -fpic -g -O3 -Wall -pipe -Wno-unused -pedantic -Werror -march=native -c fastLm.cpp -o fastLm.o 
ccache g++ -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -fopenmp -llapack -lblas -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR 
installing to /usr/local/lib/R/site-library/RcppArmadillo/libs 
** R 
** inst 
** preparing package for lazy loading 
** help 
*** installing help indices 
** building package indices 
** installing vignettes 
** testing if installed package can be loaded 
* DONE (RcppArmadillo) 

The downloaded source packages are in 
    ‘/tmp/Rtmp2hQNrn/downloaded_packages’ 
[email protected]:~$ 

Dass ich usee ccache nicht wesentlich ist. Dies. Gerade. Funktioniert.

+0

Danke, mein Herr. Ich denke, ich kann mit meinem ersten Versuch leben, da es funktioniert :) –

+0

Ich habe gerade überprüft, und unter _Ubuntu 16.04_ bekomme ich die gleichen Warnungen wie g ++ 5. * verwendet. Unter der aktuellen _Ubuntu 17.04_ (die ich verwende) Sie _not_ bekommen die warnigs wie g ++ 6. * schaltet automatisch C++ 11. Wir haben davon Abstand genommen, C++ 11 durchzusetzen, um nicht noch mehr Einschränkungen für verwendbare Systeme zu schaffen. –

+0

Fühlen Sie sich auch frei, die Antwort zu "akzeptieren" (klicken Sie auf das Tick-Symbol, das Sie nur sehen, wenn Sie die Frage gestellt haben) und/oder "upvote" (klicken Sie auf den Pfeil nach oben). So funktioniert StackOverflow :) –