I am running Ubuntu 12.04, which came with Cmake v 2.8.7.
I had need for a more current CMake, so I downloaded the source for 12.8.12.1, built, and installed it per directions. The last step, make install
I ran sudo
ed.
./bootstrap
make
sudo make install
Now I want to run it, but I find that the old version is still invoked when I execute cmake
from the command line:
jdibling@hurricane:/$ cd /; cmake --version; which cmake
cmake version 2.8.7
/usr/local/bin/cmake
jdibling@hurricane:/$
Odd, I think. So I su
and try it from there:
root@hurricane:~# cd /; cmake --version; which cmake
cmake version 2.8.12.1
/usr/local/bin/cmake
root@hurricane:/#
Why does which
report the same directory, but cmake --version
reports different versions? How can I find where the new cmake
was actually installed?
As suggested, I ran type
:
jdibling@hurricane:/tmp/cmake-2.8.12.1$ type cmake
cmake is hashed (/usr/bin/cmake)
jdibling@hurricane:/tmp/cmake-2.8.12.1$ sudo su -
root@hurricane:~# type cmake
cmake is /usr/local/bin/cmake
root@hurricane:~#