Code Monkey home page Code Monkey logo

Comments (15)

ctimmins avatar ctimmins commented on May 20, 2024 6

The wrong (but works) way:

I have another installation of postgres

ll $(which postgres)
$: /usr/local/bin/postgres -> usr/local/Cellar/postgresql/9.5.2/bin/postgres

brew install pgrouting. Should be located in /usr/local/Cellar/pgrouting/2.1.0_1/share/postgresql/extension

if you start the postgress.app and run ps aux | grep postgres you can see the process running that looks like /Applications/Postgres.app/Contentents/yada/yada -D <some config directory>. Now kill it.

run postgres -D <some config directory from above>
now go into the psql shell and create extension pgrouting
should work and you should be all set to use it from postgres.app next time you run the server

from postgresapp.

mattt avatar mattt commented on May 20, 2024

I spent about an hour trying to compile pgrouting from source to include in Postgres.app, to no avail. Seriously, that project is a hot mess—absolutely refuses to link correctly on OSX, lacks any semblance of documentation on installation (to the point of assuming rather non-trivial dependencies like Boost).

If anyone is interested in taking time to get this to work—go for it. I'm washing my hands of this myself, though. For anyone who's brave/curious, here's where I ended up in creating a pgrouting aggregate build target:

Run Script: Download & Compile cmake

#!/bin/sh

mkdir -p ${PROJECT_DIR}/src
cd ${PROJECT_DIR}/src

/usr/bin/curl -L10 -O "http://www.cmake.org/files/v2.8/cmake-2.8.7.tar.gz"
/usr/bin/tar xzf cmake-2.8.7.tar.gz
cd cmake-2.8.7

sh ./bootstrap --prefix="${PROJECT_DIR}/Postgres/Vendor/postgres"
/usr/bin/make
/usr/bin/make install

Download & Build Boost

#!/bin/sh

mkdir -p ${PROJECT_DIR}/src
cd ${PROJECT_DIR}/src

/usr/bin/curl -L10 -O "http://downloads.sourceforge.net/project/boost/boost/1.51.0/boost_1_51_0.tar.gz"
/usr/bin/tar xzf boost_1_51_0.tar.gz
cd boost_1_51_0

sh ./bootstrap.sh --prefix="${PROJECT_DIR}/Postgres/Vendor/postgres"
./b2 --prefix="${PROJECT_DIR}/Postgres/Vendor/postgres" --without-python  

Download, Build, & Install pgrouting

#!/bin/sh

mkdir -p ${PROJECT_DIR}/src
cd ${PROJECT_DIR}/src

#/usr/bin/curl -L10 -O "http://download.osgeo.org/pgrouting/source/pgrouting-1.05.tar.gz"
#/usr/bin/tar xzf pgrouting-1.05.tar.gz
cd pgrouting-1.05

export PATH="${PROJECT_DIR}/Postgres/Vendor/postgres/bin/:${PATH}"

#${PROJECT_DIR}/Postgres/Vendor/postgres/bin/cmake" -DPOSTGRESQL_INCLUDE_DIR="${PROJECT_DIR}/Postgres/Vendor/postgres/include/server" -DBoost_DIR="${PROJECT_DIR}/src/boost_1_51_0/boost" .
"/usr/local/bin/cmake" -DPOSTGRESQL_INCLUDE_DIR="${PROJECT_DIR}/Postgres/Vendor/postgres/include/server" -DBoost_DIR="/usr/local/Cellar/boost/1.49.0" .

/usr/bin/make install

from postgresapp.

dkalisch avatar dkalisch commented on May 20, 2024

Thanks for your work, matt. It seems to be a mass, that's what I figured out as well... But I am not a programmer, so maybe someone can help with that...?

from postgresapp.

kachkaev avatar kachkaev commented on May 20, 2024

Has anyone figured out how to install pgRouting for Postgres.app yet?

from postgresapp.

miccferr avatar miccferr commented on May 20, 2024

I second kachkaev comment. Any news will be greatly appreciated!

from postgresapp.

frewie avatar frewie commented on May 20, 2024

Would be great if that would work at some point.

from postgresapp.

mtaptich avatar mtaptich commented on May 20, 2024

Okay. I haven't fully tested its functionality, but I could possibly have a work around if your are getting 'undefined symbols while linking' errors.

This issue was resolved by changing the filepath in /pgrouting/build/CMakeCache.txt:

POSTGRESQL_EXECUTABLE:FILEPATH=/Applications/postgres.app/Contents/Versions/9.4/bin/postgres

I am also getting two warnings:

src/tsp/src/tsp2.c:57:5: warning: implicit declaration of function 'get_typlenbyvalalign' is invalid in C99
      [-Wimplicit-function-declaration]
    get_typlenbyvalalign(i_eltype, &i_typlen, &i_typbyval, &i_typalign);
    ^
src/tsp/src/tsplib.c:115:16: warning: implicit declaration of function 'Rand' is invalid in C99
      [-Wimplicit-function-declaration]
        last = Rand ();
               ^

Since I am trying to learn pgRouting, I will confirm the work around once I run my first test. Please, feel free to add to my post if you have more experience with this. Cheers!

from postgresapp.

dkalisch avatar dkalisch commented on May 20, 2024

An alternative is to use the grouting from http://www.kyngchaos.com/software/postgres (make sure that the Version of postgres matches the one grouting is build for!)
Then you only have to do the following 3 adjustments:

Before you install the pgrouting package set the path of the Postgres.app to the expected path. ln -s /Applications/Postgres.app/Contents/Versions/9.3/ /usr/local/pgsql-9.3

After installing, create a symbolic link to the installed grouting extension: ln -s /Applications/Postgres.app/Contents/Versions/9.3/share/extension/pgrouting* /Applications/Postgres.app/Contents/Versions/9.3/share/postgresql/extension

And last but not least, in /Applications/Postgres.app/Contents/Versions/9.3/share/extension/pgrouting--2.0.0.sqlchange $libdir/to /Applications/Postgres.app/Contents/Versions/9.3/lib/ (adjust 9.3 with the correct version!)

After that you can install posts and grouting with

CREATE EXTENSION postgis;
CREATE EXTENSION fuzzystrmatch;
CREATE EXTENSION postgis_tiger_geocoder;
CREATE EXTENSION postgis_topology;
CREATE EXTENSION pgrouting;

and verify that everything works fine:

SELECT postgis_full_version();
POSTGIS="2.1.3 r12547" GEOS="3.4.2-CAPI-1.8.2 r3921" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.10.0, released 2013/04/24" LIBXML="2.9.1" LIBJSON="UNKNOWN" TOPOLOGY RASTER


SELECT * FROM pgr_version();
 version |       tag       | build |  hash   | branch | boost  
---------+-----------------+-------+---------+--------+--------
 2.0.0   | pgrouting-2.0.0 | 0     | f26831f | master | 1.54.0
(1 row)

Happy routing :-)

from postgresapp.

dassouki avatar dassouki commented on May 20, 2024

@dkalisch , I'm on osx 10.10.2 and although I followed your instructions, I'm having an issue: I can't find /Applications/Postgres.app/Contents/Versions/9.3/share/extension/pgrouting*, however, I can find pgrouting in /usr/local/pgsql-9.3/share/extension/ . Any suggestions or comments?

from postgresapp.

dkalisch avatar dkalisch commented on May 20, 2024

@dassouki: That means that you didn't set the symbolic link:

ln -s /Applications/Postgres.app/Contents/Versions/9.3/share/extension/pgrouting* /Applications/Postgres.app/Contents/Versions/9.3/share/postgresql/extension

from postgresapp.

RP-3 avatar RP-3 commented on May 20, 2024

@ctimmins Lifesaver!
Might be useful for everyone else, make sure your postgres.app and alternative installation are of the same minor version.

Some commands that might be useful if juggling homebrew's postgres and postgres.app:
brew list services
brew switch <some other version of postgres>
brew search postgresql

from postgresapp.

buck-work avatar buck-work commented on May 20, 2024

@ctimmins
just confirming this worked for me too. thanks!!

from postgresapp.

timkofu avatar timkofu commented on May 20, 2024

Would it be possible to include pgrouting in Postgres.app?

from postgresapp.

tbussmann avatar tbussmann commented on May 20, 2024

@timkofu: inclusion of pgrouting is currently tracked in #288 - the issue with that is a dependency that we did not yet figure out how we want to deal with. You can however fulfil that dependency by other means (e.g. homebrew) and build pgrouting yourself against PostgresApp. An (not fully up to date) set of instructions can be found here. I'll try to compose a list of contributed instructions on how to build various extension against PostgresApp and look into the boost issue for pgrouting / postgis_sfcgal when I find some spare time but I cannot promise when that will happen.

from postgresapp.

timkofu avatar timkofu commented on May 20, 2024

Building it manually worked. Thank You.

from postgresapp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.