problem compiling #35

Closed
cinch opened this Issue Jul 11, 2013 · 5 comments

Comments

Projects
None yet
3 participants

cinch commented Jul 11, 2013

hi,

i'm compiling mod_tile under CentOS 6.
mapnik has been installed under /opt/osm.

$ locate mapnik-config
/opt/osm/bin/mapnik-config

./configure --with-boost=/opt/boost/ --with-libmapnik=/opt/osm/bin/mapnik-config
[..]
checking for mapnik-config... /opt/osm/bin/mapnik-config
checking for mapnik libraries... yes

yet it fails to compile. any idea? here's the output: http://pastebin.com/raw.php?i=fwtvAbBh

Contributor

springmeyer commented Jul 11, 2013

The problem is that -I/opt/osm/include is not appearing in your compile flags. I'm not familiar personally with mod_tile's build system enough to know why that is. You might be able to do:

export CFLAGS="-I/opt/osm/include"

before trying to build to solve this.

cinch commented Jul 11, 2013

i think you're my hero for today ;)

for others who might have the same problem compiling mod_tile:

./configure --with-boost=/opt/boost/ --with-libmapnik=/opt/osm/bin/mapnik-config CXXFLAGS="-I/opt/osm/include"

Contributor

springmeyer commented Jul 11, 2013

even better (mod_tile really should be doing this):

./configure CXXFLAGS=`mapnik-config --includes`
Member

apmon commented Jul 12, 2013

This is from memory, so I might be entirely wrong. But I think the issue was that mapnik-config in some version added a bunch of extra compiler flags that broke builds. Which is (if I remember correctly) why this was left out.

Contributor

springmeyer commented Jul 12, 2013

@apmon - 23be036. The problem was that the CXX specific flags were also being added to the targets than need to be compiled as C. The solution is to fix the mod_tile build system so that CXXFLAGS and CFLAGS are handled separately and applied to the right targets. Or at least this is the only solution if mapnik-config --cflags is used. mapnik-config --cflags specifically is a catch all for all compiler flags and to make this more flexible at Mapnik v.2.2.0 you now have access to each type of flag like mapnik-config --includes for just the include paths for all mapnik dependencies (some of which are C like freetype and C++ like boost) and mapnik-config --defines for just -DEFINES.

apmon closed this in a975db9 Aug 10, 2013

@apmon apmon added a commit to apmon/mod_tile that referenced this issue Aug 17, 2013

@apmon apmon Another attempt at including mapnik include directories from mapnik-c…
…onfig

use mapnik-config --includes rather than --cflags (as was attempted in 23be036).

This should fix #35
0414282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment