/[projects]/misc/osrm-scripts/start-osrm.sh
ViewVC logotype

Contents of /misc/osrm-scripts/start-osrm.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3174 - (show annotations) (download) (as text)
Mon Dec 19 13:41:28 2016 UTC (7 years, 5 months ago) by torben
File MIME type: application/x-sh
File size: 1689 byte(s)
auto create datadir
1 #!/bin/bash
2
3 # Note
4 # 3 GB memory (ram+swap) MUST be available when compiling
5 # This amount is plenty for working with denmark - but more may be required on larger areas
6 #
7 # DATADIR should have 6 GB free space for denmark
8
9
10 ###################################
11 # Exit bash if a command fails
12 set -e
13 # also exit if a part of a pipe fails
14 set -o pipefail
15
16
17
18 #########################
19
20
21 TAG="v5.5.1"
22 DATADIR=/home/openstreetmap
23
24 if [ ! -d "$DATADIR" ] ; then
25 echo DATADIR not found .. creating
26 mkdir -p $DATADIR
27 fi
28
29 if [ ! -f /usr/local/bin/osrm-extract ] ; then
30 apt-get install build-essential git cmake pkg-config libprotoc-dev protobuf-compiler libprotobuf-dev libosmpbf-dev libpng12-dev libbz2-dev libstxxl-dev libstxxl-doc libstxxl1
31 apt-get install libxml2-dev libzip-dev libboost-all-dev lua5.1 liblua5.1-0-dev libluabind-dev libtbb-dev
32
33
34 cd /root
35
36 if [ ! -d osrm-backend ] ; then
37 git clone https://github.com/Project-OSRM/osrm-backend.git
38 cd osrm-backend
39 git checkout tags/$TAG
40 else
41 cd osrm-backend
42 fi
43
44 if [ ! -d build ] ; then
45 mkdir -p build
46 fi
47
48 cd build
49
50 #If building on Debian8/jessie LTO is apparently broken
51 cmake -DENABLE_LTO=OFF ..
52 make -j 2
53 make install
54 fi
55
56
57 ##########################################
58
59
60 cd $DATADIR
61
62 if [ ! -f denmark-latest.osm ] ; then
63 wget http://download.geofabrik.de/europe/denmark-latest.osm.bz2
64 bunzip2 denmark-latest.osm.bz2
65 fi
66
67
68 cd /root/osrm-backend
69
70 if [ ! -f $DATADIR/denmark-latest.osrm ] ; then
71 osrm-extract $DATADIR/denmark-latest.osm
72 fi
73
74 if [ ! -f $DATADIR/denmark-latest.osrm.hsgr ] ; then
75 osrm-contract $DATADIR/denmark-latest.osrm
76 fi
77
78 cd $DATADIR
79
80 osrm-routed denmark-latest.osrm

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20