-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup_heasoft.sh
54 lines (39 loc) · 1.51 KB
/
setup_heasoft.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
#!/bin/bash
#Currently built for the Department of Astronomy - University of Maryland
#Arguments from command line
heasoftVersion=$1 #Heasoft verison to set up
destinationDir=$2 #Relative (or absolute) path directory where to place the HEASoft directory
cshrcFile=$3 #Path to .cshrc file
#System archetecture (current)
archName="x86_64-unknown-linux-gnu-libc2.17"#"x86_64-pc-linux-gnu-libc2.17"
#Finding absolute path to current location to return user after completed
originalLocation=$(pwd)
#HEASoft tar.gz (gzip tarball)
heasoftFile="heasoft-${heasoftVersion}src.tar.gz"
#URL for download for HEASoft with all moddern packages
heasoftUrl="https://heasarc.gsfc.nasa.gov/FTP/software/lheasoft/lheasoft${heasoftVersion}/${heasoftFile}"
#Going to directory
cd ${destinationDir}
#Finding absolute path of destination directory (useful for later)
absolutePathDestination=$(pwd)
#Downloading XSPEC tar.gz file
wget ${heasoftUrl}
#Unzipping tar.gz file
tar -xvf ${heasoftFile}
rm -f ${heasoftFile}
#Finding absolute path of destination directory (useful for later)
absolutePathDestination=$(pwd)
#Going to BUILD_DIR for installation
cd "heasoft-${heasoftVersion}"
cd BUILD_DIR
#Running configuration script
./configure
#Running makefile
make
make install
#Adding the necessary components to the .cshrc file
heaDir="${absolutePathDestination}/heasoft-${heasoftVersion}/${archName}"
echo "setenv HEADAS ${heaDir}" >> $cshrcFile
echo "alias heainit "source \$HEADAS/headas-init.csh"" >> $cshrcFile
#Returning user
cd ${originalLocation}