-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
108 lines (77 loc) · 5.05 KB
/
Makefile
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
# Copyright 2020, University of Freiburg
# Authors: Axel Lehmann <[email protected]>.
# This file is part of osm2rdf.
#
# osm2rdf is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# osm2rdf is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with osm2rdf. If not, see <https://www.gnu.org/licenses/>.
DOCKER:=$(shell which podman || which wharfer || which docker)
osm2rdf: build
cmake --build build --target osm2rdf
all: compile checkstyle test benchmark
clean:
rm -rf build
clean-input:
rm -rf ./input/
build:
cmake -DENABLE_GEOMETRY_STATISTIC=1 -S . -B build
compile: build
cmake --build build --target osm2rdf osm2rdf-stats
checkstyle:
test: build
cmake --build build --target run_tests
benchmark: build
cmake --build build --target run_benchmarks
install: compile
cmake --install build
run: compile
for FILE in $(shell ls -Sr input); do ./build/apps/osm2rdf "./input/$${FILE}" -o "/tmp/$${FILE}.qlever"; done
perf: compile
for FILE in $(shell ls -Sr input); do time perf record ./build/apps/osm2rdf "./input/$${FILE}" -o "/tmp/$${FILE}.qlever"; perf report; done
perf-st: compile
for FILE in $(shell ls -Sr input); do export OMP_NUM_THREADS=1 && export OMP_THREAD_LIMIT=1 && time perf record ./build/apps/osm2rdf "./input/$${FILE}" -o "/tmp/$${FILE}.qlever"; perf report; done
download-all: input/freiburg-regbez-latest.osm.pbf input/baden-wuerttemberg-latest.osm.pbf input/germany-latest.osm.pbf input/europe-latest.osm.pbf input/planet-latest.osm.pbf
input:
mkdir input || true
input/freiburg-regbez-latest.osm.pbf: input
wget -O ./input/freiburg-regbez-latest.osm.pbf https://download.geofabrik.de/europe/germany/baden-wuerttemberg/freiburg-regbez-latest.osm.pbf
input/baden-wuerttemberg-latest.osm.pbf: input
wget -O ./input/baden-wuerttemberg-latest.osm.pbf https://download.geofabrik.de/europe/germany/baden-wuerttemberg-latest.osm.pbf
input/germany-latest.osm.pbf: input
wget -O ./input/germany-latest.osm.pbf https://download.geofabrik.de/europe/germany-latest.osm.pbf
input/europe-latest.osm.pbf: input
wget -O ./input/europe-latest.osm.pbf https://download.geofabrik.de/europe-latest.osm.pbf
input/planet-latest.osm.pbf: input
wget -O ./input/planet-latest.osm.pbf https://planet.openstreetmap.org/pbf/planet-latest.osm.pbf
docker-dirs:
mkdir input || true
chmod 777 input
mkdir output || true
chmod 777 output
mkdir scratch || true
chmod 777 scratch
docker-build:
${DOCKER} build -t osm2rdf .
docker-fr: docker-dirs docker-build input/freiburg-regbez-latest.osm.pbf
${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/freiburg-regbez-latest.osm.pbf -o /output/freiburg-regbez-latest.osm.ttl -t /scratch/ --write-rdf-statistics
docker-bw: docker-dirs docker-build input/baden-wuerttemberg-latest.osm.pbf
${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/baden-wuerttemberg-latest.osm.pbf -o /output/baden-wuerttemberg-latest.osm.ttl -t /scratch/
docker-de: docker-dirs docker-build input/germany-latest.osm.pbf
${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/germany-latest.osm.pbf -o /output/germany-latest.osm.ttl -t /scratch/
docker-eu: docker-dirs docker-build input/europe-latest.osm.pbf
${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/europe-latest.osm.pbf -o /output/europe-latest.osm.ttl -t /scratch/
docker-pl: docker-dirs docker-build input/planet-latest.osm.pbf
${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/planet-latest.osm.pbf -o /output/planet-latest.osm.ttl -t /scratch/
docker-fr-ratios: docker-dirs docker-build input/freiburg-regbez-latest.osm.pbf
for R in "-1" "0.001" "0.01" "0.1" "0.2" "0.25" "0.5" "0.75" "0.9" "1.0"; do ${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/freiburg-regbez-latest.osm.pbf -o /output/freiburg-regbez-latest.osm.ttl -t /scratch/ --minimal-area-envelope-ratio $$R --no-node-geometric-relations --no-way-geometric-relations; done
docker-bw-ratios: docker-dirs docker-build input/baden-wuerttemberg-latest.osm.pbf
for R in "-1" "0.001" "0.01" "0.1" "0.2" "0.25" "0.5" "0.75" "0.9" "1.0"; do ${DOCKER} run --rm -v `pwd`/input/:/input/ -v `pwd`/output/:/output/ -v `pwd`/scratch/:/scratch/ -it osm2rdf /input/baden-wuerttemberg-latest.osm.pbf -o /output/baden-wuerttemberg-latest.ttl -t /scratch/ --minimal-area-envelope-ratio $$R --no-node-geometric-relations --no-way-geometric-relations; done