LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 06-23-2006, 03:14 AM   #1
cumbersome
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 16

Rep: Reputation: 0
How to install programs in my home directory?


Hi,

I would like to use a program on a computer where I do not have root permissions. The program is installed from source (program.tar.gz) with the usual three commands

./configure
make
make install

I know that I can choose an install path with e.g.

./configure --prefix=/home/myhome/programs

But I don't know how to set up the paths in a way that the program can find all of its files.
Are there tools to simplify the install of programs without root rights? What is the best way to install programs in home directories?

Thanks
 
Old 06-23-2006, 03:28 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Best way?
As you did with --prefix. I usually do it in /tmp
Sometimes , I also pass the option for etc but I think its not needed in most cases. something like --configuration=/tmp/etc

Doesn't work?
 
Old 06-23-2006, 03:57 AM   #3
cumbersome
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 16

Original Poster
Rep: Reputation: 0
Thanks for your fast reply.

My problem is that I don't know how to set up the environment. For the program I need a library that I installed successful under my home directory but when I want to ./configure the actual program it does not find this library.
I think I have to somehow setup paths to the various directories that are created in my /home/myhome/myprograms directory. How can I do this and which paths do I have to set up?
 
Old 06-23-2006, 04:04 AM   #4
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
where is the executable file you want to run? find it and copy its absolute path (the one starting with a /) then add it to your $PATH variable. how?
PATH=$PATH:/path/to/your/executable

better store it in your .bashrc file usually found in your home directory.
 
Old 06-23-2006, 04:04 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Ok I see,

The thing is it depends a lot on how good the configure script is done.
Some will get it from --libdir or something like that.
You might try ./configure --help (if its avail, always the case) and look at the options.
Otherwise, I usually look directly in configure.in or configure or Makefile to reverse-engineer what options I have to pass to ./configure
Other options (for not perfect configure.in) is to to it like this:
CPPFLAGS=... LDDFLAGS=... PKG_CONFIG_PATH=... ./configure
Last option for really stupid configure.in (I've never seen this) is to hardcore edit the Makefile, but that's not maintainable.

Don't forget to do make mrproper before rerunning ./configure

And then to run it, you can modify your path and set LD_LIBRARIES_PATH


edited

Last edited by nx5000; 06-23-2006 at 07:41 AM.
 
Old 06-23-2006, 04:08 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by prozac
where is the executable file you want to run? find it and copy its absolute path (the one starting with a /) then add it to your $PATH variable. how?
PATH=$PATH:/path/to/your/executable
Its not what the OP is asking!
Quote:
better store it in your .bashrc file usually found in your home directory.
No, in .bashrc you should not change your PATH, eventhough 50% of users do it.. its in the environment files, like .bash_profile.
I have a lot of examples where when running several subshells where .bashrc contains PATH=$PATH:/path/to/your/executable, you end up with
PATH=/path/to/your/executable:/path/to/your/executable:/path/to/your/executable:/path/to/your/executable:/bin/:/sbin/...

not good!
 
Old 06-23-2006, 07:01 AM   #7
cumbersome
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,

I still can't get it to run. What I really would like to have is a subdirectory under my home directory like /usr/local where I can install programs and libraries in a way that the system automatically finds everything without the need to pass many extra parameters to ./configure.

Now I added the following first to ~/.bashrc and than to ~/.bash_profile (.bash_profile did not exist) but it did not help (I used a new xterm window):

PATH=$PATH:/home/myhome/MyPrograms/bin
LD_LIBRARIES_PATH=$PATH:/home/myhome/MyPrograms/lib

I still get this error from
./configure --prefix=/home/myhome/MyPrograms

checking for pangoft2 gtkglext-1.0... Package gtkglext-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkglext-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkglext-1.0' found
configure: error: GtkGLExt is required.

this library is actually stored in
/home/myhome/MyPrograms/lib
 
Old 06-23-2006, 07:06 AM   #8
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
Quote:
Originally Posted by nx5000
Its not what the OP is asking!
I am sorry, I must have misread.

Quote:
Originally Posted by nx5000
No, in .bashrc you should not change your PATH, eventhough 50% of users do it.. its in the environment files, like .bash_profile.
if won't be a problem if you have this in .bash_profile
Code:
# .bash_profile

# Source .bashrc
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
and with all due respect i have not encountered a single pblm as you have stated as yet that's why.
 
Old 06-23-2006, 07:38 AM   #9
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by cumbersome
I still get this error from
./configure --prefix=/home/myhome/MyPrograms

checking for pangoft2 gtkglext-1.0... Package gtkglext-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkglext-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkglext-1.0' found
configure: error: GtkGLExt is required.

this library is actually stored in
/home/myhome/MyPrograms/lib
It tells you what to do:
Let's go step by step with the cleanest method.

When you installed this libgtkglext-1.0, you have dl the source, have put it in /home/myhome/MyPrograms/src/gtkglext-1.0
Then you did
./configure --prefix=/home/myhome/MyPrograms
make
make install
now you have /home/myhome/MyPrograms/lib which contains some .so and some .a.
You should also have a directory pkgconfig, and in this directory you have a file `gtkglext-1.0.pc' which should contain the string "prefix=/home/myhome/MyPrograms/"

Did you do it like this?
(or did you get a binary libgtkglext-1.0 that you put in /home/myhome/MyPrograms)

(then we'll go onto the next episodes.. suspense!)

edit:
changed /tmp

Last edited by nx5000; 06-23-2006 at 07:42 AM.
 
Old 06-23-2006, 07:58 AM   #10
cumbersome
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 16

Original Poster
Rep: Reputation: 0
Hello and thank your for your kind help.

I deleted everything and started from scratch like you proposed.
I installed the library from source, too and there is now
prefix=/home/myhome/MyPrograms

inside of
/home/myhome/MyPrograms/lib/pkgconfig/gtkglext-1.0.pc

Last edited by cumbersome; 06-23-2006 at 08:06 AM.
 
Old 06-23-2006, 08:08 AM   #11
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Cool
Now looking again at what you said before:
Quote:
still get this error from
./configure --prefix=/home/myhome/MyPrograms

checking for pangoft2 gtkglext-1.0... Package gtkglext-1.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkglext-1.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkglext-1.0' found
configure: error: GtkGLExt is required.
you do it again :
cd src
cd myprog
PKG_CONFIG_PATH=/home/myhome/MyPrograms/lib/pkgconfig ./configure --prefix=/home/myhome/MyPrograms

What happens?

I hope you get the idea behind, pkgconfig gives the place where the libs are and how a program has to be linked with this lib. Its a very neat tool.

ps: its painfull, but clean..
 
Old 06-23-2006, 08:25 AM   #12
cumbersome
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 16

Original Poster
Rep: Reputation: 0
I don't really understand the line:

PKG_CONFIG_PATH=/home/myhome/MyPrograms/lib/pkgconfig ./configure --prefix=/home/myhome/MyPrograms

PKG_CONFIG_PATH is an environment variable and not a command, isn't it? Do I have to use

set PKG_CONFIG_PATH=/home/myhome/MyPrograms/lib/pkgconfig

and then

./configure --prefix=/home/myhome/MyPrograms

This way I still get the error. I think somehow I have to enable this cool pkgconfig environment first before it can find its file.
 
Old 06-23-2006, 08:34 AM   #13
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Quote:
Originally Posted by cumbersome
I don't really understand the line:

PKG_CONFIG_PATH=/home/myhome/MyPrograms/lib/pkgconfig ./configure --prefix=/home/myhome/MyPrograms

PKG_CONFIG_PATH is an environment variable and not a command, isn't it? Do I have to use
the form
var=value command
means that you modify the environment so that command sees the variable "var" equal to value.
Quote:
set PKG_CONFIG_PATH=/home/myhome/MyPrograms/lib/pkgconfig

and then

./configure --prefix=/home/myhome/MyPrograms

This way I still get the error. I think somehow I have to enable this cool pkgconfig environment first before it can find its file.
With this set its not ok because when you run ./configure, the variable PKG_CONFIG_PATH is not seen.

So either you do my method or if you prefer to keep PKG_CONFIG_PATH for other makes you can do
Code:
export PKG_CONFIG_PATH=...
then
./configure
this time configure will see your variable

Then in the configure file, your variable wil be used like this:
INTERNAL_PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/lib/pkgconfig
and then configure will look for .pc files in this PATH

If you have /usr/lib/pkgconfig directory, then you already have pkgconfig feature.
 
Old 06-24-2006, 07:45 AM   #14
cumbersome
LQ Newbie
 
Registered: Aug 2004
Location: Germany
Distribution: Slackware 10.0
Posts: 16

Original Poster
Rep: Reputation: 0
Hi,

thank you for your persistent help. Now I found out what kind of problem I had. All these commands and entries in the .bashrc etc did not work because I was not using the bash shell but something different. Now I changed the shell to bash and everything works.

Thanks again
 
Old 06-26-2006, 03:23 AM   #15
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
You're welcome, happy to have helped you.
 
  


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
Does a new install of 10.0 destroy my /home directory? rwhitworth SUSE / openSUSE 3 10-24-2005 03:55 PM
programs have no access to home directory. SnowSurfAir Linux - Software 4 07-14-2005 12:05 AM
Best directory to install programs? rkthornton Linux - Software 6 02-25-2005 05:55 PM
What directory do I install new programs jkruer01 Linux - Newbie 1 04-05-2004 07:11 PM
Install programs to which directory? sonofdbn Slackware 2 03-07-2004 08:58 AM

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

All times are GMT -5. The time now is 10:46 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