-
Notifications
You must be signed in to change notification settings - Fork 46
/
install-opensuse-dependencies.sh
executable file
·143 lines (130 loc) · 3.06 KB
/
install-opensuse-dependencies.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#!/bin/bash
#
# This script is used for installing the dependencies required for
# building opencog on openSUSE.The script has been tested using docker
# image opensuse:13.2
# It is provided for those on 32-bit system or don't want to use
# If you encounter an issue don't hesitate to supply a patch on github.
# TODO Make it work
# trap errors
set -e
# Environment Variables
SELF_NAME=$(basename $0)
# Some tools
PACKAGES_TOOLS="
git \
python-pip \
wget \
"
# Packages for building opencog
# FIXME cxxtest and tbb are not installaed
PACKAGES_BUILD="
gcc \
make \
cmake \
cxxtest \
rlwrap \
guile \
libicu-devel \
libzip2 \
python-Cython \
python-devel \
python-pyzmq \
python-simplejson \
boost-devel \
libzmq3 \
zeromq-devel \
binutils-devel \
libgsl0 gsl-devel \
unixodbc-devel \
uuid-devel \
libprotobuf-c-devel \
libSDL_gfx-devel \
libssl27 \
tcl \
tcsh \
freetype2-devel \
libatlas3 \
gcc-fortran \
"
# Packages required for integrating opencog with other services
PACKAGES_RUNTIME="
unixODBC-devel \
psqlODBC \
postgresql \
"
# Template for messages printed.
message() {
echo -e "\e[1;34m[$SELF_NAME] $MESSAGE\e[0m"
}
# Install json-spirit (4.05)
install_json_spirit(){
MESSAGE="Installing json-spirit library...." ; message
cd /tmp
export BOOST_ROOT=/usr/include/boost/
wget http://http.debian.net/debian/pool/main/j/json-spirit/json-spirit_4.05.orig.tar.gz
tar -xvf json-spirit_4.05.orig.tar.gz
cd json_spirit_v4_05
mkdir build
cd build/
cmake ..
make -j$(nproc)
sudo make install
cd ../..
rm -rf json-spirit_4.05.orig.tar.gz json_spirit_v4_05
}
# Install cogutil
install_cogutil(){
MESSAGE="Installing cogutil...." ; message
cd /tmp/
wget https://github.com/opencog/cogutil/archive/master.tar.gz
tar -xvf master.tar.gz
cd cogutil-master/
mkdir build
cd build/
cmake ..
make -j$(nproc)
sudo make install
cd ../..
rm -rf master.tar.gz cogutil-master/
}
# Install Python Packages
install_python_packages(){
MESSAGE="Installing python packages...." ; message
cd /tmp
wget https://raw.githubusercontent.com/opencog/opencog/master/opencog/python/requirements.txt
sudo pip install -U -r /tmp/requirements.txt
rm requirements.txt
}
# Install AtomSpace
install_atomspace(){
MESSAGE="Installing atomspace...." ; message
cd /tmp/
wget https://github.com/opencog/atomspace/archive/master.tar.gz
tar -xvf master.tar.gz
cd atomspace-master/
mkdir build
cd build/
cmake ..
make -j$(nproc)
sudo make install
cd ../..
rm -rf master.tar.gz atomspace-master/
}
# Function for installing all required dependenceis for building OpenCog,
# as well as dependencies required for running opencog with other services.
install_dependencies() {
MESSAGE="Installing OpenCog build dependencies...." ; message
# FIXME Haven't figured out which package is making this check fail.
if ! (zypper --no-refresh install $PACKAGES_BUILD $PACKAGES_RUNTIME $PACKAGES_TOOLS);
then
MESSAGE="Error installing some of dependencies... :( :(" ; message
exit 1
fi
install_json_spirit
install_python_packages
install_cogutil
install_atomspace
}
# Main Program
install_dependencies