Privacy and Security Notice

CUE Unix Software Installation Cookbook

The CUE Unix Software Installation Cookbook

This is a quick document on how to install a new package under CUE, the common user environment. There are several topics under this: Please send comments to bhess@jlab.org. Updated: 19990818

An overview of the /apps directory structure

CUE software is installed in /apps with a directory structure that is descirbed in this document. The goal of the structure is to allow for the easy coexistence of multiple versions of a software package. Since some software packages (like gcc, for example) require a fairly elaborate directory structure, we have designed our applications area to accomodate those needs.

Briefly, /apps contains a directory for each software package. Below that directory is a subdirectory for every version of that software package. Within that subdirectory are the necessary components of that version. This might include yet another level of directories for binaries, libraries, and documentation. We use a few judiciously selected symbolic links to hide this complexity from the user in the most common cases. For example, /apps/gcc/bin/gcc is always the preferred verion of gcc, and /apps/emacs/bin/emacs is always the preferred version of emacs.

Since each package is separated into its own hierarchy of directories, we gather together symbolic links to all the current versions in /apps/bin. This is in the default path.

Now for the details:


/apps is a symbolic link to a directory of links, usually

		/apps -> /u/apps/links

Consider a software package called "foo"

		/u/apps/links/foo -> /u/apps/foo

Here's the symlink trail:

		/apps/foo -> /u/apps/links/foo -> /u/apps/foo


Suppose that we use two different versions of foo, foo-1.2.2 and foo-1.2.3.
Here's a map of the directory structure:

/apps/foo

		PRO -> foo-1.2.3 [specifies that foo-1.2.3 is the production version]

		foo-1.2.3
				bin
				BUILD -> foo-1.2.3 (yes, /apps/foo/foo-1.2.3/foo-1.2.3 )
					[complete source tree under BUILD]
				lib
				man
				include
				etc
				[...]

		foo-1.2.2
				bin
				BUILD -> foo.1.2.2 (yes, /apps/foo/foo-1.2.3/foo-1.2.3 )
					[complete source tree under BUILD ]
				lib
				man
				include
				etc
				[...]

		bin -> PRO/bin

		lib -> PRO/lib

		man -> PRO/man

		include -> PRO/include

		etc -> PRO/etc



/apps/bin/foo -> /apps/foo/bin/foo
/apps/man/man1/foo.1 -> /apps/foo/man/man1/foo.1	
/apps/lib/foo.so.3 -> /apps/foo/lib/foo.so.3

Installing a new package under /apps

Here's how you would install flex version 2.5.4:

log into a machine with the proper OS


cd /apps
[working dir is now /u/apps/links]

ln -s /u/apps/flex /apps/flex
[unless it already exists. We want /u/apps/links/flex -> /u/apps/flex]
[This is one of the VERY few times you want to explicitly use "/u/apps" instead of /apps]

cd /u/apps

mkdir flex	
[unless it exists becuase there are other versions under it]

cd flex
[working dir is now /u/apps/flex]

mkdir flex-2.5.4
[this creates the root for the new version of flex]

ln -s flex-2.5.4 PRO
[if this is the production version. you might do this later]

cd flex-2.5.4

gtar xvfz /site/ccc/downloads/ftp.flex.com/flex-2.5.4.tgz
[creates ANOTHER flex-2.5.4 directory this is the BUILD directory]

ln -s flex-2.5.4 BUILD

cd BUILD

./configure --prefix=/apps/flex/flex-2.5.4
[It's important to use "/apps/..." here, NEVER "/u/apps/..."
[... configure output ... If there's no configure, do the same by hand]

make

make test

make install
[puts binaries in /apps/flex/flex-2.5.4/bin]


cd /apps/flex
ln -s PRO/{bin,lib,info} .
[if this is the first production version, make the PRO links]

Now you have a complete build of flex-2.5.4 under its own directory structure. You have not disrupted any existing versions, nor have you changed the default. Regardless of wheter this is the default version or not, you must create a setup configuration file for this new version. See the next section.

Configuring the use utility for older versions of packages in /apps

The new setup utility, called use, does not use C shell for its syntax, and it does not use .setup files for its configuration. The tree structure for it is rooted at /site/cuesw, and the configuration files are all named use.conf. For example, the pine version 3.93 file is found in /site/cuesw/pine/3.93/use.conf You may want to copy and modify another use.conf file. There's no need to create a use.conf file for current versions of software. The current version should be linked into /apps/bin in one of two ways:

Changing the production version of a package under /apps

Normally we want to change the production version of an application only on maintenance days. For the installation of new packages, this wouldn't matter as much. If the software has never had an entry in /apps/bin, then there's usually no reason to worry about adding it.

To change the production version, only one symbolic link, the PRO link, needs to change. Consider this example where there are two versions of the famous foo package: foo-1.2.2 and foo-1.2.3. The current version is 1.2.2, and we want to change to 1.2.3 as the production version:

cd /apps/foo
rm PRO; ln -s foo-1.2.3 PRO
To support the older versions, you will likely want to add a use.conf file to /site/cuesw/foo/foo-1.2.2 so that "use" (the replacement for setup) can make older versions available.

Creating Wrapper scripts for applications that require extra setup

Some packages like root or netscape may require that environment varialbe be set, or that the dynamic linker search path be altered. Rather than use setup, make the link from /apps/bin point to a wrapper script in /apps/wrappers with the same name as the application. As an example, /apps/bin/netscape is a symbolic link to /site/wrappers/netscape, a script that contains these lines:
#!/bin/sh
MOZILLA_HOME=/apps/communicator4.5;export MOZILLA_HOME
exec /apps/communicator4.5/netscape http://www.jlab.org >/dev/null 2>&1
This small script sets the necessary environment variables and then executes netscape. The "exec" will make the netscape process overlay the wrapper script. This prevents an extra process slot from being consumed by the wrapper script once its function has been completed.

Installing a new package under /usr/local

Packages that are built to be installed in /usr/local:

/apps/LOCAL contains packages that are built and ready to be installed
in /usr/local with a "make install" (or whatever is appropriate for that
package). The structure can be different from the rest of /apps since people
can pick and choose which package to install. A flatter file system layout can
be used, e.g.

/apps/LOCAL/ssh-1.2.25
/apps/LOCAL/ssh-1.2.26
/apps/LOCAL/tar-1.2.11
/apps/LOCAL/tar-1.2.12

and so on. The idea is that we don't need the extra tree structure because
nobody is going to use "setup" to get around with these packages in /usr/local/
If people want to have alternate packages in /usr/local, we can leave that
as an exercise to the reader. I suggest that we should only support multiple
versioning using setup in /apps. /usr/local is more proflexy the domain of
any local system administrator-- they deicde the layout and details.

Some locally written utilities


This document is maintained by {helpdesk@jlab.org}

Copyright Jefferson Lab 2007