-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure
executable file
·71 lines (62 loc) · 2.19 KB
/
configure
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
#!/bin/bash
# checking if the Enviroment variable is already configured
if [ $LIBDEEP_DIR ]
then
echo "# The Enviroment variable LIBDEEP_DIR=${LIBDEEP_DIR} is already set, nothing to do here."
exit
fi
########## Checking the other libraries Enviroment Variables ##########
if [ $OPF_DIR ]
then
echo "OPF_DIR:... OK!"
else
tput setaf 1; echo "ERROR: You should configure and compile LibOPF first."; tput sgr0
echo "Exiting due to the previous errors..."
exit
fi
####################################################
########## GSL DOWNLOAD AND CONFIGURATION ##########
# checking GSL existence
# if is gretter than one the GSL library is probably installed.
if [ $(whereis libgsl | wc -w) -gt 1 ]
then
echo "GNU Scientific Library (GSL) is already installed, nothing to do here."
else
printf "We will now perform the GNU Scientific Library (GSL) configuration and instalation. \n\n"
# creating a temporary directory
mkdir tmp
# downloading the lastest version of the GNU Scientific Library (GSL)
wget ftp://ftp.gnu.org/gnu/gsl/gsl-latest.tar.gz -P tmp/
# extracting the downloaded file
tar -xf tmp/gsl-latest.tar.gz -C tmp/
# entering the GSL directory
cd tmp/gsl*/
# executiong the configuration file of the GSL
./configure
# compiling the GSL library
make
# installing the GSL library
make install
# returning to the original directory
cd ..
# deleting the temporary folder
rm -r tmp/
fi
####################################################
########## Enviroment Variable Configuration ##########
# adding the environment variable of the LibDEEP library to the .bashrc
# checking if the Enviroment variable is already configured
if [ $LIBDEEP_DIR ]
then
echo "# The Enviroment variable LIBDEEP_DIR=${LIBDEEP_DIR} is already set, nothing to do here."
else
LIBDEEP_DIR=$(pwd)
echo "Adding Enviroment variable to ${LIBDEEP_DIR}."
echo "" >> ~/.bashrc
echo "# added by LibDEEP" >> ~/.bashrc
echo "export LIBDEEP_DIR=${LIBDEEP_DIR}" >> ~/.bashrc
echo "Please run the following on your current shell:"
echo "source ~/.bashrc"
echo "Or close this shell session and open a new one."
fi
####################################################