mapbox / mapnik-vector-tile

Mapnik implemention of Mapbox Vector Tile specification
BSD 3-Clause "New" or "Revised" License
553 stars 117 forks source link

Building in Ubuntu 14.04 LTS #155

Closed four43 closed 7 years ago

four43 commented 8 years ago

Hello,

I'm having an issue building this repo. I tried on my dev machine but then also tried to build within a clean docker container.

FROM ubuntu:14.04

RUN apt-get update \
     && apt-get install -y build-essential software-properties-common python-software-properties git wget

# Get libprotobuf7 from older version of Ubuntu, not available in recent versions.
RUN wget http://mirrors.kernel.org/ubuntu/pool/main/p/protobuf/libprotobuf7_2.4.1-1ubuntu2_amd64.deb \
     && dpkg -i libprotobuf7_2.4.1-1ubuntu2_amd64.deb \
     && apt-get -f install \
     && rm libprotobuf7_2.4.1-1ubuntu2_amd64.deb

RUN apt-get install -y libprotobuf-dev protobuf-compiler \
     && apt-add-repository --yes ppa:mapnik/nightly-2.3 \
     && apt-get update -y \
     && apt-get -y install libmapnik=2.3.0* mapnik-utils=2.3.0* libmapnik-dev=2.3.0* mapnik-input-plugin*=2.3.0*

RUN git clone https://github.com/mapbox/mapnik-vector-tile.git /opt/mapnik-vector-tile

RUN cd /opt/mapnik-vector-tile \
     && make

Results in:

make[1]: Entering directory `/opt/mapnik-vector-tile/build'
  ACTION gyp_build_gyp_make_vector_tile_target_run_protoc Release/obj/gen/vector_tile.pb.cc
  TOUCH Release/obj.target/gyp/make_vector_tile.stamp
  CXX(target) Release/obj.target/vector_tile/gen/vector_tile.pb.o
  AR(target) Release/obj.target/gyp/libvector_tile.a
  CXX(target) Release/obj.target/mapnik_vector_tile_impl/src/vector_tile_processor.o
In file included from ../src/vector_tile_processor.cpp:1:0:
../src/vector_tile_processor.hpp:7:39: fatal error: mapnik/util/noncopyable.hpp: No such file or directory
 #include <mapnik/util/noncopyable.hpp>
                                       ^
compilation terminated.
make[1]: *** [Release/obj.target/mapnik_vector_tile_impl/src/vector_tile_processor.o] Error 1
make[1]: Leaving directory `/opt/mapnik-vector-tile/build'
make: *** [libvtile] Error 2

Thoughts? Anything change on those nightlies that caused mapnik/util/noncopyable.hpp to go missing? I'm not too familiar on how to check for that.

Thanks, -Seth

springmeyer commented 8 years ago

You need to use Mapnik 3.x whereas it looks like you are installing 2.3

four43 commented 8 years ago

Thanks @springmeyer, I was following the install instructions in the README.md. It looks like there isn't a ppa:mapnik/nightly-3.x (or any version 3), however there is a nightly-trunk available.

Looking here: https://launchpad.net/~mapnik for branches

Still failing:

apt-add-repository --yes ppa:mapnik/nightly-trunk \
     && apt-get update -y \
     && apt-get -y install libmapnik mapnik-utils libmapnik-dev mapnik-input-plugin*

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mapnik-input-plugin-osm : Depends: libmapnik (= 3.0.0+dev20150716.git.af0369d-1~trusty1) but 3.0.0+dev20151008.git.69a5020-1~trusty1 is to be installed
E: Unable to correct problems, you have held broken packages.

Thanks, -Seth

four43 commented 8 years ago

It seems the README on master is referencing older instructions. I was successfully able to build the project using the older 0.6.x branch.

Dockerfile for 0.6.x

FROM ubuntu:14.04
MAINTAINER Seth Miller <smiller@aerisweather.com>

RUN apt-get update \
     && apt-get install -y build-essential software-properties-common python-software-properties git wget \
     && apt-get install -y libprotobuf-dev protobuf-compiler

RUN wget http://mirrors.kernel.org/ubuntu/pool/main/p/protobuf/libprotobuf7_2.4.1-1ubuntu2_amd64.deb \
     && dpkg -i libprotobuf7_2.4.1-1ubuntu2_amd64.deb \
     && apt-get -f install \
     && rm libprotobuf7_2.4.1-1ubuntu2_amd64.deb

RUN apt-add-repository --yes ppa:mapnik/nightly-2.3 \
     && apt-get update -y \
     && apt-get -y install libmapnik=2.3.0* mapnik-utils=2.3.0* libmapnik-dev=2.3.0* mapnik-input-plugin*=2.3.0*

# Version 0.6.x is the highest we can go with Mapnik 2.3.x
RUN git clone https://github.com/mapbox/mapnik-vector-tile.git /opt/mapnik-vector-tile

RUN cd /opt/mapnik-vector-tile \
    && git checkout 0.6.x \
    && make \
    && cd ./examples/c++ \
    && make && make install

# Cleanup
RUN apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

Then it can be run like:

docker run -v /path/to/my/tile.pbf:/tile.pbf namespace/mapnik-vector-tile tileinfo /tile.pbf

Thanks for your help @springmeyer. Following you around Github and using all these mapping projects you and the Mapbox team publish is a lot of fun. -Seth

springmeyer commented 8 years ago

@four43 - yes, sorry about the outdated readme (https://github.com/mapbox/mapnik-vector-tile/issues/130). Yes, nightly-trunk is your best bet. Sorry it is not working, can you file an issue at https://github.com/mapnik/debian/issues with that error?

springmeyer commented 7 years ago

Docs have been updated at https://github.com/mapbox/mapnik-vector-tile#building-from-source. Please create new issues if still having trouble.