Dear all, I would like to check for C++11 support in a package. The package requires gcc >= 4.7 or clang >= 3.0. Windows is handled differently in Makevars.win. I tried two approaches in Makevars so far, but both give warnings in CRAN checks.
Approach 1: ## Check for gcc >= 4.7 ifeq ($(shell basename $(CC)),gcc) GCC_VER := $(shell gcc -dumpversion) GCC_MAJOR := $(shell gcc -dumpversion | cut -f1-2 -d.) GCC_OK := $(shell echo $(GCC_MAJOR) \>= 4.7 | bc ) ifneq ($(GCC_OK),1) $(error Error: gcc >= 4.7 required, version $(GCC_VER) installed. Please update gcc.) endif endif Works quite well but a warning in check —as-cran: > Found the following file(s) containing GNU extensions: > src/Makevars > Portable Makefiles do not use GNU extensions such as +=, :=, $(shell), > $(wildcard), ifeq ... endif. See section ‘Writing portable packages’ in > the ‘Writing R Extensions’ manual. Approach 2: Use std=c++11 flag instead of CXX_STD = CXX11, which should work on gcc >=4.7 and throw an error on earlier versions. This time in check —as-cran: > Non-portable flags in variable 'PKG_CPPFLAGS': > -std=c++11 Any other ideas how to check? Or is one of the versions above OK on CRAN? Thanks, Marvin ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel