You need following dependencies to install/run BAYGAUD properly;
gcc
g++
gfortran
tcsh
make
cmake
automake
git
Open MPI
CFITSIO
GSL
ATLAS
MultiNest_v3.10 (MPI off)
These can be installed with Ubuntu package manager, if you're working in Ubuntu.
Just type in following commands to proceed:
sudo apt install gcc
sudo apt install g++
sudo apt install gfortran
sudo apt install tcsh
sudo apt install make
sudo apt install cmake
sudo apt install automake
sudo apt install git
sudo apt install libopenmpi-dev
sudo apt install libcfitsio-dev
sudo apt install libgsl-dev
sudo apt install libatlas-base-dev
Then, add following in your .bashrc or .tcshrc
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
or
setenv LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
Among those, however, MultiNest isn't available from Ubuntu package manager and thus should be build manually.
Followings are how to do so.
Make and enter a directory for Multinest installation.
Here, for example, we're going to build under ~/lib/multinest_3.10_mpioff
mkdir ~/lib/multinest_3.10_mpioff & cd ~/lib/multinest_3.10_mpioff
git clone https://github.com/JohannesBuchner/MultiNest.git
This should generate files under MultiNest directory.
Let's build now;
cd MultiNest
cd build
cmake ..
make -j<# of cores>
sudo make install
cd ../src
cp ../modules/* .
To use Multinest in MPI off figure, .f90 and .F90 should be renamed with _mpioff.f90 and _mpioff.F90 respectively.
To do so, try following in terminal (this method works in bash)
for file in *.f90
do
mv "$file" "${file%.f90}_mpioff.f90"
done
And
for file in *.F90
do
mv "$file" "${file%.F90}_mpioff.F90"
done
These commands should rename the listed files properly.
Now run these commands:
gfortran -O3 -ffree-line-length-none -fPIC -c -o kmeans_clstr_mpioff.o kmeans_clstr_mpioff.f90
gfortran -O3 -ffree-line-length-none -fPIC -c -o priors_mpioff.o priors_mpioff.f90
gfortran -O3 -ffree-line-length-none -fPIC -c -o utils1_mpioff.o utils1_mpioff.f90
gfortran -O3 -ffree-line-length-none -fPIC -c -o utils_mpioff.o utils_mpioff.f90
gfortran -O3 -ffree-line-length-none -fPIC -c -o xmeans_clstr_mpioff.o xmeans_clstr_mpioff.f90
gfortran -O3 -ffree-line-length-none -fPIC -c -o nested_mpioff.o nested_mpioff.F90
gfortran -O3 -ffree-line-length-none -fPIC -c -o posterior_mpioff.o posterior_mpioff.F90
ld -shared /usr/lib/x86_64-linux-gnu/liblapack.so.3 -lpthread -o libnest3_mpioff.so utils_mpioff.o utils1_mpioff.o priors_mpioff.o kmeans_clstr_mpioff.o xmeans_clstr_mpioff.o posterior_mpioff.o nested_mpioff.o
ar cr libnest3_mpioff.a utils_mpioff.o utils1_mpioff.o priors_mpioff.o kmeans_clstr_mpioff.o xmeans_clstr_mpioff.o posterior_mpioff.o nested_mpioff.o
sudo cp libnest3_mpioff.so /usr/lib/x86_64-linux-gnu
Finally, set environments in your .bashrc or .tcshrc:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
or
setenv LD_LIBRARY_PATH usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
source ~/.bashrc (or .tcshrc)
And you're done preparing!
<TEMP. ARTICLE>
Installing Multinest MPIoff using multinest.3.10_MPIoff.tgz file on server
Untar the tar file
For here, under ~/lib for example
cd ~/lib
tar xvzf multinest.3.10_MPIoff.tgz
cd multinest.3.10_MPIoff
cd MultiNest-master
cd src
./multinest_comp.csh
Then, add LD_LIBRARY_PATH in your .tcshrc:
setenv LD_LIBRARY_PATH ~/lib/multinest.3.10_MPIoff/MultiNest-master/src:$LD_LIBRARY_PATH
It should point where libnest3_mpioff.so is.
Source the tcshrc
source ~/.tcshrc
Temp. source directory
/media/cusped01/hjpark/baygaud.v1.3.0.tar
Bring it to where you feel comfortable and untar it
In this example, under ~/lib
cd ~/lib
tar xvf baygaud.v1.3.0.tar
You should be able to see setup_baygaud.sh in the extracted directory.
You can either directly modify the file and set the path, or just simply run the script by typing:
./setup_baygaud.sh
And it will show up like this:
Give shell the path for Multinest_mpioff, follow up for CFITSIO, and GSL.
For Multinest_MPIoff, we previously set under ~/lib/multinest.3.10_MPIoff/MultiNest-master/src
So give
~/lib/multinest.3.10_MPIoff/MultiNest-master/src
Next for CFITSIO and GSL, give
/usr/lib/x86_64-linux-gnu
Then the shell will run configure itself and be ready to make.
Without any error, type in make
make
Now it's done and ready to go!
To quick test, move to <baygaud_dir>/src/bin and run baygaud
cd src/bin
./baygaud
And it should show up like the image below, if it's installed properly
BAYGAUD supports GUI with baygaudGUI.py
To use it, you need following dependencies:
From apt repository
python3-tk
libbz2-dev
And, from pip3
glob2
matplotlib
numpy
astropy
spectral_cube
natsort
tqdm
fitsio
To install these, type following commands in your terminal
sudo apt install python3-tk
sudo apt install libbz2-dev
pip3 install glob2
pip3 install matplotlib
pip3 install numpy
pip3 install astropy
pip3 install spectral_cube
pip3 install natsort
pip3 install tqdm
pip3 install fitsio
After that, baygaudGUI.py can be run with
python3 baygaudGUI.py