Search code examples
c++mapboxmapbox-gl

Mapbox compile offline tool on Linux


I am trying to compile the Mapbox GL offline tool (mbgl-offline) on Linux to generate a database with offline data for a specific region.

Steps followed as posted in github repository to compile the offline tool on Linux but it failed:

  • git clone --recurse-submodules https://github.com/mapbox/mapbox-gl-native.git
  • cd mapbox-gl-native
  • make offline (i tried also make mbgl-offline)
  • compilation failed: Error message: make: *** No rule to make target 'offline'. Stop.

Any idea what is going wrong with compilation of the tool ?


Solution

  • The README.md clearly states how to build Mapbox: Developing

    You tried to compile it with make, but if you look around the repository there are a lot of CMakeLists.txt, which indicates that you should use CMake to compile it.

    These are the steps I followed to build it:

    git clone git@github.com:mapbox/mapbox-gl-native.git
    cd mapbox-gl-native/
    git submodule update --init --recursive
    

    I also had to install two libraries in order to compile it. Depends on your setup what you need to install.

    sudo apt install libcurl4-openssl-dev libuv1-dev
    

    Con't

    cmake . -B build
    cmake --build build -j 8
    

    After you followed those steps you will have build/bin/ which contains the built applications. You where searching for build/bin/mbgl-offline.