In my experience, it is best not to set CMAKE_C_COMPILER and CMAKE_CXX_COMPILER when calling cmake. R's config can include arguments in its compiler commands, and CMake does a good job figuring things out using the CC and CXX environmental variables that R sets.
It's definitely smarter than I was when I tried to do it manually. See below for the example from one of my packages. https://github.com/reedacartwright/rbedrock/blob/main/configure On Fri, Jun 20, 2025, 14:33 Tyler <tyle...@gmail.com> wrote: > Hi all, > > I have several packages (libopenexr/libimath/libdeflate) that use > CMake on the CRAN that have recently been taken down for failing to > compile on the extratest “blackswan” server. As part of the configure > script, these packages pull the compiler `CC` and `CXX` variables to > build a static library. The failure is occurring because the > “blackswan” server is apparently using ccache in some sort of > non-standard way: grepping the output of `R CMD config CC` in my > configure script to detect ccache does not work, which leads me to > believe there may be an custom alias set up on the server for invoking > a compiler cache tool. You can see the failure logs here: > > https://www.stats.ox.ac.uk/pub/bdr/donttest/libdeflate.log > > And my configure script here : > > > https://github.com/tylermorganwall/libdeflate/blob/main/tools/config/configure.R > > Note that I've excluded the possibility of whitespace being the issue > as CC is pulling `/usr/bin/ccache` and not an empty string. The only > remaining reason for the failure I can think of is a custom alias. I > have a workaround written and ready to be deployed if that’s indeed > the case, but I don’t want to attempt a fix without confirming the > root cause. > > Can someone with access to the blackswan server please provide the > Makeconf configuration file or at the very least, clarify how ccache > is invoked? > > Best regards, > Tyler Morgan-Wall > > ______________________________________________ > R-package-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-package-devel > [[alternative HTML version deleted]] ______________________________________________ R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel