2

Trying to compile Mapnik on OSX 10.8

So after I clone the Github repo, I go to run the configure command like so: ./configure and then get the error:
Checking for C++ library icuuc... no
Could not find required header or shared library for icuuc

and later: Exiting... the following required dependencies were not found:
- icuuc (ICU C++ library | configure with ICU_LIBS & ICU_INCLUDES or use ICU_LIB_NAME to specify custom lib name | more info: http://site.icu-project.org/)

Looking at the Mapnik troubleshooting area for a solution: https://github.com/mapnik/mapnik/wiki/InstallationTroubleshooting

Says: Solution: If g++ is available then ICU must be in a custom location so set the paths to the libs and includes - ie. ICU_LIBS=/usr/local/lib and ICU_INCLUDES=/usr/local/include.

By running g++ from command line I get: i686-apple-darwin11-llvm-g++-4.2: no input files

So this means that g++ is available, but I have no idea how to go about setting the paths so that configure can find them.

ICU Libraries were installed by default or with homebrew, not sure which.

terminal: brew install icu4c
Warning: icu4c-51.1 already installed

Finding the icu4c install directory:
terminal: mdfind icu4c
/usr/local/Cellar/icu4c

Levi Roberts
  • 1,277
  • 3
  • 22
  • 44
  • Do you have the ICU library and headers installed? – Etan Reisner Aug 14 '13 at 19:17
  • I do, but I have a feeling that their not being found or in their default directories. This isn't the first time I'm running into issues with ICU. Edited question to show which ICU is installed. – Levi Roberts Aug 14 '13 at 19:25
  • A binary is not necessarily indicative of the library (development side) or headers being installed (I know nothing about brew so maybe with brew it does if brew always installs all three together). Anyway, if the right piece are installed under /usr/local/Cellar and g++ isn't configured to look there by default then you just need to export those ICU_* environment flags set to the right locations in your shell before running configure. – Etan Reisner Aug 14 '13 at 19:37
  • Actually that was the directory icu4c was installed, and subdirectories of lib, include, bin, etc were in there. So you are right that configure isn't looking there but I honestly have no idea how to 'export those ICU_* environment flags'. I tried to this this in terminal before running `./configure` with no luck. – Levi Roberts Aug 14 '13 at 19:42
  • The error you quoted in the question gives you example values. You just need to modify those to point to the correct paths for your system (likely /usr/local/Cellar/icu4c/lib and /usr/local/Cellar/icu4c/include) and then `export ICU_LIBS ICU_INCLUDES`. – Etan Reisner Aug 14 '13 at 19:46
  • For example, I ran the following with the same result. `ICU_LIBS=/usr/local/Cellar/icu4c/51.1/lib`
    `ICU_INCLUDES=/usr/local/Cellar/icu4c/51.1/include` `./configure`
    – Levi Roberts Aug 14 '13 at 19:47
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/35470/discussion-between-levi-roberts-and-etan-reisner) – Levi Roberts Aug 14 '13 at 19:55

3 Answers3

3

You can add the path of your ICU_LIB/INCLUDE to your configure command:

./configure ICU_INCLUDES=/usr/local/Cellar/icu4c/include ICU_LIBS=/usr/local/Cellar/icu4c/lib

And for more help about configure on what options are accepted do:

./configure --help 

For the installation reference, you can check this: https://github.com/mapnik/mapnik/blob/v2.2.0/INSTALL.md

skyvin
  • 61
  • 3
  • This is the correct answer. Mapnik expects configure options for things like icu paths as arguments. – Dane Sep 05 '13 at 13:21
2

As per our discussion and my last comment something like the following might work.

export ICU_LIBS=/usr/local/Cellar/icu4c/lib
export ICU_INCLUDES=/usr/local/Cellar/icu4c/include
./configure
Etan Reisner
  • 77,877
  • 8
  • 106
  • 148
  • Tried to run these commands with the corrected path (found by CD'ing to the directory) but `./configure` still can't find them. – Levi Roberts Aug 14 '13 at 19:50
  • Giving this guy the answer because he was so helpful here and in chat. I fixed the problem by compiling libicuuc from source, then issuing `make install` – Levi Roberts Aug 14 '13 at 20:08
-1

If you find same errors:

Checking for C++ library XXX... no

Follow the command

sudo apt-get install g++ libXXX-dev

Using tips (TAB button), you can see what XXX libraries you have available

sudo apt-get install libXXX(press double TAB)
Evgeniy Tkachenko
  • 1,733
  • 1
  • 17
  • 23