6

I am on Ubuntu 16.04. First time using a Linux system. I installed cmake and I can check it in the terminal by typing

/opt/cmake/bin/cmake -version
cmake version 2.8.3

However, when I try to install another program that needs cmake

git clone --recursive https://github.com/Microsoft/LightGBM
cd LightGBM
mkdir build ; cd build
cmake .. 
The program 'cmake' is currently not installed. You can install it by typing:sudo apt install cmake

How to fix this program? I thought I should set some path but I am not sure about that...

Also when I am in the folder where cmake is located and type cmake -version like this

~/cmake-2.8.3/bin$ cmake -version

then it reports

The program 'cmake' is currently not installed. You can install it by typing:sudo apt install cmake
0

1 Answer 1

6

First, how did you "install cmake"? Using one of the Ubuntu package managers to install cmake=3.5.1-1ubuntu3 leaves the cmake binary in /usr/bin/, not /opt/cmake/bin.

To solve your problem, either sudo apt install cmake or add /opt/cmake/bin to your PATH. In your ~/.bashrc, add

PATH=$PATH:/opt/cmake/bin

Then . ~/.bashrc before you retry the build.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .