This is an old revision of the document!
Installing LOFAR Software on a CentOS 6.5 (Final) system (cluster Newton of the AIP Potsdam)
— Frank Breitling 2015/06/26 18:47
I was mainly following the previous installation notes provided by others:
http://www.lofar.org/operations/doku.php?id=public:user_software:lofar
http://www.lofar.org/operations/doku.php?id=public:user_software:ubuntu_12_4
However a few problems occured and had to be solved as described below.
Ideas and support by Arno Schoenmakers, Ger van Diepen and Marcel Loose were very helpful and highly appreciated.
This instruction will install all packages in $HOME/local/.
1. Setup of the environment
The following packages are already provided on the cluster:
- BLAS
- LAPACK
- Boost 1.41.0
- cfitsio 3.240
- HDF5
- OpenMP
1.1 Pathes
For the installation of Pyrap (python-casacore) we need a Python path with write access.
So I added the following two lines to my $HOME/.bashrc:
export PYTHONPATH=$HOME/local/lib64/python2.6/site-packages:$PYTHONPATH export PATH=$HOME/local:$PATH
1.2 CMake
The 4 Newton head nodes provide CMake 2.6 by default, but the LOFAR Software requires at least 2.6.6. A sufficiently recent version of CMake 3.0.0 is provided via Environment Modules (see also http://modules.sourceforge.net/).
The environment modules also provide more recent HDF5 libraries. Both could be loaded by adding the following line to $HOME/.bashrc:
module load cmake hdf5
But unfortunately the CMake 3.0.0 loaded on the head node newl1 is broken. Furthermore loading the HDF5 libs has no effect on the libs found by CMake, which are still the system's default. So we don't load any module and don't add this line to the .bashrc. Instead we build our own CMake as follows:
mkdir -p $HOME/local/src cd $HOME/local/src wget http://www.cmake.org/files/v3.2/cmake-3.2.3.tar.gz tar xf cmake-3.2.3.tar.gz cd cmake-3.2.3 .bootstrap --prefix $HOME/local make -j12 make install
2. Installation of required packages
Next we need to build and install these other packages as follows:
cd $HOME/local/src/ wget ftp://ftp.atnf.csiro.au/pub/software/wcslib/wcslib.tar.bz2 tar xf packages/wcslib.tar.bz2 cd wcslib-5.6/ ./configure --prefix=$HOME/local/ make install cd $HOME/local/src/ wget http://www.fftw.org/fftw-3.3.4.tar.gz cd fftw-3.3.4 configure --prefix=$HOME/local --enable-threads --enable-shared --enable-float make -j12 install
3. Installation the LOFAR software
Now we can continue building the LOFAR software.
3.1 Essential CMake switches
We will need these essential CMake switches:
1. -DUSE_OPENMP=yes 2. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/local 3. -DBoost_NO_BOOST_CMAKE=ON 4. -DENABLE_TABLELOCKING=OFF (only for Casacore) 5. -DUSE_LOG4CPLUS=NO (only for the LOFAR packages) 6. -DUSE_BACKTRACE=OFF
1.) OpenMP makes use of multi-core CPUs. We want to use this since it speeds up our processing.
2.) Sets the installation path to $HOME/local/.
3.) Is necessary when using some older versions of boost with cmake-2.8.6-rc2 or later, where the boost finding has changed.
(See https://stackoverflow.com/questions/9948375/cmake-find-package-succeeds-but-returns-wrong-path.)
Otherwise make will show this error later:
make[2]: *** No rule to make target `/usr/lib64/lib64/libboost_program_options-mt.so.5', needed by `segment'. Stop. make[1]: *** [CMakeFiles/segment.dir/all] Error 2 make: *** [all] Error 2
4.) On the AIP Lustre file system Casacore cannot acquire read locks leading to errors like:
msoverview: Version 20110407GvD 2015-06-30 19:32:19 INFO Process 13592: waiting for read-lock on file /lustre/fkbreitl/data/L206894/L206894.cal/L206894_SAP000_SB200_uv.MS.dppp_00001~00040/table.lock Error: Error (Function not implemented) when acquiring lock on /lustre/fkbreitl/data/L206894/L206894.cal/L206894_SAP000_SB200_uv.MS.dppp_00001~00040/table.lock
With table locking switched off these errors are avoided. For practical work there is no disadvantage in disabling table locking.
This switch is only needed for Casacore!
5.) Is necessary for the LOFAR packages if the Log4cplus libs are not installed.
6.) Is necessary if building shared libraries (the default with LOFAR), but libiberty.so is not installed on your system, only libiberty.a.
(See https://support.astron.nl/lofar_issuetracker/issues/8046).
So we can build the rest of the packages as follows.
3.2 Casacore
Casacore also requires the CASA data. This is for example provided with CASA.
Here we assume CASA is already installed and $HOME/local/casa is a link to the CASA folder. Then the data is in $HOME/local/casa.
We will specify this via -DDATA_DIR, otherwise we need a ~/.casarc file with the line: measures.directory: $HOME/local/casa/data
.
cd ~local/src/ git clone https://github.com/casacore/casacore mkdir build/casacore cd build/casacore time cmake -DBUILD_PYTHON=yes -DCMAKE_INSTALL_PREFIX=~/local -DUSE_FFTW3=yes -DENABLE_TABLELOCKING=OFF \ -DUSE_OPENMP=yes -DDATA_DIR=~/local/casa/data -DUSE_HDF5=yes -DCMAKE_PREFIX_PATH="$HOME/local;" ../../casacore time make -j12 make install
3.3 Pyrap
cd ~/local/src/ git clone https://github.com/casacore/python-casacore.git cd python-casacore python setup.py build_ext -I/usr/include/cfitsio:$HOME/local/include -L$HOME/local/lib python setup.py install --prefix=$HOME/local
3.3.1 Alternative Pyrap installation
Or alternatively we can try to install Pyrap with pip but this had problems, particularly on newton:
pip install python-casacore --global-option=build_ext --global-option=-I/usr/include/cfitsio:$HOME/local/include \ --global-option=-L$HOME/local/lib --install-option=--prefix=$HOME/local
3.4 Casarest
Now we continue with the rest:
cd ~local/src/ svn co https://svn.astron.nl/casarest/trunk/casarest mkdir build/casarest cd build/casarest cmake -DCASACORE_ROOT_DIR=$HOME/local -DBUILD_ALL=1 -DCMAKE_INSTALL_PREFIX:PATH=$HOME/local \ -DCMAKE_PREFIX_PATH=/usr/include/cfitsio -DUSE_OPENMP=yes -DBoost_NO_BOOST_CMAKE=ON ../../casarest time make -j12 make install
3.5 The LOFAR packages
cd ~local/src/ svn checkout --ignore-externals https://svn.astron.nl/LOFAR/trunk LOFAR mkdir -p build/gnu_opt cd build/gnu_opt cmake -DCASACORE_ROOT_DIR=$HOME/local -DBUILD_PACKAGES="DP3 Calibration" -DCMAKE_INSTALL_PREFIX:PATH=$HOME/local \ -DUSE_OPENMP=yes -DUSE_LOG4CPLUS=NO -DUSE_BACKTRACE=OFF -DBoost_NO_BOOST_CMAKE=ON ../../LOFAR time make -j12 make install
Done!
Now the commands NDPPP
and calibrate-stand-alone
should be available on this system.
Enjoy!