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

Testing current Mapnik #271

Closed
kocio-pl opened this issue Oct 29, 2017 · 10 comments
Closed

Testing current Mapnik #271

kocio-pl opened this issue Oct 29, 2017 · 10 comments

Comments

@kocio-pl
Copy link
Contributor

How could I easily test current Mapnik code (from git repository) with Kosmtik - probably not messing with my existing system?

@yohanboniface
Copy link
Member

I guess something like npm install mapnik/node-mapnik --build-from-source, @springmeyer?

@springmeyer
Copy link

Yes, you'd need mapnik-config on your path. Then you'd want to clone node-mapnik and build
locally from source. See https://github.com/mapnik/node-mapnik#source-build. Then once build you can link that version of node-mapnik into kosmtik like:

cd kosmtik
npm link ../node-mapnik

@kocio-pl
Copy link
Contributor Author

kocio-pl commented Nov 1, 2017

Linking tries to install something outside the kosmtik directory (/usr/local/lib/node_modules). Is this really necessary? I would prefer clean solution, with changing things just in local directory, just like regular Kosmtik.

@springmeyer
Copy link

That is the way that npm link works. I share your astonishment - you would hope it would work with relative paths, but it does not. The alternative way to point at a source-compiled node-mapnik in another directory is to make sure the one that might have been installed inside the node_modules tree is removed. And then point to another one that you've build from source. So if kosmtik is at /home/kosmtik and you've built node-mapnik from source at /home/node-mapnik you can allow kosmtik to find node-mapnik by doing:

export NODE_PATH=/home/node-mapnik/lib

In fact, once that is working you could do this from anywhere on your system:

node -e "require('mapnik')"

@kocio-pl
Copy link
Contributor Author

kocio-pl commented Nov 2, 2017

I did it in a more simple way.

First I made npm install inside kosmtik-devel directory.

Just exporting did not work - it was still using Mapnik 3.0.15 from node_modules/mapnik directory.

Removing mapnik directory did the trick. It works also without exporting with just linking node-mapnik as mapnik subdirectory.

The next problem is:

[Core] Using mapnik version 3.1.0
Mapnik version 3.1.0 is not supported

and it stops throwing error.

@springmeyer
Copy link

I think that is happening because mapnik-reference needs an update. I've ticketed this at mapnik/mapnik-reference#143

@kocio-pl
Copy link
Contributor Author

We have Mapnik 3.0.16 now:

https://github.com/mapnik/mapnik/blob/v3.0.16/CHANGELOG.md#3016

Is it possible to compile node-mapnik with this version?

@springmeyer
Copy link

@kocio-pl it should, if you try to source compile use the v3.0.x branch of node-mapnik. If you hit problems please ticket at https://github.com/mapnik/node-mapnik/issues and /cc @artemp

@kocio-pl
Copy link
Contributor Author

kocio-pl commented Nov 27, 2017

I was able to test 3.0.16 with Kosmtik on Ubuntu this way:

  • building experimental Mapnik packages from Debian and installing it in my system
  • compiling node-mapnik branch v3.0.x using system Mapnik version (probably using Clang instead of GCC, IIRC)
  • replacing kosmtik/node_modules/mapnik with a symbolic link to the node-mapnik directory

It would be better if we have some simpler way of testing different Mapnik versions (especially from current git master repo), but that's enough for me now. Thank you for all the help!

@kocio-pl
Copy link
Contributor Author

kocio-pl commented Mar 7, 2018

I'm still not able to compile and use the current Mapnik from repo in Kosmtik, but here is more detailed procedure for using it with Debian Mapnik 3.0.x packages:

gravitystorm/openstreetmap-carto#1391 (comment)

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

3 participants