sagecal/INSTALL.md

145 lines
4.5 KiB
Markdown
Raw Normal View History

2018-08-28 15:43:14 +08:00
di 28 aug 2018 9:37:58 CEST
# SAGECal Installation
2017-11-16 23:13:07 +08:00
## Cmake Build
### Requirements
#### Ubuntu (tested with 16.04)
2018-08-28 15:48:34 +08:00
- Add KERN repository. Instructions can also be found at [http://kernsuite.info/](http://kernsuite.info/)
2018-02-28 17:14:58 +08:00
```
sudo apt-get install software-properties-common
sudo add-apt-repository -s ppa:kernsuite/kern-3
sudo apt-add-repository multiverse
sudo apt-get update
```
2018-02-28 17:12:02 +08:00
- Install following packages:
```
2018-02-28 18:20:06 +08:00
sudo apt-get install -y git cmake g++ pkg-config libcfitsio-bin libcfitsio-dev libopenblas-base libopenblas-dev wcslib-dev wcslib-tools libglib2.0-dev libcasa-casa2 casacore-dev casacore-data casacore-tools
```
#### Other systems
- Install equivalent packages for your distribution
- g++
- cmake
- git
- pkg-config
- openblas
- libglib2.0-dev
- follow the instructions at
[https://github.com/casacore/casacore](https://github.com/casacore/casacore) to install casacore.
2018-08-28 15:43:14 +08:00
- Additional packages (not essential, but recommended): MPI (openmpi), FFTW
### Building
2018-02-28 17:00:24 +08:00
- Clone the repository
```
2018-08-27 23:46:06 +08:00
git clone -b master https://git@github.com/nlesc-dirac/sagecal.git
2018-02-28 17:00:24 +08:00
```
2018-08-28 15:48:34 +08:00
- Build SAGECal
```
mkdir build && cd build
cmake .. -DENABLE_CUDA=OFF
```
2018-08-28 15:48:34 +08:00
**OPTIONAL:** You can also define a custom casacore path:
```
cmake .. -DCASACORE_ROOT_DIR=/opt/soft/casacore/ -DENABLE_CUDA=OFF
```
2018-08-28 15:48:34 +08:00
**OPTIONAL:** You can also define a custom paths to everything:
```
cmake -DCFITSIO_ROOT_DIR=/cm/shared/package/cfitsio/3380-gcc-4.9.3 -DCASACORE_ROOT_DIR=/cm/shared/package/casacore/v2.3.0-gcc-4.9.3 -DWCSLIB_INCLUDE_DIR=/cm/shared/package/wcslib/5.13-gcc-4.9.3/include -DWCSLIB_LIBRARY=/cm/shared/package/wcslib/5.13-gcc-4.9.3/lib/libwcs.so -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DCMAKE_LINKER=/cm/shared/package/gcc/4.9.3/bin/gcc -DCMAKE_CXX_FLAGS=-L/cm/shared/package/cfitsio/3380-gcc-4.9.3/lib -DCMAKE_C_FLAGS=-L/cm/shared/package/cfitsio/3380-gcc-4.9.3/lib ..
```
2018-08-28 15:43:14 +08:00
Compile with:
```
2018-08-28 15:43:14 +08:00
make
```
Install at your favorite place
```
make DEST=/path/to/sagecal/dir install
```
2018-02-28 17:12:02 +08:00
2018-08-28 16:04:19 +08:00
- The sagecal executable can be found in **/path/to/sagecal/dir/usr/local/bin**, also **sagecal-mpi**,**buildsky** and **restore** might be installed depending on the availability of MPI and WCSLIB/FFTW.
2018-02-28 17:12:02 +08:00
### Via Anaconda (WIP)
```
conda install -c sagecal=0.6.0
```
## Manual installation
2018-08-28 16:04:19 +08:00
For expert users, and for custom architectures (GPU), the manual install is recommended.
2018-08-28 15:48:34 +08:00
### 1 Prerequisites:
2014-01-07 06:07:07 +08:00
- CASACORE http://casacore.googlecode.com/
- glib http://developer.gnome.org/glib
- BLAS/LAPACK
Highly recommended is OpenBLAS http://www.openblas.net/
2015-08-20 19:51:34 +08:00
Also, to avoid any linking issues (and to get best performance), build OpenBLAS from source and link SAGECal with the static library (libopenblas***.a) and NOT libopenblas***.so
2014-01-07 06:07:07 +08:00
- Compilers gcc/g++ or Intel icc/icpc
- If you have NVIDIA GPUs,
-- CUDA/CUBLAS/CUSOLVER and nvcc
-- NVML Nvidia management library
2014-01-07 06:07:07 +08:00
- If you are using Intel Xeon Phi MICs.
-- Intel MKL and other libraries
2018-08-28 16:04:19 +08:00
- Get the source for SAGECal
```
git clone -b master https://git@github.com/nlesc-dirac/sagecal.git
```
2018-02-26 22:22:26 +08:00
### 2 The basic way to build is
2018-08-28 16:04:19 +08:00
1.a) go to ./src/lib/Dirac and ./src/lib/Radio and run make (which will create libdirac.a and libradio.a)
2014-01-07 06:07:07 +08:00
1.b) go to ./src/MS and run make (which will create the executable)
### 3 Build settings
2017-11-16 23:13:07 +08:00
In ./src/lib and ./src/MS you MUST edit the Makefiles to suit your system. Some common items to edit are:
2014-01-07 06:07:07 +08:00
- LAPACK: directory where LAPACK/OpenBLAS is installed
- GLIBI/GLIBL: include/lib files for glib
2015-11-05 04:15:35 +08:00
- CASA_LIBDIR/CASA_INCDIR/CASA_LIBS : casacore include/library location and files:
Note with new CASACORE might need two include paths, e.g.
-I/opt/casacore/include/ -I/opt/casacore/include/casacore
- CUDAINC/CUDALIB : where CUDA/CUBLAS/CUSOLVER is installed
- NVML_INC/NVML_LIB : NVML include/lib path
2014-01-07 06:07:07 +08:00
- NVCFLAGS : flags to pass to nvcc, especially -arch option to match your GPU
- MKLROOT : for Intel MKL
Example makefiles:
Makefile : plain build
Makefile.gpu: with GPU support
2018-04-04 22:28:42 +08:00
Note: Edit ./lib/Radio/Radio.h MAX_GPU_ID to match the number of available GPUs, e.g., for 2 GPUs, MAX_GPU_ID=1
2018-08-28 16:04:19 +08:00
## SAGECAL-MPI Manual Installation
This is for manually installing the distributed version of sagecal (sagecal-mpi), the cmake build will will work for most cases.
2017-11-16 23:13:07 +08:00
## 1 Prerequsites:
2018-08-28 16:04:19 +08:00
- Same as for SAGECal.
- MPI (e.g. OpenMPI)
2017-11-16 23:13:07 +08:00
## 2 Build ./src/lib as above (using mpicc -DMPI_BUILD)
## 3 Build ./src/MPI using mpicc++
2017-11-16 23:13:07 +08:00
## BUILDSKY Installation
2017-11-16 23:13:07 +08:00
- See INSTALL in ./src/buildsky
2017-11-16 23:13:07 +08:00
## RESTORE Installation
2017-11-16 23:13:07 +08:00
- See INSTALL in ./src/restore