Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux build docs #295

Merged
merged 11 commits into from
Jun 8, 2022
Merged

Linux build docs #295

merged 11 commits into from
Jun 8, 2022

Conversation

dwoznicki
Copy link
Contributor

This PR adds some more explicit instructions for building the maplibre-gl-native project on Debian (and to some extent, Ubuntu).

@dwoznicki dwoznicki mentioned this pull request May 31, 2022
@wipfli
Copy link
Member

wipfli commented Jun 3, 2022

Thanks @dwoznicki for taking the time to write this documentation. I followed your instructions on an ubuntu laptop but run into the following error

➜  maplibre-gl-native git:(main) ✗ cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10

-- Configuring GL-Native with OpenGL renderer backend
-- The following ICU libraries were not found:
--   i18n (optional)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY) 
-- The following ICU libraries were not found:
--   uc (optional)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY) 
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindJPEG.cmake:100 (find_package_handle_standard_args)
  platform/linux/linux.cmake:4 (find_package)
  CMakeLists.txt:1059 (include)

Any idea why this happens?

1 similar comment
@wipfli
Copy link
Member

wipfli commented Jun 3, 2022

Thanks @dwoznicki for taking the time to write this documentation. I followed your instructions on an ubuntu laptop but run into the following error

➜  maplibre-gl-native git:(main) ✗ cmake . -B build -G Ninja -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER=gcc-10 -DCMAKE_CXX_COMPILER=g++-10

-- Configuring GL-Native with OpenGL renderer backend
-- The following ICU libraries were not found:
--   i18n (optional)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY) 
-- The following ICU libraries were not found:
--   uc (optional)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY) 
CMake Error at /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.16/Modules/FindJPEG.cmake:100 (find_package_handle_standard_args)
  platform/linux/linux.cmake:4 (find_package)
  CMakeLists.txt:1059 (include)

Any idea why this happens?

@acalcutt
Copy link
Collaborator

acalcutt commented Jun 3, 2022

@wipfli could that be missing submodules? I feel like I got a similar error when I did a regular git clone without --recurse-submodules

In my post at #280 (comment) I mentioned using
git clone --recurse-submodules -j8 https://github.com/maplibre/maplibre-gl-native.git
to clone the repo, because If I just did a regular git clone it was missing all the submodules

@dwoznicki
Copy link
Contributor Author

Yeah, if you haven't cloned all the submodules as @acalcutt mentioned, please go ahead and try that.

Also, it looks like I have libjpeg8-dev installed on my Ubuntu 20.04 machine, in addition to libjpeg-turbo8.

13:28:16 ❯ sudo apt list --installed | grep libjpeg

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libjpeg-turbo8-dev/focal-security,focal-updates,now 2.0.3-0ubuntu1.20.04.1 amd64 [installed,automatic]
libjpeg-turbo8/focal-security,focal-updates,now 2.0.3-0ubuntu1.20.04.1 amd64 [installed,automatic]
libjpeg8-dev/focal,now 8c-2ubuntu8 amd64 [installed]
libjpeg8/focal,now 8c-2ubuntu8 amd64 [installed]

You could try apt install libjpeg8-dev as well. If that doesn't work, I'll see if I can get this working on a fresh install at some point.

@ntadej
Copy link
Collaborator

ntadej commented Jun 4, 2022

Should we also setup a CI pipeline?

@wipfli
Copy link
Member

wipfli commented Jun 4, 2022

That sounds like a great idea, Tadej. I installed the missing packages with the wget links and then with standard apt on ubuntu and then it worked (still compiling). Thanks for the help!

@wipfli
Copy link
Member

wipfli commented Jun 4, 2022

It worked :) This is my first native map of Switzerland:

out

Generated with

./build/bin/mbgl-render --style style.json --output out.png --zoom 6 --lat 47.36649 --lon 8.53908

Thanks @dwoznicki and @acalcutt for contributing these Linux native guidelines!

@wipfli
Copy link
Member

wipfli commented Jun 4, 2022

I would like to check if we can use the demo tiles and the style from there for this example. @acalcutt do you know how to package the files from https://github.com/maplibre/demotiles into an mbtiles file?

@acalcutt
Copy link
Collaborator

acalcutt commented Jun 4, 2022

python3 mb-util --image_format=pbf /opt/demotiles/tiles demotiles.mbtiles

Remove the .txt

demotiles.mbtiles.txt

@acalcutt
Copy link
Collaborator

acalcutt commented Jun 4, 2022

@wipfli , while you are testing. I'd be interested to know if this label issue shows when rendering that way #284

You could download the test data for that here https://github.com/acalcutt/tileserver-gl/releases/download/test_data/test_data_massachusetts.zip and the style wdb-osm is included in that.

EDIT: now that i think about it this would probably only show one tile so without a few tiles next to each other it would be hard to tell if this is happening. feel free to ignore this...

@wipfli
Copy link
Member

wipfli commented Jun 4, 2022

@dwoznicki do you think it is important to emphasis how to use a local mbtiles file? Because we could actually also just use the MapLibre demotiles style which uses the online demo tiles. Example:

wget https://raw.githubusercontent.com/maplibre/demotiles/gh-pages/style.json
./build/bin/mbgl-render --style style.json --output out.png

creates this nice map:

out

@acalcutt
Copy link
Collaborator

acalcutt commented Jun 4, 2022

I think the local mbtiles was a good example. Good information I did not know.

I like the from url example too.

@wipfli
Copy link
Member

wipfli commented Jun 5, 2022

I just saw that the linux platform has a readme, see https://github.com/maplibre/maplibre-gl-native/tree/main/platform/linux Should we maybe update the linux platform readme instead of putting the info in the main readme?

@ntadej
Copy link
Collaborator

ntadej commented Jun 6, 2022

I just saw that the linux platform has a readme, see https://github.com/maplibre/maplibre-gl-native/tree/main/platform/linux Should we maybe update the linux platform readme instead of putting the info in the main readme?

I agree, we should have platform specific instructions per platform and just link/refer to them from the main README.

@dwoznicki
Copy link
Contributor Author

do you think it is important to emphasis how to use a local mbtiles file? Because we could actually also just use the MapLibre demotiles style which uses the online demo tiles.

I'm not sure. It was important for my use case, but that may not be the same for others. Perhaps for the sake of simplicity, we should use the maplibre style for this demo, and note that you can use local files here or elsewhere.

Also, I've found this library is quite happy to make network requests to load pretty much every resource, so we can just give the --style flag a URL. 🙂

./build/bin/mbgl-render --style https://raw.githubusercontent.com/maplibre/demotiles/gh-pages/style.json --output out.png

Should we maybe update the linux platform readme instead of putting the info in the main readme?

That works. I decided against it for this PR initially because that readme seems to be focused on building a GLFW app, whereas this one shows how to build and use the mbgl-render executable. That said, I'm not sure the GLFW app even works (the make glfw-app certainly doesn't exist anymore), and really the whole document is hopelessly out of date. If I put this guide in the Linux platform, I'm probably just going to replace all the content of that readme. Is that okay?

@wipfli
Copy link
Member

wipfli commented Jun 7, 2022

I think it is OK to replace the content of the platform linux README with something which actually works. Also, I like the idea of specifying the style URL in the command line. Thanks for you help, @dwoznicki!

Daniel Woznicki added 2 commits June 7, 2022 13:46
Modified instructions to load Maplibre style by default, with an additional section on how to use your own style/tiles
…clicking through can see the files, not just the README
Copy link
Member

@wipfli wipfli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really cool, thanks a lot @dwoznicki :)

platform/linux/README.md Outdated Show resolved Hide resolved
platform/linux/README.md Outdated Show resolved Hide resolved
platform/linux/README.md Outdated Show resolved Hide resolved
platform/linux/README.md Outdated Show resolved Hide resolved
platform/linux/README.md Outdated Show resolved Hide resolved
@wipfli wipfli merged commit 7a541c2 into maplibre:main Jun 8, 2022
@acalcutt
Copy link
Collaborator

acalcutt commented Jun 8, 2022

Nice README. I'm glad you left in the local mbtiles stuff. sometimes the small things are hard to piece together.

keith pushed a commit to lyft/maplibre-gl-native that referenced this pull request Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants