LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-09-2010, 02:39 PM   #1
borntofish61
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Rep: Reputation: 0
Building and Installing Cmake


I'm trying to get and build the latest cmake (because I want to look at tutorial and examples). I have cmake 2.6 already in my path from the Ubuntu Synaptic Package Manager. I can build it and install it ok, Linux still uses the old 2.6. If I do a sudo cmake -version, it finds the latest 2.8. How do I install it right? Maybe I uninstall 2.6 using the Snaptic Package Manager? Below are my steps:

Thanks,
Paul

Downloaded cmake 2.8.1 from http://www.cmake.org/cmake/resources/software.html
./bootstrap; make; make install
The install failed, so did...
sudo make install
It seemed to work, but...
user@ubuntu:~/cmake-2.8.1$ cmake --version
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
/usr/local/bin
Segmentation fault
If try as root, it works...
found http://ubuntuforums.org/showthread.p...ght=CMAKE_ROOT
found http://www.linuxquestions.org/questi...s-user-800222/
user@ubuntu:~/cmake-2.8.1$ sudo cmake --version
[sudo] password for user:
cmake version 2.8.1
Tried...
user@ubuntu:~/cmake-2.8.1$ export CMAKE_ROOT=/usr/local/share/cmake-2.8
user@ubuntu:~/cmake-2.8.1$ ls /usr/local/share/cmake-2.8
include Modules Templates
user@ubuntu:~/cmake-2.8.1$ cmake --version
cmake version 2.6-patch 4
This is the version of cmake installed using Ubuntu Synaptic Package Manager.
 
Old 05-09-2010, 02:48 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
sudo apt-get remove cmake

>>> You can only have one version installed.
Two different cmake seem to have conflicting issues.

..
 
Old 05-09-2010, 03:11 PM   #3
borntofish61
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Original Poster
Rep: Reputation: 0
Ok. I uninstalled packages cmake and cmake-data using the Synaptic Package Manager that comes with Ubuntu. Now cmake is only available if I use sudo in front of make cmake command, which may not be a problem. I wonder how I get the 2.8.1 under /usr/local/share/cmake-2.8 to be in my path without doing a sudo.

Thanks,
Paul

Below are some notes:
user@ubuntu:~/cmake-2.8.1$ cmake --version
bash: /usr/bin/cmake: No such file or directory
user@ubuntu:~/cmake-2.8.1$ ls /usr/local/share/cmake-2.8
include Modules Templates
user@ubuntu:~/cmake-2.8.1$ sudo cmake --version
[sudo] password for user:
cmake version 2.8.1
user@ubuntu:~/cmake-2.8.1$ export CMAKE_ROOT=/usr/local/share/cmake-2.8
user@ubuntu:~/cmake-2.8.1$ cmake --version
bash: /usr/bin/cmake: No such file or directory
user@ubuntu:~/cmake-2.8.1$ sudo cmake
cmake version 2.8.1
Usage
...
 
Old 05-09-2010, 09:33 PM   #4
borntofish61
LQ Newbie
 
Registered: Apr 2010
Posts: 6

Original Poster
Rep: Reputation: 0
This solved the problem...

./bootstrap --prefix=/usr
make
sudo make install
user@ubuntu:~/cmake-2.8.1$ cmake -version
cmake version 2.8.1
 
Old 05-09-2010, 09:50 PM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Quote:
Originally Posted by borntofish61 View Post
This solved the problem...

./bootstrap --prefix=/usr
make
sudo make install
user@ubuntu:~/cmake-2.8.1$ cmake -version
cmake version 2.8.1
It is generally not a good idea to install things by hand in /usr. Even though you uninstalled the packaged cmake, you may still have problems with files conflicting. In this case it probably better to use --prefix=/usr/local. Then you should just make sure that /usr/local/bin is in your path (prefereably before /usr/bin) and perhaps add /usr/local/lib to your ld.so.conf setup (ie in a file in /etc/ld.so.conf.d/).

Evo2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cmake: Using find_package(Boost) when FindBoost.cmake is not in the default location damien_d Programming 3 10-27-2010 03:40 PM
Building and Installing GCC t8rsalad Linux From Scratch 2 06-06-2009 05:51 AM
building and installing open ldap vinaytp Linux - Newbie 5 05-25-2009 07:46 AM
building from source and installing to a specified directory gvp87 Linux - Software 1 03-31-2008 12:10 AM
[Compiling - building - Installing] Please Help unk Linux - Newbie 2 08-04-2002 10:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration