The configure tests are preformed using different compilers than the actual compilation yielding invalid results.
Example based on macOS R release:
$ R CMD config CXX
clang++ -mmacosx-version-min=10.13 -std=gnu++14
tiledb source installation:
* installing *source* package ‘tiledb’ ...
** using staged installation
checking for g++... g++
[...]
** libs
clang++ -mmacosx-version-min=10.13 -std=gnu++17 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I../inst/include/ -I../inst/tiledb/include -I'/Volumes/Builds/packages/high-sierra-x86_64/Rlib/4.1/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
configure fails to set CC and CXX correctly, see R-exts 1.2:
Packages written with C++ need to pick up the details for the C++ compiler and switch the current language to C++ by something like
CXX=`"${R_HOME}/bin/R" CMD config CXX`
if test -z "$CXX"; then
AC_MSG_ERROR([No C++ compiler is available])
fi
CXXFLAGS=`"${R_HOME}/bin/R" CMD config CXXFLAGS`
CPPFLAGS=`"${R_HOME}/bin/R" CMD config CPPFLAGS`
AC_LANG(C++)
The
configuretests are preformed using different compilers than the actual compilation yielding invalid results.Example based on macOS R release:
tiledb source installation:
configurefails to setCCandCXXcorrectly, see R-exts 1.2: