You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmake detection appears to be broken for Linux builds #279
we are checking if CMAKE env variable is empty and then first set CMAKE to which cmake (appropriate for Linux envs) but in the next line we overwrite the same with the MacOS equivalent without checking if we are on MacOS or not.
It would be great to make those two checks work on both Linux and MacOS so that s2 can use Linux's cmake to build Abseil as a system dependency.
I'm curious what the error message is you're getting, since I've run this a fair bit on Linux forgetting to install cmake first. The last time this happened I remember getting a message telling me to install cmake...is there a situation where we aren't getting that message?
You are right that cmake was missing but I would not have expected it to try to use /Applications/CMake.app/Contents/bin/cmake instead as a fall-back - which then also fails.
The patch will make sure that /Applications/CMake.app/Contents/bin/cmake will only be used if the OS is Darwin while the output of which cmake will be used to detect cmake on Linux.
Full installation output:
* installing *source* package ‘s2’ ...
** package ‘s2’ successfully unpacked and MD5 sums checked
staged installation is only possible with locking
** using non-staged installation
Found OpenSSL pkg-config cflags and libs!
Testing compiler OpenSSL configuration using PKG_CFLAGS=
** Using PKG_CONFIG_PATH=:/tmp/Rtmp6E2yoY/R.INSTALL609e133db3bd/s2/tools/pkgconfig
** Building abseil-cpp using cmake
Warning message:
In readRenviron("~/.R/Makevars") :
file '/root/.R/Makevars' cannot be opened for reading
GNU Make 4.3
Built for x86_64-redhat-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Using MAKE=make
/usr/bin/which: no cmake in (/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin)
tools/build_absl.sh: line 24: /Applications/CMake.app/Contents/bin/cmake: No such file or directory
cmake not found
** CMake build of Abseil failed
** Abseil can be installed with:
** - apt-get install libabsl-dev
** - dnf install abseil-cpp-devel
** - brew install abseil
** If a system install of Abseil is not possible, cmake is required to build
** the internal vendored copy.
ERROR: configuration failed for package ‘s2’
* removing ‘/tmp/RtmpKlSMjh/pkg-lib60471d5bdd5/s2’
Type .Last.error to see the more details.
Ah, got it. The error telling you to install cmake does show up but it's confusing because /Applications/CMake.app/Contents/bin/cmake obviously doesn't exist on linux. The fix seems reasonable, I'll take a look!
I'm having a similar issue when I try to install s2:
> install.packages('s2')
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/s2_1.1.8.tar.gz'
Content type 'application/x-gzip' length 2966956 bytes (2.8 MB)
==================================================
downloaded 2.8 MB
* installing *source* package ‘s2’ ...
** this is package ‘s2’ version ‘1.1.8’
** package ‘s2’ successfully unpacked and MD5 sums checked
** using staged installation
Found OpenSSL pkg-config cflags and libs!
Testing compiler OpenSSL configuration using PKG_CFLAGS=
** Using PKG_CONFIG_PATH=:/tmp/RtmpipCUzL/R.INSTALL38119195ca694/s2/tools/pkgconfig
** Building abseil-cpp using cmake
Warning message:
In readRenviron("~/.R/Makevars") :
file '/root/.R/Makevars' cannot be opened for reading
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Using MAKE=make
tools/build_absl.sh: 24: /Applications/CMake.app/Contents/bin/cmake: not found
cmake not found
** CMake build of Abseil failed
** Abseil can be installed with:
** - apt-get install libabsl-dev
** - dnf install abseil-cpp-devel
** - brew install abseil
** If a system install of Abseil is not possible, cmake is required to build
** the internal vendored copy.
ERROR: configuration failed for package ‘s2’
* removing ‘/usr/local/lib/R/site-library/s2’
The downloaded source packages are in
‘/tmp/Rtmp08vdLY/downloaded_packages’
Warning message:
In install.packages("s2") :
installation of package ‘s2’ had non-zero exit status
I'm not sure if I should create a separate issue or not, but don't know how to resolve this.
@priyapatel1 same issue than mine - if you install cmake on your system the installation will succeed.
You can avoid installing cmake if you install the Abseil system requirement.
The error message kind of says that cmake is missing but it is confusing to read since it tries to use cmake from the default path in MacOS and then of course fails - hence my PR to clear up this confusion.
Relevant part of your log is
cmake not found
** CMake build of Abseil failed
Reacted by Dewey Dunnington, Lou Héraut and Vassilis Kehayas
This is also happening to me when building on docker over openanalytics/r-ver:4.5.1
18.37 GNU Make 4.3
18.37 Built for x86_64-pc-linux-gnu
18.37 Copyright (C) 1988-2020 Free Software Foundation, Inc.
18.37 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
18.37 This is free software: you are free to change and redistribute it.
18.37 There is NO WARRANTY, to the extent permitted by law.
18.37 Using MAKE=make
18.37 tools/build_absl.sh: 26: : Permission denied
18.37 cmake not found
18.37 ** CMake build of Abseil failed
18.37 ** Abseil can be installed with:
18.37 ** - apt-get install libabsl-dev
18.37 ** - dnf install abseil-cpp-devel
18.37 ** - brew install abseil
18.37 ** If a system install of Abseil is not possible, cmake is required to build
18.37 ** the internal vendored copy.
18.37 ERROR: configuration failed for package ‘s2’
18.37 * removing ‘/usr/local/lib/R/site-library/s2’
18.46 Warning message:
18.46 In i.p(...) :
18.46 installation of package ‘/tmp/Rtmpmjz6vs/file74c163a7d/s2_1.1.9.tar.gz’ had non-zero exit status
One thing that might be important to note is that I did install libabsl-dev before installing S2 but the installer says it can´t access it.
This is also happening to me when building on docker over openanalytics/r-ver:4.5.1
Doesn't this container set the repository to use binary packages from p3m.dev, suited for the linux distro used (ubuntu noble) ? in my little test the package installation worked quite well (installing the latest version of sf that is).
Related to this, realizing that the container runs R as the root user makes this a prime target for using the pak package:
Activity
michaelmayer2 commentedon May 22, 2025
potential fix in #280
paleolimbot commentedon May 22, 2025
Thank you for opening!
I'm curious what the error message is you're getting, since I've run this a fair bit on Linux forgetting to install cmake first. The last time this happened I remember getting a message telling me to install cmake...is there a situation where we aren't getting that message?
michaelmayer2 commentedon May 22, 2025
Below is the output I get on Rocky Linux 9.
You are right that
cmakewas missing but I would not have expected it to try to use/Applications/CMake.app/Contents/bin/cmakeinstead as a fall-back - which then also fails.The patch will make sure that
/Applications/CMake.app/Contents/bin/cmakewill only be used if the OS is Darwin while the output ofwhich cmakewill be used to detectcmakeon Linux.paleolimbot commentedon May 22, 2025
Ah, got it. The error telling you to install cmake does show up but it's confusing because
/Applications/CMake.app/Contents/bin/cmakeobviously doesn't exist on linux. The fix seems reasonable, I'll take a look!priyapatel1 commentedon May 23, 2025
I'm having a similar issue when I try to install s2:
I'm not sure if I should create a separate issue or not, but don't know how to resolve this.
michaelmayer2 commentedon May 23, 2025
@priyapatel1 same issue than mine - if you install
cmakeon your system the installation will succeed.You can avoid installing
cmakeif you install the Abseil system requirement.The error message kind of says that
cmakeis missing but it is confusing to read since it tries to usecmakefrom the default path in MacOS and then of course fails - hence my PR to clear up this confusion.Relevant part of your log is
priyapatel1 commentedon May 23, 2025
Installing cmake worked for me, thanks
paleolimbot commentedon May 23, 2025
Thanks for reporting! We definitely need to make that part of the failure clearer in the message 😬
Probably also
...should be suppressed.
michaelmayer2 commentedon May 26, 2025
I think there is ample room for improvement like with any software, just trying to get the part fixed that tripped me up in #280
GuiAlDuS commentedon Sep 5, 2025
This is also happening to me when building on docker over
openanalytics/r-ver:4.5.1One thing that might be important to note is that I did install
libabsl-devbefore installing S2 but the installer says it can´t access it.Thanks!
paleolimbot commentedon Sep 5, 2025
I think that last error might be that
cmakeis not available! I am guessing the version of abseil installed via system is too old.michaelmayer2 commentedon Sep 9, 2025
Doesn't this container set the repository to use binary packages from p3m.dev, suited for the linux distro used (ubuntu noble) ? in my little test the package installation worked quite well (installing the latest version of
sfthat is).Related to this, realizing that the container runs R as the
rootuser makes this a prime target for using thepakpackage:As you can see, not only the package is being installed, but also any system dependencies !