public:install_lofar_redhat5.8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
public:install_lofar_redhat5.8 [2013-10-10 09:55] – created Jose Sabater Montespublic:install_lofar_redhat5.8 [2013-10-10 13:27] Jose Sabater Montes
Line 8: Line 8:
   * Libraries available: HDF5 and old versions of boost and fftw3.   * Libraries available: HDF5 and old versions of boost and fftw3.
  
-After some tests we determined that we needed to isntall, at least, the followin software and libraries:+After some tests we determined that we needed to install, at least, the following software and libraries:
   * scons   * scons
   * WCS   * WCS
Line 16: Line 16:
   * Python   * Python
     * numpy     * numpy
 +    * virtualenv (optional)
 +    * h5py (optional)
 +    * scipy
 +    * matplotlib
 +    * pandas (optional)
 +    * pyfits
 +    * pywcs
 +    * astropy (optional)
 +    * cython
 +    * IPython (optional)
   * Boost   * Boost
   * LOFAR related:   * LOFAR related:
Line 22: Line 32:
     * casarest     * casarest
     * LOFAR (LofIm)     * LOFAR (LofIm)
- 
  
 ===== Installation steps ===== ===== Installation steps =====
  
-The software was installed in the home of the use ''jsm'' (''/home/users/dae/jsm''). You should change the scripts accordingly.+The software was installed in the home of the user ''jsm'' (''/home/users/dae/jsm''). You should change the scripts accordingly
 + 
 +We will install Python in ''/home/users/dae/jsm/python'' and the rest of libraries and software in ''/home/users/dae/jsm/local''. The HDF5 library is already in the system in ''/usr/local/hdf5-1.8.11-linux-x86_64-shared''. A standalone version of casapy is also present in the system.
  
 Previous steps: Previous steps:
Line 51: Line 62:
 # LOFAR related software # LOFAR related software
 # casacore # casacore
-#svn co http://casacore.googlecode.com/svn/tags/casacore-1.5.0 +svn co http://casacore.googlecode.com/svn/tags/casacore-1.5.0
-cp -r /home/users/dae/jsm/local-v0/src/casacore-1.5.0 . +
-rm -rf casacore-1.5.0/build+
 # pyrap # pyrap
-#svn co http://pyrap.googlecode.com/svn/tags/pyrap-1.1.0 +svn co http://pyrap.googlecode.com/svn/tags/pyrap-1.1.0
-cp -r /home/users/dae/jsm/local-v0/src/pyrap-1.1.0 .+
 # casarest # casarest
-#svn co https://svn.astron.nl/casarest/trunk/casarest/ +svn co https://svn.astron.nl/casarest/trunk/casarest/
-cp -r /home/users/dae/jsm/local-v0/src/casarest . +
-rm -rf casarest/build+
 </code> </code>
  
Line 77: Line 83:
 </code> </code>
  
-Install Python and their important libraries:+Install Python and some Python libraries:
 <code bash> <code bash>
 # Compile # Compile
Line 131: Line 137:
 </code> </code>
  
-From now on we need to enter an interactive PBS job to avoid our jobs to be killed after certain amount of time (the maximum allowed lenght for a job without using PBS is 10 minutes). The nodes do not have direct access to the Internet (that is why they were previously downloaded):+From now on we need to enter an interactive PBS job to avoid our jobs to be killed after certain amount of time (the maximum allowed length for a job without using PBS is 10 minutes). The nodes do not have direct access to the Internet (that is why the packages were previously downloaded):
  
 <code> <code>
Line 143: Line 149:
 export LD_LIBRARY_PATH=/home/users/dae/jsm/local/lib:/home/users/dae/jsm/local/atlas/lib:/home/users/dae/jsm/python/lib:/usr/local/hdf5-1.8.11-linux-x86_64-shared/lib:/usr/local/mpich-install/lib:/usr/local/lib export LD_LIBRARY_PATH=/home/users/dae/jsm/local/lib:/home/users/dae/jsm/local/atlas/lib:/home/users/dae/jsm/python/lib:/usr/local/hdf5-1.8.11-linux-x86_64-shared/lib:/usr/local/mpich-install/lib:/usr/local/lib
 </code> </code>
 +We needed to manually specify the paths to avoid cmake finding old or incorrect versions of the libraries.
  
 Compile the libraries and tools: Compile the libraries and tools:
Line 151: Line 158:
 cd scons-2.3.0 cd scons-2.3.0
 python setup.py install --prefix=/home/users/dae/jsm/local python setup.py install --prefix=/home/users/dae/jsm/local
- 
  
 ## ATLAS + LAPACK + BLAS ## ATLAS + LAPACK + BLAS
Line 168: Line 174:
 ln -s /home/users/dae/jsm/local/atlas/lib/libcblas.a \ ln -s /home/users/dae/jsm/local/atlas/lib/libcblas.a \
   /home/users/dae/jsm/local/atlas/lib/libblas.a   /home/users/dae/jsm/local/atlas/lib/libblas.a
- 
  
 ## WCS ## WCS
Line 177: Line 182:
 make make
 make install make install
- 
  
 ## FFTW3 ## FFTW3
Line 192: Line 196:
 make  make 
 make install make install
- 
  
 ## Boost  ## Boost 
Line 203: Line 206:
 ./b2 install ./b2 install
 </code> </code>
 +
 +Some notes:
 +  * You should adapt the parameter "DPentiumCPS=2932" to your system. 
 +  * 
 +
  
 Compile casacore Compile casacore
Line 231: Line 239:
 <code bash> <code bash>
 ## pyrap ## pyrap
 +
 +# pyrap looks for libblas
 +cd /home/users/dae/jsm/local/atlas/lib
 +ln -s libcblas.a libblas.a
 +
 cd /home/users/dae/jsm/local/src cd /home/users/dae/jsm/local/src
 cd pyrap-1.1.0 cd pyrap-1.1.0
-## PATCH pyrap *******+## PATCH pyrap ******* (see next section)
 python batchbuild.py --boost-root=/home/users/dae/jsm/local \ python batchbuild.py --boost-root=/home/users/dae/jsm/local \
   --casacore-root=/home/users/dae/jsm/local/casacore \   --casacore-root=/home/users/dae/jsm/local/casacore \
Line 269: Line 282:
 #cp -r ~/LOFAR . #cp -r ~/LOFAR .
 cd LOFAR cd LOFAR
-### PATCH LOFAR ********+### PATCH LOFAR ******** (see next section)
 mkdir -p build/gnu_opt; cd build/gnu_opt mkdir -p build/gnu_opt; cd build/gnu_opt
 mkdir /home/users/dae/jsm/local/LofIm mkdir /home/users/dae/jsm/local/LofIm
Line 306: Line 319:
   * Configure .casarc   * Configure .casarc
  
-==== Patches needed ====+==== Patches and hacks needed ==== 
 + 
 +Pyrap and LOFAR need to be patched to allow them to compile in this old system. 
 + 
 +**Pyrap** tries to find the libraries in lib64 in a Red Hat linux. This happens even if the libraries are manually compiled and are located in a ''lib'' directory. If the user cannot create a symbolic link from ''lib64'' to ''lib'', pyrap needs to be patched. The ''lib64'' entries linked to ''redhat'' found in the setupext.py files and utils.py need to be edited to ''lib''
 +Edit: 
 +  * pyrap_fitting/current/setupext.py 
 +  * pyrap_functionals/current/setupext.py 
 +  * pyrap_images/current/setupext.py 
 +  * pyrap_measures/current/setupext.py 
 +  * pyrap_quanta/current/setupext.py 
 +  * pyrap_tables/current/setupext.py 
 +  * pyrap_util/current/setupext.py 
 +  * libpyrap/current/scons-tools/utils.py  
 + 
 +**Pyrap** cannot determine the location of some shared libraries in this old system. //Ugly hack// - The file ''libpyrap/current/SConstruct'' can be edited to ad some linker flags: 
 +After 
 +<code Python> 
 +    conf = Configure(env) 
 +</code> 
 +insert: 
 +<code Python> 
 +    conf.env.Append(LINKFLAGS = ["-Wl,-rpath,/home/users/dae/jsm/local/casacore/lib:/usr/local/hdf5-1.8.11-linux-x86_64-shared/lib:/home/users/dae/jsm/local/lib"]) 
 +</code> 
 + 
 +**Pyrap** looks for libblas instead of libcblas. A symbolic link can be made: 
 +<code bash> 
 +cd /home/users/dae/jsm/local/atlas/lib 
 +ln -s libcblas.a libblas.a 
 +</code> 
 + 
 +**LOFAR** uses the flag ''-Wno-ignored-qualifiers'' that is not supported by this old system. It has to be removed from the following files: 
 +  * CEP/Imager/LofarFT/src/CMakeLists.txt 
 +  * CEP/Calibration/BBSTools/src/CMakeLists.txt 
 +  * LCS/AMC/AMCImpl/src/CMakeLists.txt 
 + 
 +The version of cmake bundled in the system contains buggy versions of the recipes to find BLAS and LAPACK (FindBLAS.cmake and FIindLAPACK.cmake). Ii is possible to see in the CMakeCache.txt files that these libraries are not detected by CMAKE in this system (for example in the case of **casacore**). The manual setting of the cache variables //LAPACK_LIBRARIES// and //BLAS_LIBRARIES// made the compilation and linking work. The variables //LAPACK_INCLUDE// and //BLAS_INCLUDE// were ignored. But... take into account that these cache variables may not be present in modern compilations of cmake. 
 + 
 +//The ugliest hack// is this line in the cmake options of **LOFAR**:  
 +<code> 
 +-DCASA_CASA_LIBRARY=/home/users/dae/jsm/local/casacore/lib/libcasa_casa.so\;/home/users/dae/jsm/local/atlas/lib/libf77blas.a\;/home/users/dae/jsm/local/atlas/lib/libcblas.a\;/home/users/dae/jsm/local/atlas/lib/libatlas.a\;/home/users/dae/jsm/local/atlas/lib/liblapack.a 
 +</code> 
 +The library librfiengine.so is linked with dependencies to LAPACK (and this can present dependencies with BLAS). These dependencies are not linked in some of the remaining packages because they are not a direct dependency but the linker will fail. We overrided the cache variable pointing to one of the casacore libraries. Wherever librfiengine.so is linked, the libcasa_casa.so is linked as well. This ugly thing worked.
  
-pyrap and LOFAR need to be patched to allow them to compile in this old system.+==== Warnings and advice ====
  
-===== Problems =====+  * Compile the libraries with the ''shared'' option (-fPIC in the compiler). 
 +  * The tools ''ldd'' and ''nm'' could help you to debug problems with the linking of libraries. 
 +  * Have a look to CMakeCache.txt before running cmake to spot possible problems with the libraries. 
 +  * If you use the ifort FORTRAN compiler you might find problems with the linking of ifort shared libraries.  
 +  * Cmake could find some of the casapy libraries and link them as dependencies. If you want to avoid that you should specify the cache variables by hand (as it is done in this example). 
 +  * To link to precompiled external libraries (like the ones provided by casapy or Anaconda) might be a bad idea. 
 +  * The option "--blas" of pyrap did not work and made the build script fail. 
 +  * Final advice: Try to work on modern systems (e. g. Ubuntu 12.04 LTS) if you can :). 
 + 
  • Last modified: 2017-03-08 15:27
  • by 127.0.0.1