osm2pgrouting (#24) - osm2pgrouting on Mac OS X (#172) - Message List

osm2pgrouting on Mac OS X

I've built osm2pgrouting on Mac OS X 10.5.

Here's the additional steps I needed to take to get it to build (I already had PostgreSQL, PostGIS and pgRouting installed, and set up and spatialised a database):

1. Install boost and expat (which both build without modification needed.)

2. Change the INC line in the Makefile to:

INC = -I./ -I../src -I/usr/local/include/boost-1_36 -I/usr/local/pgsql/include -L/usr/local/pgsql/lib

- the last library is needed otherwise ld can't find lpg.

3. Edit src/Node.h, src/Export2DB.h and src/Export2DB.cpp, changing "ushort" to "short".

It should then build without issues. Note the README is slightly out of date, there is a new parameter that has to be passed in, e.g.

./main -file ../../../osmexport/map-2.osm.xml -conf ../mapconfig.xml -dbname [me] -user [me]

I also modified mapconfig.xml, changing cicleway to cycleway

  • Message #604

    Great news! Thank you!

  • Message #1156

    Thank you for the tips.

    For point 3 above, it may be preferable to add the following on a line prior to namespace osm:
    typedef unsigned short ushort;
    rather than change the ushort to a signed short. Practically, it probably doesn't matter since a Node's numsOfUse shouldn't get that large.

    Cheers

  • Message #1474

    Some notes for Mac OSX 10.6 (using William Kyngesbury's installers) based on Ollie's notes (above)


    1. Install boost and expat (which both build without modification needed.)


    Install boost into /usr/local/boost_1_42_0

    (I forgot to install expat, not sure what it does?)


    2. Change the INC line in the Makefile to: INC = -I./ -I../src -I/usr/local/include/boost-1_36 -I/usr/local/pgsql/include -L/usr/local/pgsql/lib - the last library is needed otherwise ld can't find lpg.

    Again, using a different setup but


    INC = -I./ -Isrc -I/usr/local/pgsql/include -L/usr/local/pgsql/lib -I/usr/local/boost_1_42_0/
    


    3. Edit src/Node.h, src/Export2DB.h and src/Export2DB.cpp, changing "ushort" to "short".


    I took andrewcrice's approach - add the following on a line prior to namespace osm:

    typedef unsigned short ushort;
    

    in

    • src/Export2DB.h
    • src/Node.h
    • (I couldn't find a reference to namespace osm in the cpp file.

    because I was using kyngchaos installers, I then

    $ PATH=$PATH:/Library/Frameworks/GEOS.framework/unix/bin/ \
    CFLAGS="-I/Library/Frameworks/PROJ.framework/unix/include" \
    LDFLAGS="-L/Library/Frameworks/PROJ.framework/unix/lib/" \
    make