Trying to install Rfast in RStudio 4.2.1, C++17 error

Hi all
I am very new here so I hope you will bear with me.

I am trying to install the Rfast package in RStudio server 4.2.1 on Amazon Linux 2 CentOS 7, but I get the error
Error: C++17 standard requested but CXX17 is not defined

I can see my version of gcc is 7.3.1, which i believe was installed together with RStudio as a dependency.

Anyone know how i can resolve this?
Should I install gcc10 before I install R and RStudio server?

Thank you all in advance
Best regards

The error message you're seeing is indicating that your version of GCC (7.3.1) does not support C++17, which is a requirement for the Rfast package. You will need to update your GCC version to a version that supports C++17. One way to do this is to use the package manager on your system (e.g. yum or apt) to update GCC. For example, on Amazon Linux 2 you can use the following command:

sudo yum install -y gcc-c++

Another way is to install a more recent version of GCC from source using the following command:

wget https://ftp.gnu.org/gnu/gcc/gcc-10.2.0/gcc-10.2.0.tar.gz
tar -xvf gcc-10.2.0.tar.gz
cd gcc-10.2.0
./contrib/download_prerequisites
./configure --enable-languages=c,c++
make
sudo make install

After updating GCC, you should be able to install Rfast package without any issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.