Size: 3200
Comment:
|
Size: 3224
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
#rev 2018-10-30 stroth |
How can I compile/install additional software on a linux tardis workstation?
Regular (non-root) users cannot use the commands apt-get, aptitude or dpkg in order to install precompiled .deb-packages on a tardis machine. However, you may download the source code, compile it and install the desired software in your home-directory. The following description may vary as the case arises (the README and INSTALL files in the source code directory usually give detailed information).
- Download source code
Enter source code directory and execute ./configure --prefix=/home/$USER/package. The configure script checks for all necessary dependent libraries and creates all make files. If ./configure fails or if you prefer a particular library over another you must set the necessary path variables.
Remark: Most libraries are contained in /usr/lib/ and don't need to be specified. If a desired library is not found, you may check /usr/pack/ or www.sepp.ee.ethz.ch/sepp-debian/ for the path (more friendly: you can also use the command sepp for that).
./configure --help shows you which variables can be set. Here are the most important ones:
Variable
Meaning
PREFIX
toplevel directory path, should be in your homedirectory. It is an argument of the configure script, e.g. ./configure --prefix=/home/$USER/package
CFLAGS
C-Compiler options (usually gcc on Linux), e.g. include directory specifications. For an include directory use -I (capital i) option, e.g. CFLAGS=-I<inlcude-directory>. You may use multiple -I/path in this variable, use whitespace for separation.
CXXFLAGS
C++-Compiler options (usually g++ on Linux), e.g. include directory specifications
LDFLAGS
linker flags. Use -L option for link-time-directory and -Wl,-rpath, (will be passed to ld) for run-time directory (both directories are the same), e.g. LDFLAGS="-L<link-directory> -Wl,-rpath,<link-directory>" Remark: The -Wl,-rpath, option is for linux, on solaris you may want to use -R instead. Use whitespace as separation for more paths.
Hint: You may use pkg-config to set these variables, check PKGConfig for more information.
Once the configure script terminated successfully, execute make in order to compile source code. On Solaris you must use gmake instead of make.
Execute make install in order to install software. Again, on Solaris you must use gmake install.
- In conclusion, here is an example of the whole process (tcsh on Linux):
> setenv CFLAGS "-I<include-path>" > setenv LDFLAGS "-L<link-directory> -Wl,-rpath,<link-directory>" > ./configure --prefix=<path> ... > make ... > make install ... >
Remark: setenv is used in tcsh which is the standard shell on tardis workstations. If you use bash you may want to use the command export instead.