The error g++-7: command not found tells us R is using an unexpected command to build the package on your system. The typical command for building packages written in C++ on Linux systems is g++, without the trailing -7.
On our system, we found that this error is caused by a line in an unexpected file. The file is ~/.R/Makevars and contains the following line.
CXX17 = g++-7 -std=gnu++17 -fPIC
The line causes the build tool make to use the g++-7 executable instead of the typical g++ whenever C++17 is being compiled. The g++-7 executable doesn't exist on our system, hence the error command not found.
Resolution
To resolve the issue, delete the unexpected file using rm ~/.R/Makevars.
Resources used to troubleshoot the originating issue
What would you like to see added?
Description
The error
g++-7: command not found
tells us R is using an unexpected command to build the package on your system. The typical command for building packages written in C++ on Linux systems isg++
, without the trailing-7
.On our system, we found that this error is caused by a line in an unexpected file. The file is
~/.R/Makevars
and contains the following line.The line causes the build tool
make
to use theg++-7
executable instead of the typicalg++
whenever C++17 is being compiled. Theg++-7
executable doesn't exist on our system, hence the errorcommand not found
.Resolution
To resolve the issue, delete the unexpected file using
rm ~/.R/Makevars
.Resources used to troubleshoot the originating issue