Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End configuration sooner and louder if cmake missing when needed #103

Merged
merged 2 commits into from
Jan 30, 2022

Conversation

eddelbuettel
Copy link
Contributor

@eddelbuettel eddelbuettel commented Jan 29, 2022

We had some reports where users didn't really realize they were missing cmake. I realized that I can (and maybe "should", hence this PR) test for that and have configure stop with the clear message from your shell script.

On empty R docker container (without cmake or nlopt) we now get:

edd@rob:~/git/nloptr(master)$ docker run --rm -ti -v $PWD:/mnt -w /work r-base bash
root@2b5065467a3a:/work# ./configure 
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -std=gnu++14 accepts -g... yes
checking how to run the C++ preprocessor... g++ -std=gnu++14 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -std=gnu++14 accepts -g... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking if pkg-config knows NLopt... no
checking for cmake... no

------------------ CMAKE NOT FOUND --------------------

CMake was not found on the PATH. Please install CMake:

 - yum install cmake          (Fedora/CentOS; inside a terminal)
 - apt install cmake          (Debian/Ubuntu; inside a terminal).
 - pacman -S cmake            (Arch Linux; inside a terminal).
 - brew install cmake         (MacOS; inside a terminal with Homebrew)
 - port install cmake         (MacOS; inside a terminal with MacPorts)

Alternatively install CMake from: <https://cmake.org/>

-------------------------------------------------------

configure: error: Could not fine 'cmake'.
root@2b5065467a3a:/work# 

Feel free to discard if you would rather address this differently what it occured to me that this may help.

@astamm
Copy link
Owner

astamm commented Jan 30, 2022

That is a valid point and I am happy with your solution. Can you just change fine with find please?

@eddelbuettel
Copy link
Contributor Author

Whoops. Will fix.

@eddelbuettel
Copy link
Contributor Author

(You may want to toss a sudo in front of text for apt and yum (and possibly pacman and maybe port and brew). System-wide installation will likely not work as a mere user.)

@astamm astamm merged commit 5f63386 into astamm:master Jan 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants