Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
pgrouting module does not link properly on OSX #5
Postgres modules on OSX should be loadable modules, or bundles, not dynamic libraries. There is a difference on OSX. -bundle is the flag used instead of -dynamiclib, and bundles don't need the install_name or version flags. pgxs also adds -multiply_defined suppress. The standard file extension for a bundle on OSX is the same as a library on linux - .so - but version numbers (if used) are still put before the suffix.
So, the basic link command for OSX would be:
c++ -bundle -multiply_defined suppress -o librouting.so
It looks like the bundle option for cmake is MODULE, ie:
Oh, and -bundle_loader is needed so it sees (but doesn't link) symbols in the postgres executable:
According to the cmake docs, the MODULE option drops back to SHARED on non-darwin platforms, so it doesn't need to be conditionalized in cmakelists.txt.
I was able to insert the extra bundle_loader flag with: