[R-pkg-devel] Rcpp with clang++ -stdlib=libc++ ?

Dr. Jens Oehlschlägel jen@@oeh|@ch|@ege| @end|ng |rom truec|u@ter@com
Fri Sep 11 21:00:56 CEST 2020

I can compile a package under clang++ with -stdlib=libstdc++, but with -stdlib=libc++ I get

In file included from /home/jo/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include/Rcpp/r/headers.h:67:
/home/jo/R/x86_64-pc-linux-gnu-library/4.0/Rcpp/include/Rcpp/platform/compiler.h:100:10: fatal error: 'cmath' file not found
#include <cmath>
1 error generated.

Is there any howto for using Rcpp with -stdlib=libc++ ?
Greetings from Munich

Jens Oehlschlägel


Package Makevars
PKG_CXXFLAGS=-O3 -march=native -pthread
PKG_LIBS=-latomic -pthread

CXX17 = clang++ -stdlib=libc++
CXX17FLAGS = -fstack-protector-strong -D_FORTIFY_SOURCE=2 -g $(LTO)
CXX17STD = -std=c++17

> packageVersion("Rcpp")
[1] ‘1.0.5’

> version
platform       x86_64-pc-linux-gnu        
arch           x86_64                     
os             linux-gnu                  
system         x86_64, linux-gnu          
major          4                          
minor          0.2                        
year           2020                       
month          06                         
day            22                         
svn rev        78730                      
language       R                          
version.string R version 4.0.2 (2020-06-22)
nickname       Taking Off Again

More information about the R-package-devel mailing list