joto / osmium

C++/Javascript framework for working with OSM files.
http://wiki.openstreetmap.org/wiki/Osmium
GNU General Public License v3.0
123 stars 31 forks source link

Compile error on Ubuntu #88

Closed DanielTripp closed 10 years ago

DanielTripp commented 10 years ago

Hello. When I tried to compile Osmium (with 'debuild -I -us -uc'), the ant part gave me an error like this:

Buildfile: /home/dt/osrm/osmium/libosmpbf/OSM-binary/build.xml

init:
    [mkdir] Created dir: /home/dt/osrm/osmium/libosmpbf/OSM-binary/generated.java
    [mkdir] Created dir: /home/dt/osrm/osmium/libosmpbf/OSM-binary/build

build:
    [javac] Compiling 16 source files to /home/dt/osrm/osmium/libosmpbf/OSM-binary/build
    [javac] /home/dt/osrm/osmium/libosmpbf/OSM-binary/src.java/crosby/binary/BinaryParser.java:24: package com.google.protobuf does not exist
    [javac] import com.google.protobuf.InvalidProtocolBufferException;
    [javac]                           ^
.
.
.

It seems that the .jar filename installed by libprotobuf-java and the .jar filename referenced in build.xml disagree:

~/osrm/osmium/libosmpbf/OSM-binary $ dpkg-query -L libprotobuf-java  | grep jar
/usr/share/java/protobuf-java-2.4.1.jar
/usr/share/maven-repo/com/google/protobuf/protobuf-java/2.4.1/protobuf-java-2.4.1.jar
/usr/share/maven-repo/com/google/protobuf/protobuf-java/debian/protobuf-java-debian.jar
/usr/share/java/protobuf-java.jar
~/osrm/osmium/libosmpbf/OSM-binary $ grep 'proto.*jar' build.xml
                                <fileset file="/usr/share/java/protobuf.jar"/>

So it looked to me like an issue of protobuf.jar vs. protobuf-java.jar. I changed build.xml to reference protobuf-java.jar and built again, and it worked.

Here is information about my system:

~/osrm/osmium/libosmpbf/OSM-binary $ lsb_release  -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:        12.04
Codename:       precise
joto commented 10 years ago

This doesn't have anything to do with Osmium, but is a bug in OSM-binary and should have been reported there. I have fixed it there.

DanielTripp commented 10 years ago

Thank you.