-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall-lhapdf.sh
executable file
·74 lines (62 loc) · 1.48 KB
/
install-lhapdf.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
67
68
69
70
71
72
73
74
#!/bin/bash
VERSION=6.2.3
rm -r lhapdf6 >& /dev/null
mkdir -p lhapdf6
cd lhapdf6
echo "Installing LHAPDF version $VERSION"
rm pdfinstall.log >& /dev/null
rm -r bin include lib share LHAPDF-${VERSION} >& /dev/null
echo "Downloading tar file..."
wget http://www.hepforge.org/archive/lhapdf/LHAPDF-${VERSION}.tar.gz --no-check-certificate
tar -xzvf LHAPDF-${VERSION}.tar.gz
rm LHAPDF-${VERSION}.tar.gz
cd LHAPDF-${VERSION}
echo "Configuring..."
export CPPFLAGS="-P"
./configure --prefix=`cd .. && pwd` --disable-python
if [[ $? != 0 ]]
then
echo "Error on configuration, check pdfinstall.log"
exit -1
fi
echo "Compiling..."
make >& pdfinstall.log
if [[ $? != 0 ]]
then
echo "Error on compilation, check pdfinstall.log"
exit -1
fi
echo "Installing..."
make install >& pdfintall.log
if [[ $? != 0 ]]
then
echo "Error on installation, check pdfinstall.log"
exit -1
fi
cd ..
echo "LHAPDF software installation completed"
echo "Downloading PDF sets..."
pdflist=`cat ../pdfsets.list`
cd share/LHAPDF
for pdf in $pdflist
do
pdf=`echo $pdf | cut -d. -f1`
if [[ -e $pdf ]]
then
continue
fi
wget http://lhapdfsets.web.cern.ch/lhapdfsets/current/${pdf}.tar.gz >& /dev/null
if [[ $? != 0 ]]
then
echo "$pdf download failed"
continue
fi
tar -xzvf ${pdf}.tar.gz >& /dev/null
echo "Extraction complete!"
rm ${pdf}.tar.gz
done
cd ../..
cd LHAPDF-${VERSION}
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$(pwd)
echo "Added $PWD to PKG-CONFIG path."
cd ../../