6

My company uses a small out-dated cluster (CentOS 5.4) to do number crunching (finite element calculations to be more specific). They are using a commercial package and have no idea of Linux. They don't want to change anything on the machines as long as they run, which I accept as a time-effective policy. I do not have administrative rights.

I can have them install smaller packages, but not change e.g. the python version from 2.4 to 2.6+, so I decided to compile the current version (./configure --prefix=/home/mysuser/root2) and ran into a few problems with the dependencies (wrong version of e.g. readline, zlib, curses, bz2 ... or packages not found). I also need to update gcc which complaines about missing GMP, MPFR and MPC.

The reason for doing this is I'd like to compile other test software to do run on these machines. What can I do to effectively install the packages I need in order to compile the software I need to work with? I'm elsewhere using archlinux and would find it quite handy to be able to do something along the lines

pacman --root /home/myuser/root2 -S <package>

But I have no idea if this is possible or clever.

Other related SE questions: gentoo-prefix and pkgsrc seem to be not so easy (I may be wrong, though).

Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
Sebastian
  • 8,817
  • 4
  • 40
  • 49
  • You should be able to do local installs, eg in your home directory. Are these installs just for your own use? Is there some reason you can't use other, more up-to-date machines? – Faheem Mitha Apr 02 '12 at 08:21
  • Yes just for me. I'm currently using ./configure --prefix ...; make; make install but I'm looking for a way that simplifies the dependency resolution. – Sebastian Apr 02 '12 at 08:40
  • Dependency resolution is usually handled by the systems package management, but using package management for locally installed packages is difficult. Is creating some kind of virtual machine for yourself an option? – Faheem Mitha Apr 02 '12 at 08:53
  • no, because I want to use it for high performance calculations (using MPI etc). – Sebastian Apr 02 '12 at 08:56

2 Answers2

3

Your management is wise in not trying to upgrade a working cluster that is performing an important function based on a proprietary package.

Backporting packages is time consuming and risky, that is, not always feasible. You might avoid the time penalty if you can finding the packages that you want to install in the original CentOS 5.4 repository or in some CentOS 5.4 backport repository. While you can have several versions of GCC on one host at the same time (the embedded systems/cross compile folks do this all the time), but it is not trivial to have more than one glibc in a single run-time environment.

So, you are best advised to work in a separate, newer environment that has the packages that you need and find some way to test the output of the old environment in the new one. In any event, do not risk breaking anything in the old environment or you may need all of the stackexchange.com reputation points that you can get to find your next job ;-)

Eli Rosencruft
  • 540
  • 2
  • 6
  • thanks for this answer. I'm not familiar with CentOS that much. Can I install (in other than /) using yum and the packages from a web repository? thanks – Sebastian Apr 02 '12 at 07:52
  • 2
    You can download rpm packages to your personal directory and then use these instructions to extract the files, including any executables – Eli Rosencruft Apr 02 '12 at 08:20
  • I found this mirror and managed to get something working (http://mirror.centos.org/centos/5/os/x86_64/CentOS/) . For the moment the gentoo prefix seems to be a less complicated alternative. – Sebastian Apr 05 '12 at 09:51
2

Installing packages from distributions is often difficult when you don't have root permissions, as they assume a fixed directory layout and the dependency system tends to require some packages with setuid or setgid programs that you can't install as non-root.

Compiling from source is more often than not the easiest way. (And if you're after speed, you can choose the best compilation options for your particular processor model.)

To organize the packages that you compile (or install by extracting tarballs), I recommend using stow or the more powerful but more complex xstow. Their basic mode of operation is to install each package in a separate directory, then create symbolic links to put them all together. Here's a typical compilation and installation session with stow:

tar xzf foobar-42.tar.gz
cd foobar-42
./configure --prefix=~/software/stow/foobar-42
make
make install
cd ~/software/stow
stow foobar-42

That last command creates symbolic links from files and directories under ~/software/stow under ~/software. For example, if ~/software/stow/foobar-42 contains a lib/foobar directory and files bin/foobar and man/man1/foobar.1, then you will end up with symbolic links

~/software/bin/foobar -> ../stow/foobar-42/bin/foobar
~/software/lib/foobar -> ../stow/foobar-42/lib/foobar
~/software/man/man1/foobar.1 -> ../../stow/foobar-42/man/man1/foobar.1

To uninstall a program, run stow -D foobar-42 in the ~/software/stow directory, and delete ~/software/stow/foobar-42. To make a program temporarily unavailable (e.g. to try another version), just run the stow -D part.

See also Non-Root Package Managers ; Best way to upgrade vim/gvim to 7.3 in Ubuntu 10.04?