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

make error : No such file or directory #include <mapbox/variant/variant.hpp> #3246

Closed
wanghaiyang1930 opened this issue Jan 22, 2016 · 15 comments

Comments

@wanghaiyang1930
Copy link

now this is my log, why include mapbox???

include/mapnik/util/variant.hpp:28:38: fatal error: mapbox/variant/variant.hpp: No such file or directory
#include <mapbox/variant/variant.hpp>
^
compilation terminated.
scons: *** [src/renderer_common/process_group_symbolizer.os] Error 1
scons: building terminated because of errors.
Makefile:40: recipe for target 'src/json/libmapnik-json.a' failed
make: *** [src/json/libmapnik-json.a] Error 2

@lightmare
Copy link
Contributor

It's kind of an annoyance, yes. Us lazy folks preferred to have it included. You'll need to run this (to initialize it and also whenever you switch branches with different variant versions):

git submodule update --init deps/mapbox/variant

@artemp
Copy link
Member

artemp commented Jan 22, 2016

We were manually maintaining a copy of variant but it got a bit tedious so I made it a submodule
/cc @wanghaiyang1930 @lightmare

@lightmare
Copy link
Contributor

lightmare commented Jan 22, 2016

@artemp I know, it's just ... inconvenient ... on the consumer end. When I'm making a local clone, I don't want to download test data from github each time, so I have to explicitly update the variant submodule. Actually I want local clones to be compilable even when I'm offline, so I have submodules mirrored separately, and run this inside each new local mapnik clone:

#! /bin/sh
# WARNING: THIS IS SHOWING MY LOCAL SETUP, YOU DON'T WANT TO RUN THIS
git config --local "submodule.deps/mapbox/variant.url" "$HOME/.cache/git-cache/variant.git"
git config --local "submodule.test/data.url" "$HOME/.cache/git-cache/mapnik/test-data.git"
git config --local "submodule.test/data-visual.url" "$HOME/.cache/git-cache/mapnik/test-data-visual.git"
git submodule update --init

I guess the same could be achieved by global url.*.insteadOf options, but then I'd have to override those when I really want to download.

@wanghaiyang1930
Copy link
Author

Thanks all of you @artemp @lightmare, I down load variant from github and compile success successfully.

@geography
Copy link

Hi all I tried:

git config --local "submodule.deps/mapbox/variant.url" "$HOME/.cache/git-cache/variant.git"
git config --local "submodule.test/data.url" "$HOME/.cache/git-cache/mapnik/test-data.git"
git config --local "submodule.test/data-visual.url" "$HOME/.cache/git-cache/mapnik/test-data-visual.git"
git submodule update --init

but not work, the error is:

fatal: repository '/root/.cache/git-cache/variant.git' does not exist
Clone of '/root/.cache/git-cache/variant.git' into submodule path 'deps/mapbox/variant' failed

@lightmare
Copy link
Contributor

@geography sorry, that was not meant for general usage, it's only showing how I use a shared git repository to avoid downloading test data in every clone; but that repository has to be managed separately.

To get rid of those non-functioning cache settings, run:

git submodule sync

Then, if you only need to compile mapnik, all you need is:

git submodule update --init deps/mapbox/variant

If you also want to run the test suite, omit the last argument, i.e.:

git submodule update --init

@geography
Copy link

@lightmare great now works, thanks a lot

@andrew-aladev
Copy link

@lightmare, I've downloaded src-3.0.13.tar.gz release. You forgot to add mapbox. Mapbox variant folder is empty.

@lightmare
Copy link
Contributor

You forgot to add mapbox. Mapbox variant folder is empty.

/cc @artemp

@artemp
Copy link
Member

artemp commented Feb 14, 2017

Yes, submodules are missing from automatically generated Source code (tar.gz). But I don't even see an option to remove those links.

@f00dl3
Copy link

f00dl3 commented Jul 29, 2018

Having this issue on Ubuntu 18.04. I can compile from source but when I attempt to build it into mod_tile I get the error:

In file included from /usr/local/include/mapnik/well_known_srs.hpp:29:0,
from /usr/local/include/mapnik/map.hpp:33,
from src/gen_tile.cpp:2:
/usr/local/include/mapnik/geometry/point.hpp:26:10: fatal error: mapbox/geometry/point.hpp: No such file or directory
#include <mapbox/geometry/point.hpp>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

@artemp
Copy link
Member

artemp commented Jul 30, 2018

@f00dl3 - you need get submodules : git submodule update --init

@f00dl3
Copy link

f00dl3 commented Jul 30, 2018

I did the git submodule thing in the mapnik folder, all 3 steps:

git submodule sync
git submodule update --init deps/mapbox/variant
git submodule update --init

I then rebuilt Mapnik. It was success.

I then changed to the mod_tile folder
I ran make clean && make.

I got the error.

Do I need to do the git submodule just in mapnik or in mapnik and any packages which have mapnik as a dependency? I tried doing the git submodule update for deps/mapbox/variant in the mod_tile folder an it errors, saying did not match any known to git.

And keep in mind the error is for point.hpp - not variant.

@artemp
Copy link
Member

artemp commented Jul 30, 2018

@f00dl3 - it looks like you need to tell mod_tile about an extra include path(s). This is mod_tile issue, please consult mod_tile docs/build settings, closing.

@geoeo
Copy link

geoeo commented Oct 8, 2020

This is still a problem:

I install mapnik on ubuntu. make test passes.

But when trying to run the demo on the website

#include <mapnik/map.hpp>
#include <mapnik/load_map.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/image.hpp>
#include <mapnik/image_util.hpp>

 main()
{
mapnik::Map m(256,256);
mapnik::load_map(m, "path/to/file.xml");
m.zoom_all();
mapnik::image_rgba8 im(256,256);
mapnik::agg_renderer<mapnik::image_rgba8> ren(m, im);
ren.apply();
mapnik::save_to_file(im, "the_image.png");
}

It cant build due to variant missing

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

No branches or pull requests

7 participants