-
Notifications
You must be signed in to change notification settings - Fork 68
/
install-ubuntu-dependencies.sh
executable file
·54 lines (48 loc) · 1.53 KB
/
install-ubuntu-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
#!/bin/bash
#
# RelEx install script for Ubuntu/Debian systems
# Tested on Ubuntu 12.04 LTS (Precise Pangolin)
# Tested on Ubuntu 14.04 LTS (Trusty Tahr)
#
# Usage:
# git clone https://github.com/opencog/relex
# cd relex
# install-scripts/install-ubuntu-dependencies.sh
# (note: will ask for sudo password)
# ant run
#
# Authors: David Hart, Cosmo Harrigan
## Ubuntu/Debian Packages
sudo apt-get -y update
sudo apt-get -y install build-essential python-dev swig zlib1g-dev unzip wget
sudo apt-get -y install wordnet-dev wordnet-sense-index
sudo apt-get -y install openjdk-9-jdk
sudo apt-get -y install maven
# Link Grammar
wget -r --no-parent --no-check-certificate -nH --cut-dirs=3 http://www.abisource.com/downloads/link-grammar/current/
tar -xvf link-grammar-5.*.tar.gz
rm link-grammar-5.*.tar.gz*
rm -rf index.html* robots.txt
pushd link-grammar-5.*
JAVA_HOME=/usr/lib/jvm/java-9-openjdk-amd64 ./configure
make -j6
sudo make install
sudo ln -v -s /usr/local/lib/liblink-grammar.so.5 /usr/lib/liblink-grammar.so.5
popd
sudo ldconfig
MVN_USER=`whoami`
LINKGRAMMAR_JAR=`find ./link-grammar* -name linkgrammar*.jar`
LINKGRAMMAR_VERSION=`echo $LINKGRAMMAR_JAR | grep -oP '(?<=-)\d+\.\d+\.\d+(?=\.)'`
if grep -q '^vagrant:' /etc/passwd; then
cd /home/vagrant/relex
MVN_USER=vagrant
fi
sudo -u $MVN_USER mvn install:install-file \
-Dfile=$LINKGRAMMAR_JAR \
-DgroupId=org.opencog \
-DartifactId=linkgrammar \
-Dversion=$LINKGRAMMAR_VERSION \
-Dpackaging=jar
# RelEx
sudo -u $MVN_USER mvn package
sudo -u $MVN_USER mvn install