Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 02-19-2008, 07:57 AM   #1
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438
Blog Entries: 5

Rep: Reputation: 32
how? different versions of a program

Let's say I have a package that I compile and install, but later I get an updated version and compile that one too.
Of course, both versions use the same name for the executable, and I, well, I want to use both.
In fact, soon I will want to compile a third version of the program, and want the invoke the program in all three versions.
Again, the executable will always have the same name.

So what's the most elegant way of doing this?
Putting the three executables in the same directory with the same name? >> Nope, very unwise.
Put them in a separate directory and write a special alias for them where the full directory path appears? >> Sounds good.
Rename the executable, and put them the same directory? >> Possible, but not preferred because other systems users won't know what they are, might get confused.

Of course, that's the easy scenario, when the version use the same version of libraries. If they use different versions, well, then, the call to the executable needs to link those in.

All in all, if I want to have so many version of the saem program, and not disturb anybody else, it's porbably better that I write a little one or two bash script and keep them in a private directory of mine, and include the private directory in my $PATH.

How does that all sound? Anybody have a different way of doing this?

By way of illustration suppose I am thinking of Firefox, I'd like to use v1.5, v2.0 and also install the alpha or beta v3.0 three same-named executables, prob using different version of libraries. THe aboe is how I'd do it. Fair enough?
Old 02-19-2008, 08:47 AM   #2
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590Reputation: 3590
FF is an easy example since it's selfcontained: all the scripts, executables and libraries it comes with all reside in one directory. Would be easy to symlink them to /usr/local/firefox-1, /usr/local/firefox-2, etc and one "firefox" link to the "default" one. If it OTOH is an application that uses different library versions you could install the version-specific libraries in say /usr/local/lib/appname-version and export LD_LIBRARY_PATH in a startup function or script.
Old 02-20-2008, 05:11 PM   #3
Registered: Mar 2004
Location: dublin IRL
Distribution: Slackv12.1, Slamd64v12.1,Xubuntu v8.10_64, FC8_64
Posts: 438

Original Poster
Blog Entries: 5

Rep: Reputation: 32
great stuff many thanks Unspawn, a reply from you is worth a hundred normal ones! cheers!
Old 02-21-2008, 02:17 AM   #4
Amigo developer
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,897

Rep: Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578
The best way to handle having various versions is to build and install each one into it's own directory and then use a small wrapper script for each one. The wrappers can be placed in your normal path. Simply creating links to the programs won't always work and using a wrapper will let you set the PATH and LD_LIBRARY_PATH if needed, or cd into the directory where the program is located and start it from there(if that's what the program needs)
Old 02-21-2008, 03:50 AM   #5
Registered: May 2007
Distribution: Slackware
Posts: 288

Rep: Reputation: 155Reputation: 155
The preferred method is to use '/lib/' to invoke your program because the alterred LD_LIBRARY_PATH won't be passed on to spawned processes. Changing LD_LIBRARY_PATH doesn't typically cause any problems but if you are creating a wrapper script anyway, you might as well "do it right".
Old 02-21-2008, 05:20 AM   #6
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 509

Rep: Reputation: 41
I've got FF2, FF3, Xulrunner, Prism, Flock, Opera, Amaya, and Webkit - all of them installed in "/opt/browsername-version-number" including a source tree of recent Firefox 2 and Webkit plus Flash and Java.

Depending on what exactly I need to start, I've got a handful of little wrappers in ~/bin/ -, and so on as startup scripts.

Enviroment variables like PKG_CONFIG_PATH or LD_LIBRARY_PATH are set per project depending on what I need to set to whatever browser environment.

Konquerer and Epiphany reside within my KDE-trees and within my Gnome-tree - all three also installed in /opt (opt/kde3, opt/kde4, /opt/garnome).

My glib/gtk/pango/freetype-stuff within /usr/ in the main system is usally very recent and patched for better subpixel/bytecode stuff but entirely gnome-free and untouched otherwise.

So, if I need most recent Gnome libs and something from Webkit libraries - to compile some browser with Webkit instead of Gecko, I just set the environment accordingly to my /opt-realm and install it somewhere appropriate.



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
What can you REALLY do with these versions? limeylew Linux - Software 4 05-06-2006 02:23 PM
gcc versions compatibility with kernel versions.. mahesh_manthapuri SUSE / openSUSE 1 03-22-2006 01:28 AM
versions rose Linux - Wireless Networking 2 10-11-2004 11:49 AM
Swaret's "latest" program versions timsch75 Slackware 7 03-20-2004 05:23 PM
C program to run under all versions bbee00 Programming 8 08-12-2003 05:21 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:19 PM.

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