-
Notifications
You must be signed in to change notification settings - Fork 827
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
CMake build support #4191
CMake build support #4191
Conversation
f6b7bc0 and 5420ccd are needed for mscv support. I've patched these lines out at vcpkg. but i don't quite understand why msvc complains about the lines changed at 5420ccd. |
@artemp there might be a missing file in the source tree: mapnik/utils/ogrindex/ogrindex.cpp Line 37 in c945dd7
I can't find any shapeindex/quadtree.hpp |
3eb00b9 adds the feature test for |
This reverts commit 6b5e4dc.
…into cmake-support
So i think i've added all options and worked out the most common config errors. So there aren't any todos left (except the naming thing mentioned above, thats to discuss) |
@artemp do you see a chance to merge this with v4.0? |
Is it ready? Just let me know and I'll merge. Thanks for your contributions! |
I'm pretty happy with it. Possibly there are still hidden things somewhere, which probably only appear with increased use by other users. Time will tell. The last question from the todo list:
After the question is resolved, this can be merged from my point of view. |
|
yes for me So if nothing from your side is standing out, it is ready to merge. I will add pkg-config files but that would be a different PR. |
@mathisloge - ok, merging 🎉 |
@mathisloge This pr is great 👍 But when I want to distribute binary files of mapnik library, an error was reported on the new machine. The cmake-build mapnik dynamic library depends on specific libraries, such as libboost_program_options.so.1.74.0. Cmake-build vs scons-build mapnik differences(use # cmake build
root@docker-desktop:/tmp# ldd /usr/local/lib/libmapnik.so
linux-vdso.so.1 (0x00007fffcf1fd000)
libboost_filesystem.so.1.71.0 => /lib/x86_64-linux-gnu/libboost_filesystem.so.1.71.0 (0x00007f556ddb7000)
libboost_regex.so.1.71.0 => /lib/x86_64-linux-gnu/libboost_regex.so.1.71.0 (0x00007f556dcb7000)
libcairo.so.2 => /lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f556db94000)
libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f556db5c000)
libproj.so.15 => /lib/x86_64-linux-gnu/libproj.so.15 (0x00007f556d86d000)
libtiff.so.5 => /lib/x86_64-linux-gnu/libtiff.so.5 (0x00007f556d7ec000)
libwebp.so.6 => /lib/x86_64-linux-gnu/libwebp.so.6 (0x00007f556d780000)
libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x00007f556d5c6000)
libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f556d4c1000)
libjpeg.so.8 => /lib/x86_64-linux-gnu/libjpeg.so.8 (0x00007f556d43c000)
libicuuc.so.66 => /lib/x86_64-linux-gnu/libicuuc.so.66 (0x00007f556d256000)
libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f556d197000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f556d18f000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f556cfad000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f556ce5e000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f556ce43000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f556ce20000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f556cc2e000)
libicui18n.so.66 => /lib/x86_64-linux-gnu/libicui18n.so.66 (0x00007f556c92d000)
libpixman-1.so.0 => /lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f556c886000)
libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f556c83f000)
libxcb-shm.so.0 => /lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f556c83a000)
libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f556c810000)
libxcb-render.so.0 => /lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f556c801000)
libXrender.so.1 => /lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f556c5f5000)
libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f556c4b8000)
libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f556c4a3000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f556c487000)
libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f556c35e000)
libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f556c2b5000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f556c28a000)
libjbig.so.0 => /lib/x86_64-linux-gnu/libjbig.so.0 (0x00007f556c07c000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f556bf53000)
libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f556bf26000)
libicudata.so.66 => /lib/x86_64-linux-gnu/libicudata.so.66 (0x00007f556a465000)
/lib64/ld-linux-x86-64.so.2 (0x00007f556eac8000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f556a435000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f556a42c000)
libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f556a426000)
libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f556a41e000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f556a3ab000)
libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f556a38f000) # scons build
root@docker-desktop:/tmp# ldd node_modules/mapnik/lib/binding/lib/libmapnik.so
linux-vdso.so.1 (0x00007ffd4a5a5000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa542da1000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa542d9b000)
libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa542bb9000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa542a6a000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa542a4f000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa542a2a000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa542838000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa5445bd000) Clearly, scons-build has less dependencies and is more easily to distribute binary. |
@zy6p the scons binary you are referencing here has most deps static linked. only libmapnik itself is dynamic. So you can't compare both. Distribution of dynamic libraries on linux systems is very errorprone due to the exact reasons you mentioned here => versioning of shared libraries and system wide integration. For a static libmapnik cmake build see #4291. Currently still in dev |
@zy6p also if you really want to distibute dynamic libraries on linux, make sure all dependencies are installed on the new machine and have the correct versions. If you need other versions, you would need to build mapnik with those versions. e.g. if you wan't to use an local installed boost version, you have to specify |
@mathisloge thanks for your kind help. It is difficult for me to install the same dependencies on new machines, which have diffenent linux systems. The official node-mapnik is the ideal solution. It will install with pre-build mapnik lib and all dependencies are static linked. Looking forward to #4291 merge. |
CMake build support
closes #4190
This PR would add CMake support to mapnik
Remaining work:
libmapnik-
to wkt and jsonmt
to lib name) and set then Boost_USE_MULTITHREADEDmt
be added to the library namelibmapnik.[so]/[.dll]
when using MAPNIK_THREADSAFE? eg.libmapnik-mt.[so]/[.dll]