Homebrew / legacy-homebrew

💀 The former home of Homebrew/homebrew (deprecated)
https://brew.sh
26.98k stars 11.35k forks source link

including sqlite breaks postgres in gdal/ogr #8301

Closed kueda closed 12 years ago

kueda commented 12 years ago

Installing gdal 1.8.1 in OS 10.7.2 with postgres support causes OGR to fail when doing a simple ogrinfo call:

~ > ogrinfo PG:dbname=dbname
ERROR 1: PQconnectdb failed.
could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?

Commenting out

--with-sqlite3=/usr

in the gdal formula fixes the problem but obviously removes sqlite support. I'm guessing that using the system sqlite somehow causes gdal to link against the system postgres instead of homebrew's copy, though I can't imagine why. One fix would be to insist that gdal depends on a homebrew copy of sqlite instead of the system's, but I'm not sure what the homebrew convention is for that kind of decision. Perhaps there is a smarter way to fix this?

Sharpie commented 12 years ago

One fix would be to insist that gdal depends on a homebrew copy of sqlite instead of the system's, but I'm not sure what the homebrew convention is for that kind of decision. Perhaps there is a smarter way to fix this?

We try not to drag in a duplicate unless the version shipped with the system is absolutely too old to support the software. If depending on the system version of SQLite is somehow affecting Postgres, then I would call it a bug in the GDAL configure script.

springmeyer commented 12 years ago

@kueda - does adding localhost change anything?

ogrinfo PG:"dbname=<dbname> host=localhost"

Also, what does this give?

otool -L `which ogr2ogr`

I'm curious if ogr2ogr is truly linked against /usr/lib/libpq.5.dylib. If so, install_name_tool -change may be enough to hotfix things, and possibly pointing gdal to the homebrew location of postgres could also work.

I currently have gdal built from source, but will try to replicate tomorrow. /cc @brianboyer

adamv commented 12 years ago

Closing due to no response; if this is still an issue please provide the information asked for above.