AndriSignorell/DescTools

Compiler issue

elia427 opened this issue · 3 comments

Hi,

How can i solve this? Thanks.

`
remotes::install_github("AndriSignorell/DescTools")

  • installing source package 'DescTools' ...
    ** using staged installation
    ** libs
    using C compiler: 'gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)'
    using Fortran compiler: 'GNU Fortran (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)'
    using C++ compiler: 'g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)'
    gcc -std=gnu11 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I'/opt/R/4.3.1/lib/R/library/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c ADinf.c -o ADinf.o
    gcc -std=gnu11 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I'/opt/R/4.3.1/lib/R/library/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c AnDarl.c -o AnDarl.o
    g++ -std=gnu++11 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I'/opt/R/4.3.1/lib/R/library/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
    g++ -std=gnu++11 -I"/opt/R/4.3.1/lib/R/include" -DNDEBUG -I'/opt/R/4.3.1/lib/R/library/Rcpp/include' -I/usr/local/include -fpic -g -O2 -c aux_fct.cpp -o aux_fct.o
    aux_fct.cpp: In function 'long long int compute_LCM(long long int, long long int)':
    aux_fct.cpp:48:10: error: 'lcm' is not a member of 'std'
    std::lcm(a,b);
    ^~~
    aux_fct.cpp: In function 'long long int compute_GCD(long long int, long long int)':
    aux_fct.cpp:54:10: error: 'gcd' is not a member of 'std'
    std::gcd(a,b);
    ^~~
    aux_fct.cpp:54:10: note: suggested alternative: '__gcd'
    std::gcd(a,b);
    ^~~
    __gcd
    make: *** [aux_fct.o] Error 1
    ERROR: compilation failed for package 'DescTools'
  • removing '/opt/R/4.3.1/lib/R/library/DescTools'
    Warning message:
    In i.p(...) :
    installation of package '/home/work/Rtmp6GUhTd/file23e0a17cb65e1/DescTools_0.99.51.tar.gz' had non-zero exit status`

I found the solution here #128

Make sure to use the right C++ standard by adding the following line the the DESCRIPTION file:

SystemRequirements: C++17

Done so, all error messages on CRAN are gone.
Thanks for the hint!