[R-pkg-devel] Please install cmake on macOS builders

Reed A. Cartwright r@c@rtwr|ght @end|ng |rom gm@||@com
Thu May 11 20:15:50 CEST 2023


Dirk,

I'm curious why you chose to call cmake from make instead of from
configure. I've always seen cmake as part of the configure step of package
building.

Thanks,
Reed


On Thu, May 11, 2023, 04:17 Dirk Eddelbuettel <edd using debian.org> wrote:

>
> On 11 May 2023 at 09:02, Martin Maechler wrote:
> | I've been told in private that the above "be happy if"
> | may *not* be a good idea,
> | or rather even close to impossible as   cmake  seems to not fit
> | well, at all, with the quite sophisticated
> |     autoconf -> configure -> make
> | setup we have with building R + recommended packages
> | cross-platform compatibly as well as possible.
>
> Yes, my bad -- it _is_ indeed in Writing R Extensions (albeit with an
> actual error, see below) so I now use what it recommended (in the form
> pointed out by Reed though) so for me it is
>
>     sh -> make -> cmake
>
> but could be autoconf too.
>
> I presume the macOS systems needs it for cross-compilation or other dances.
> Still annoying as hell.  A simple default may be better but I do not know
> any
> of the dragons running around inside macOS.
>
> Dirk
>
>
> Appendix: Actual Error in Writing R Extensions.
>
> Section 1.2.6 ends on these lines (r-release, and r-devel) I am quoting in
> full
>
>     One way to work around this is for the package’s ‘configure’ script to
>     include
>          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
>     and for the second approach to substitute ‘CMAKE’ into ‘src//Makevars’.
>
> The final 'test -f' has to be negated. Demo:
>
>     edd using rob:/tmp$ cat foo.sh
>     ##!/bin/sh
>     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
>     echo "** using $CMAKE"
>     edd using rob:/tmp$ ./foo.sh
>     no 'cmake' command found
>     edd using rob:/tmp$ which cmake
>     /usr/bin/cmake
>     edd using rob:/tmp$
>
> If I change foo.sh to use '! test -f' all is well
>
>     edd using rob:/tmp$ be foo.sh    # be is an alias for emacsclient in tty
> mode
>     edd using rob:/tmp$ ./foo.sh
>     ** using /usr/bin/cmake
>     edd using rob:/tmp$
>
> --
> dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org
>
> ______________________________________________
> R-package-devel using r-project.org mailing list
>
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-package-devel__;!!IKRxdwAv5BmarQ!cx5EOr8qi2w5dP-kdo90tRXU4I7VjWDeD19I3UQxXe1hCHor7wP-FBUn5gzg8PFkdlerFTrGD0uL$
>

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list