LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-16-2014, 06:07 PM   #1
mattachu
LQ Newbie
 
Registered: May 2014
Location: London, UK
Distribution: Scientific Linux CERN SLC release 5.10 (Boron)
Posts: 1

Rep: Reputation: Disabled
Installing an extra version of CMake - can run from full path but not from $PATH


This might be interesting to people, so I posted it anyway. This was going to be my first post, I registered specially and everything. But between the start of the post and the end, I logged out of my server and back in, and now it works. Isn't it always the way?


---
Hello! It's my first post because I can't find this particular problem anywhere on the forums, although lots of similar problems with CMake seem to give the same error.

Here is the short version before I get bogged down in detail:

Running cmake from the full path seems to work:
Code:
> /path/to/cmake --version
cmake version 2.8.12.2
This path is in my $PATH variable and works for other binaries, but for cmake I get an error:
Code:
> which cmake
/path/to/cmake
> cmake --version
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found
Segmentation fault
That's the simple version. It's complicated because I'm trying to do a number of things that are probably very silly! I primarily use Macs, and I don't really think I've got much understanding of Linux in my head!

The first silly thing I'm doing is trying to install a second version of cmake on a server that already has version 2.6 installed. It's a university server so I can't and don't want to change the programs installed for all users, but I want to make use of cmake 2.8. So I'm trying to install it in a custom directory using --prefix.

The second silly thing is the number of symlinks that are involved in this process. I think this is probably what's causing the problem, so my next step is probably to try and install it without using these links. I'd like to keep them if possible, though!

So here goes:
  • My home directory is on a drive that doesn't have enough space for the software I want to install, so $HOME/Software is a symlink to /bigdrive/mattachu/Software.
  • I'm trying to keep software contained separately using a sandboxing system (which I don't think is very Linux-y) so cmake is installed using --prefix=$HOME/Software/sandbox/cmake
  • The contents of the bin folder are symlinked, e.g. ln -s ~/Software/sandbox/cmake/bin/* ~/Software/bin/
  • The contents of the other folders in the sandbox are also symlinked, although I've tried copying them instead, with no success.
  • My path contains $HOME/Software/bin as the first entry

I've tried running cmake --version from all the possible locations:
  • ~/Software/bin/cmake --version
  • ~/Software/sandbox/cmake/bin/cmake --version
  • /bigdrive/mattachu/Software/sandbox/cmake/bin/cmake --version
  • ./cmake --version (while in each of the above locations)
All of these work.

The path variable seems to be working:
Code:
[mattachu ~]$ which cmake
~/Software/bin/cmake
[mattachu ~]$ type cmake
cmake is /home/mattachu/Software/bin/cmake
But running cmake without a path doesn't work:
Code:
> cmake --version
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in /bigdrive/mattachu/Software/sandbox/cmake/bin
Segmentation fault
... It was at this point that I tried running it again and it worked. Typical. Maybe something in my .bashrc fixed the problem? I guess I'll never know.
 
Old 05-23-2014, 04:58 PM   #2
dijetlo
Senior Member
 
Registered: Jan 2009
Location: RHELtopia....
Distribution: Solaris 11.2/Slackware/RHEL/
Posts: 1,491
Blog Entries: 2

Rep: Reputation: Disabled
Hey Mattachu,

Quote:
I logged out of my server and back in, and now it works. Isn't it always the way?
I always wonder when something does that. The login forced the shell to reread $PATH would be my guess. If you have this command or something similar, run ldconfig when you get done installing something and it barks about path issues, I've found it a good fix

Also, if it's fixed, mark it closed. It can still be searched for people looking for solutions and thanks for sharing the data even though especially since you didn't need to.

Last edited by dijetlo; 05-23-2014 at 05:01 PM.
 
  


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
Shell: tr can only be used when given full path (despite being in $PATH) chochem Programming 2 06-27-2008 09:37 AM
installing older version of gcc and and adding path variables jaind Linux - Desktop 3 11-26-2006 07:18 AM
Run any Script without metioning the full path shipon_97 Linux - Newbie 2 08-08-2006 11:49 PM
CMake error -- needs full path of compiler Penguin of Wonder Programming 2 01-31-2006 04:22 PM
Extra path variables? mjm461 Linux - General 1 09-15-2005 03:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:44 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration