Unable to install tidysq on Centos 7

Hi am trying to install this paquage but have this error :slight_smile:

install.packages('tidysq')
trying URL 'https://mirrors.qlu.edu.cn/CRAN/src/contrib/tidysq_1.1.3.tar.gz'
Content type 'application/octet-stream' length 195054 bytes (190 KB)

downloaded 190 KB

  • installing source package ‘tidysq’ ...
    ** package ‘tidysq’ successfully unpacked and MD5 sums checked
    ** using staged installation
    ** libs
    Error: C++17 standard requested but CXX17 is not defined
  • removing ‘/opt/R/4.3.3/lib/R/library/tidysq’

The downloaded source packages are in
‘/tmp/RtmpsHQsGj/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("tidysq") :
installation of package ‘tidysq’ had non-zero exit status

This package requires a compiler that supports C++-17:

Which your compiler does not, it seems. I don't know if you can install a newer compiler on CentOS 7.

You will need a compiler with C++ 17 support CentOS/RHEL 7 does not offer that out of the box. If you are unable to upgrade to a less ancient OS, you can install a recent devtoolset, c.f. Chapter 1. Red Hat Developer Toolset Red Hat Developer Toolset 12 | Red Hat Customer Portal. You will also have to add entries like

CXX14 = g++
CXX14FLAGS = -g -O2 $(LTO)
CXX14PICFLAGS = -fpic
CXX14STD = -std=gnu++14
CXX17 = g++
CXX17FLAGS = -g -O2 $(LTO)
CXX17PICFLAGS = -fpic
CXX17STD = -std=gnu++17
CXX20 = g++
CXX20FLAGS = -g -O2 $(LTO)
CXX20PICFLAGS = -fpic
CXX20STD = -std=gnu++20

to $R_HOME/etc/Makevars.site.

1 Like

p3m.dev has a pre-compiled binary version available.

1 Like