-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprerequisites.sh
66 lines (54 loc) · 1.92 KB
/
prerequisites.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
$PREFIX=/path/to/third-party-libraries/installation/directory
# Install fftw
wget http://www.fftw.org/fftw-3.3.8.tar.gz
tar -xvf fftw-3.3.8.tar.gz
mv fftw-3.3.8 fftw
cd fftw
./configure --prefix=$PREFIX/fftw --enable-shared
make CFLAGS=-fPIC
make install
cd ..
# Install cfitsio
wget http://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-3.47.tar.gz
tar -xvf cfitsio-3.47.tar.gz
mv cfitsio-3.47 cfitsio
cd cfitsio
./configure --prefix=$PREFIX/cfitsio
make
make install
cd ..
# Install CCfits
wget https://heasarc.gsfc.nasa.gov/fitsio/CCfits/CCfits-2.5.tar.gz
tar -xvf CCfits-2.5.tar.gz
cd CCfits
./configure --prefix=$PREFIX/CCfits --with-cfitsio=$PREFIX/cfitsio
make
make install
cd ..
# Install libpng
wget https://sourceforge.net/projects/libpng/files/libpng16/1.6.37/libpng-1.6.37.tar.gz
tar -xvf libpng-1.6.37.tar.gz
cd libpng-1.6.37
./configure --prefix=$PREFIX/libpng
make check
sudo make install
cd ..
# OPTIONAL: Install jsoncpp
#########################################################################################################
git clone https://github.com/open-source-parsers/jsoncpp.git
cd jsoncpp
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=ON -DARCHIVE_INSTALL_DIR=. -DCMAKE_INSTALL_PREFIX=$PREFIX/jsoncpp -G "Unix Makefiles" ..
make
sudo make install
cd ..
# ATTENTION!!! Add the following environment variables to your .bashrc file (or equivalent)
#########################################################################################################
CPATH=$CPATH:$PREFIX/fftw/include:$PREFIX/cfitsio/include:$PREFIX/CCfits/include:$PREFIX/libpng/include:$PREFIX/jsoncpp/include
LIBRARY_PATH=$LIBRARY_PATH:$PREFIX/fftw/lib:$PREFIX/cfitsio/lib:$PREFIX/CCfits/lib:$PREFIX/libpng/lib:$PREFIX/jsoncpp/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/fftw/lib:$PREFIX/cfitsio/lib:$PREFIX/CCfits/lib:$PREFIX/libpng/lib:$PREFIX/jsoncpp/lib
echo $CPATH
echo $LIBRARY_PATH
echo $LD_LIBRARY_PATH