Skip to content

install DownloadCompile

Jared R. Males edited this page Jun 19, 2022 · 6 revisions

1. Download and install milk

1.1. Download and compile

1.2. Post-installation

You may need to add /usr/local/lib to LD_LIBRARY_PATH environment variable:

echo "/usr/local/lib" > usrlocal.conf
sudo mv usrlocal.conf /etc/ld.so.conf.d/
sudo ldconfig -v

1.3. tmpfs (optional) {#milkinstall_tmpfs}

OPTIONAL: Create tmpfs disk for high performance I/O:

echo "tmpfs /milk/shm tmpfs rw,nosuid,nodev" | sudo tee -a /etc/fstab
sudo mkdir -p /milk/shm
sudo mount /milk/shm

Next define the MILK_SHM_DIR environment variable by adding the following line to /etc/profile.d/milk.sh or your ~/.bash_aliases file:

export MILK_SHM_DIR=/milk/shm

1.4 Path Setup

Setup the PATH environment variable to point to the milk binary. First it is useful to create a symbolic link to the current version of milk (see below for information about running multiple versions). Run the command:

$ sudo ln -s /usr/local/milk-<version> /usr/local/milk

Next add the milk/bin directory to your PATH by creating and editing /etc/profile.d/milk.sh to add the following line or adding the following line to your ~/.bash_aliases file:

export PATH=${PATH}:/usr/local/milk/bin

1.5 Linker Setup

To allow the dynamic linker to find the milk libraries, create the file /etc/ld.so.conf.d/milk.conf (requires sudo) and add the following line to it:

/usr/local/milk/lib

and then run the command

$ sudo ldconfig

2. Dependencies

2.1. Libraries

Libraries required :

  • gcc
  • openMP
  • fitsio
  • fftw (single and double precision), for performing Fourier Transforms
  • gsl
  • readline, for reading the command line input
  • tmux
  • bash dialog, version 1.2 minimum
  • flex, for parsing the command line input
  • bison, to interpret the command line input
  • gsl, for math functions and tools

Install above libraries (centOS):

sudo yum install readline-devel flex bison-devel fftw3-devel gsl-devel

Install above libraries (Ubuntu):

sudo apt-get install libcfitsio3 libcfitsio3-dev libreadline6-dev libncurses5-dev libfftw3-dev libgsl0-dev flex bison

Install above libraries (Ubuntu-20.04.3 LTS):

sudo apt-get install libcfitsio-dev libreadline-dev libncurses5-dev libfftw3-dev libgsl-dev flex bison

2.2. FITSIO install

For reading and writing FITS image files

./configure --prefix=/usr
make 
sudo make install 

2.3. GPU acceleration (optional, but highly recommended)

Required libraries:

  • install NVIDIA driver
  • install CUDA
  • install MAGMA

No package 'magma' found

configure script uses pkg-config to find the package. You need to add in .bashrc :

export PKG_CONFIG_PATH=/usr/local/magma/lib/pkgconfig

3. Running multiple versions

@warning Untested, may require tweaking

To install independant versions on the same system, download source code in separate source directories:

cd $HOME/src
git clone --recursive https://github.com/milk-org/milk milk-1
git clone --recursive https://github.com/milk-org/milk milk-2

Compile each copy with a different target directory :

cd $HOME/src/milk-1
mkdir _build
cd _build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/milk-1 ..
sudo make install
cd $HOME/src/milk-2
mkdir _build
cd _build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/milk-2 ..
sudo make install

To make version 1 the default on the system :

sudo ln -s /usr/local/milk-1 /usr/local/milk

To run an instance of version 2 :

LD_LIBRARY_PATH=/usr/local/milk-2/lib PATH=/usr/local/milk-2/bin milk

Additionally, each version may have its own independent shared memory space for streams :

MILK_SHM_DIR=/milk-2/shm LD_LIBRARY_PATH=/usr/local/milk-2/lib PATH=/usr/local/milk-2/bin milk