Since december 2016, AOFlagger is available in Debian and Ubuntu. All one need to do to install it on Debian/Ubuntu system is:
sudo apt-get install aoflagger
The following document lists some instructions that can be helpful for installing AOFlagger on Red Hat: Installing AOFlagger on rhel 7.6 (Thanks to Leonardo Saavedra from NRAO).
If you are unsure about installing AOFlagger and you are installing it for the first time, take this into account:
The following libraries are required to build the AOFlagger:
Casacore, for opening measurement sets.
Version >=2.0 is required (since AOFlagger 2.8 -- older version of AOFlagger could compile with casacore >=1.5). Casacore is required even if you already have Casa installed. Since AOFlagger 2.8, Casacore needs to be compiled with C++11 compilation turned on. Casacore can be compiled with C++11 by adding -DCXX11="ON" to Casacore's cmake command.
FFTW, used to perform Fourier transformations.
Boost, used for date and time calculations, python connections and some other general functionalities.
Lua, the language used by AOFlagger for defining flagging strategies (since AOFlagger 2.15).
libxml, used for saving scripts / configurations.
CLAPACK, for linear algebra, such as singular value decomposition.
CFITSIO, for reading and writing FITS files.
gtkmm (only for rfigui and other graphical programs, but you probably want that). Version 3.10 or later is required (since AOFlagger 2.7; AOFlagger version 2.5 required gtkmm >= 3.0; earlier versions required gtkmm 2.x).
The gtkmm libraries and headers are required for the gui but not for the console executable. If they are not present, cmake will warn about it, but will compile the console programs nevertheless.
I disencourage you to compile gtkmm yourself; it has many dependencies. Rather use your package manager (or ask your system administrator). Debian ships this library as "libgtkmm-3.0-dev". Here is an apt command for Debian / Ubuntu systems that installs everything except Casacore:
apt-get install liblua5.3-dev libfftw3-dev libboost-dev libboost-date-time-dev \
libboost-filesystem-dev libboost-numpy-dev libboost-python-dev libboost-system-dev libboost-signals-dev \
libboost-thread-dev libxml2-dev liblapack-dev libcfitsio-dev libgtkmm-3.0-dev \
cmake g++ libpng-dev
(this will install several other dependencies along as well)
Note: Certain versions of Ubuntu ship the lapack packages as "liblapack3gf". On new Debian/Ubuntu machines, there is a casacore-dev package available which makes it possible to skip compiling casacore by hand.
The quick summary to compile and install, from the aoflagger root directory:
mkdir build
cd build/
cmake ../
make -j 4
sudo make install
This will normally work when you have installed all libraries in their default locations. If you have not done so, you might need to tell cmake where the libraries are. The easiest way to do this is by adding search paths to cmake, e.g.:
cmake ../ -DCMAKE_PREFIX_PATH=/opt/cep/casacore/
This will include /opt/cep/casacore to the search path. Multiple paths can be specified by separating them with a colon ':'. Alternatively, if for some reason you need to specify individual libraries, the syntax is:
cmake ../ -DCASA_INCLUDE_DIR=/home/anoko/casacore/include -DCASA_MS_LIB=.. [..etc..]
One can set the -D... defines to the appropriate paths when CMake can not automatically find them. To override the casacore libraries, you have to set the following variables:
CASA_MS_LIB
CASA_TABLES_LIB
CASA_CASA_LIB
CASA_MEASURES_LIB
CASA_INCLUDE_DIR
The 'make install' statement will install the binaries [aoflagger], [rfigui], [aoqplot] and [aoquality], and will install the library 'libaoflagger' together with its header aoflagger.h. If you do not have administrator or sudo rights, you can install the software to a different location by specifying a CMAKE_INSTALL_PREFIX when calling cmake, e.g.:
cmake ../ -DCMAKE_INSTALL_PREFIX=/home/esmeralda/
The Python lib that is necessary to use the Python interface, are build by default, but currently there's no direct way to have the python aoflagger lib installed in your Python path. After compilation, the python library is called aoflagger.so and placed in aoflagger/build/src. It is possible to use the interface (e.g. do import aoflagger) in Python as long as the lib is manually put in the python path. (I hope this get fixed soon, but the Python 2 to 3 transition + state of debian boost python made this rather hard).
As of yet (2019-09-21; aoflagger 2.14.1) only trunk has good support for interfacing with Python. As long as 2.15 has not been released, make sure to use the latest master version of aoflagger (from git), as the Python interface is much more complete in master.
To build AOFlagger so that it can be linked with NDPPP, it is necessary to make shared libraries. This is in most cases not the default. The normal way to build shared libraries is by specifying "-DBUILD_SHARED_LIBS=ON" to cmake, for example:
cmake ../ -DBUILD_SHARED_LIBS=ON
Once you have installed AOFlagger (with make install), NDPPP should now automatically find the library.
To build AOFlagger so that it can run on any machine, add -DPORTABLE=True to the cmake command line:
:::bash
cmake ../ -DPORTABLE=True
Wiki: Home
Wiki: Installation instructions RHEL 7.6
Wiki: aoflagger
Wiki: aoqplot
Wiki: changelog-2.8.0
Wiki: python_interface
Wiki: rfigui