[R-pkg-devel] CMake on CRAN Systems

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Wed Jan 17 23:23:39 CET 2024


I had a quick look and that package (assuming it's https://github.com/stsds/MPCR) does not adhere to any rules from R-exts (hence the removal from CRAN I presume) so the failure to detect cmake is the least problem. I would strongly recommend reading the  R documentation as cmake is just the wrong tool for the job in this case. R already has a fully working build system which will compile the package using the correct flags and tools - you only need to provide the C++ sources. You cannot generate the package shared object with cmake by definition - you must let R build it. [In rare case dependent static libraries are sometimes built with cmake inside the package if there is no other option and cmake is used upstream, but those are rare and you still have to use R to build the final shared object].

Cheers,
Simon


> On Jan 17, 2024, at 8:54 PM, Ivan Krylov via R-package-devel <r-package-devel using r-project.org> wrote:
> 
> Dear Sameh,
> 
> Regarding your question about the MPCR package and the use of CMake
> <https://cran-archive.r-project.org/web/checks/2024/2024-01-12_check_results_MPCR.html>:
> on a Mac, you have to look for the cmake executable in more than one
> place because it is not guaranteed to be on the $PATH. As described in
> Writing R Extensions
> <https://cran.r-project.org/doc/manuals/R-exts.html#Using-cmake>, the
> following is one way to work around the problem:
> 
> if test -z "$CMAKE"; then CMAKE="`which cmake`"; fi
> if test -z "$CMAKE"; then
> CMAKE=/Applications/CMake.app/Contents/bin/cmake;
> fi
> if test -f "$CMAKE"; then echo "no ‘cmake’ command found"; exit 1; fi
> 
> Please don't reply to existing threads when starting a new topic on
> mailing lists. Your message had a mangled link that went to
> urldefense.com instead of cran-archive.r-project.org, letting Amazon
> (who host the website) know about every visit to the link:
> https://stat.ethz.ch/pipermail/r-package-devel/2024q1/010328.html
> 
> -- 
> Best regards,
> Ivan
> 
> ______________________________________________
> R-package-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-package-devel
> 



More information about the R-package-devel mailing list