简体   繁体   中英

Installation of package ‘rgl’ had non-zero exit status

I'm running R in Centos 6. I needed to remove some packages in R. After doing so and trying to reinstall, I was told that the rgl package needed to be installed. Now when I try to install it, I get the following error.

install.packages("rgl")
Installing package into ‘/usr/lib64/R/library’
(as ‘lib’ is unspecified)
also installing the dependencies ‘sourcetools’, ‘shiny’

trying URL 'http://cran.rstudio.com/src/contrib/sourcetools_0.1.2.tar.gz'
Content type 'application/x-gzip' length 16227 bytes (15 KB)
==================================================
downloaded 15 KB

trying URL 'http://cran.rstudio.com/src/contrib/shiny_0.14.tar.gz'
Content type 'application/x-gzip' length 2110934 bytes (2.0 MB)
==================================================
downloaded 2.0 MB

trying URL 'http://cran.rstudio.com/src/contrib/rgl_0.96.0.tar.gz'
Content type 'application/x-gzip' length 2489778 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

* installing *source* package ‘sourcetools’ ...
** package ‘sourcetools’ successfully unpacked and MD5 sums checked
** libs
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I../inst/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Reader.cpp -o Reader.o
g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I../inst/include -I/usr/local/include    -fpic  -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c Tokenizer.cpp -o Tokenizer.o
In file included from ../inst/include/sourcetools/cursor/TokenCursor.h:7,
                 from ../inst/include/sourcetools/cursor/cursor.h:5,
                 from ../inst/include/sourcetools.h:11,
                 from Tokenizer.cpp:1:
../inst/include/sourcetools/tokenization/Token.h: In constructor ‘sourcetools::tokens::Token::Token()’:
../inst/include/sourcetools/tokenization/Token.h:27: error: ‘nullptr’ was not declared in this scope
../inst/include/sourcetools/tokenization/Token.h: In constructor ‘sourcetools::tokens::Token::Token(sourcetools::tokens::TokenType)’:
../inst/include/sourcetools/tokenization/Token.h:34: error: ‘nullptr’ was not declared in this scope
../inst/include/sourcetools/tokenization/Token.h: In constructor ‘sourcetools::tokens::Token::Token(const sourcetools::tokens::Token::Position&)’:
../inst/include/sourcetools/tokenization/Token.h:41: error: ‘nullptr’ was not declared in this scope
../inst/include/sourcetools/tokenization/Token.h: In function ‘std::ostream& sourcetools::operator<<(std::ostream&, const std::vector<sourcetools::tokens::Token, std::allocator<sourcetools::tokens::Token> >&)’:
../inst/include/sourcetools/tokenization/Token.h:457: error: expected initializer before ‘:’ token
../inst/include/sourcetools/tokenization/Token.h:459: error: expected primary-expression before ‘return’
../inst/include/sourcetools/tokenization/Token.h:459: error: expected ‘;’ before ‘return’
../inst/include/sourcetools/tokenization/Token.h:459: error: expected primary-expression before ‘return’
../inst/include/sourcetools/tokenization/Token.h:459: error: expected ‘)’ before ‘return’
In file included from ../inst/include/sourcetools/cursor/cursor.h:5,
                 from ../inst/include/sourcetools.h:11,
                 from Tokenizer.cpp:1:
../inst/include/sourcetools/cursor/TokenCursor.h: In member function ‘bool sourcetools::cursors::TokenCursor::moveToPosition(const sourcetools::cursors::TokenCursor::Position&)’:
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘[’ token
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘]’ token
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘const’
../inst/include/sourcetools/cursor/TokenCursor.h:167: error: expected primary-expression before ‘const’
make: *** [Tokenizer.o] Error 1
ERROR: compilation failed for package ‘sourcetools’
* removing ‘/usr/lib64/R/library/sourcetools’
Warning in install.packages :
  installation of package ‘sourcetools’ had non-zero exit status
ERROR: dependency ‘sourcetools’ is not available for package ‘shiny’
* removing ‘/usr/lib64/R/library/shiny’
Warning in install.packages :
  installation of package ‘shiny’ had non-zero exit status
ERROR: dependency ‘shiny’ is not available for package ‘rgl’
* removing ‘/usr/lib64/R/library/rgl’
Warning in install.packages :
  installation of package ‘rgl’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpdNMaV6/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

I've followed the advice on a similar question, and tried to reinstall the following

sudo yum install mesa-libGL mesa-libGL-devel mesa-libGLU mesa-libGLU-devel
sudo yum groupinstall X11

This has had no effect though. Indeed, I didn't think it would have, as there is nothing in my error message about missing libraries that I can see (the other inter-dependent R libraries aside, which I've already tried to install separately).

The error is coming when trying to install sourcetools , a package used by shiny , which rgl uses. But you're not installing the latest sourcetools , which is version 0.1.5, a very recent update. I'd suggest you try again now, and you'll probably see a different result.

If that's not it, you might be using an old version of R or some package that is forcing older package versions. You could try updating to the current R release and updating all your packages.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM