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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3166 by torben, Wed Dec 14 13:26:40 2016 UTC revision 3170 by torben, Thu Dec 15 19:19:31 2016 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/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    
 DATADIR=/mnt/qnap/openstreetmap  
9    
10  if [ ! -f /usr/local/bin/osrm-extract ] ; then  TAG="v5.5.0"
11    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  DATADIR=/mnt/qnap/openstreetmap
   apt-get install libxml2-dev libzip-dev libboost-all-dev lua5.1 liblua5.1-0-dev libluabind-dev  libtbb-dev  
12    
13    if [ ! -d "$DATADIR" ] ; then
14            echo DATADIR not found
15            exit
16    fi
17    
18    cd /root  if [ ! -f /usr/local/bin/osrm-extract ] ; then
19      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  || exit
20      apt-get install libxml2-dev libzip-dev libboost-all-dev lua5.1 liblua5.1-0-dev libluabind-dev  libtbb-dev ||exit
21    
   git clone https://github.com/Project-OSRM/osrm-backend.git  
   cd osrm-backend  
   mkdir -p build  
   cd build  
22    
23    cmake ..    cd /root || exit
24    make -j 2  
25    make install    if [ ! -d osrm-backend ] ; then
26        git clone https://github.com/Project-OSRM/osrm-backend.git || exit
27        cd osrm-backend || exit
28        git checkout tags/$TAG || exit
29      else
30        cd osrm-backend
31      fi
32    
33      if [ ! -d build ] ; then
34        mkdir -p build || exit
35      fi
36    
37      cd build ||exit
38    
39      #If building on Debian8/jessie LTO is apparently broken
40      cmake -DENABLE_LTO=OFF .. || exit
41      make -j 2 || exit
42      make install ||exit
43  fi  fi
44    
45    
# Line 27  fi Line 49  fi
49  cd $DATADIR  cd $DATADIR
50    
51  if [ ! -f denmark-latest.osm ] ; then  if [ ! -f denmark-latest.osm ] ; then
52          wget http://download.geofabrik.de/europe/denmark-latest.osm.bz2          wget http://download.geofabrik.de/europe/denmark-latest.osm.bz2 || exit
53          bunzip2 denmark-latest.osm.bz2          bunzip2 denmark-latest.osm.bz2 ||exit
54  fi  fi
55    
56    
57  cd /root/osrm-backend  cd /root/osrm-backend
58    
59  if [ ! -f $DATADIR/denmark-latest.osrm ] ; then  if [ ! -f $DATADIR/denmark-latest.osrm ] ; then
60          osrm-extract $DATADIR/denmark-latest.osm          osrm-extract $DATADIR/denmark-latest.osm || exit
61  fi  fi
62    
63  if [ ! -f $DATADIR/denmark-latest.osrm.edges ] ; then  if [ ! -f $DATADIR/denmark-latest.osrm.hsgr ] ; then
64          osrm-prepare $DATADIR/denmark-latest.osrm          osrm-contract $DATADIR/denmark-latest.osrm || exit
65  fi  fi
66    
67  cd $DATADIR  cd $DATADIR

Legend:
Removed from v.3166  
changed lines
  Added in v.3170

  ViewVC Help
Powered by ViewVC 1.1.20