OSGeo / homebrew-osgeo4mac

Mac homebrew tap for maintaining a stable work environment for the OSGeo.org geospatial toolset
https://git.io/fhh3X
BSD 3-Clause "New" or "Revised" License
364 stars 112 forks source link

Can't install --with-pg11 #1382

Closed HeikoH closed 4 years ago

HeikoH commented 4 years ago

Describe the bug

When trying to install gdal2 with PG11 support (brew install gdal2 --with-pg11) I get this error:

    ~  brew install gdal2 --with-pg11                                                                                                                                             1 ↵  10437  21:29:42    13.55   (anaconda3) 
Updating Homebrew...
==> Installing osgeo-gdal from osgeo/osgeo4mac
==> Downloading https://github.com/OSGeo/gdal/releases/download/v3.1.0/gdal-3.1.0.tar.gz
Already downloaded: /Users/heik6828/Library/Caches/Homebrew/downloads/8d9558d1ee5f33071324e5720abea6df45acac508ae01601a670e537b8e3d943--gdal-3.1.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/osgeo-gdal/3.1.0_1 --with-local=/usr/local/Cellar/osgeo-gdal/3.1.0_1 --with-dods-root=/usr/local/opt/libdap --with-libtool --with-bsb --with-grib --with-pam --with-opencl --with-pcre --with-thr
Last 15 lines from /Users/heik6828/Library/Logs/Homebrew/osgeo-gdal/01.configure:
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
using ICONV_CPP_CONST=""
configure: Bash completions not requested
checking for PROJ >= 6 library... checking for proj_create_from_wkt in -lproj... yes
configure: proj.h found
checking for lzma_code in -llzma... yes
checking lzma.h usability... yes
checking lzma.h presence... yes
checking for lzma.h... yes
checking for ZSTD_decompressStream in -lzstd... yes
configure: error: Only --with-pg=yes/no supported

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/osgeo/homebrew-osgeo4mac/issues

To Reproduce

Steps to reproduce the behavior:

  1. Install using brew install gdal2 --with-pg11 2 See error

Expected behavior

ogrinfo can actually connect to a PG11 DB. Using the PG12 libs and connecting to an Azure PostgreSQL 11 DB results in

ERROR 1: PQconnectdb failed.
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
alazarolop commented 4 years ago

Hi @HeikoH , GDAL 2 is no longer maintained in the tap, but it's in homebrew core instead. If you are able to upgrade to GDAL 3, you may try brew install osgeo-gdal --with-pg11.

Some formulas shouldn't be available anymore, we'll fix this in the near future.

HeikoH commented 4 years ago

@alazarolop - same issue with GDAL 3:

    ~  brew install osgeo-gdal --with-pg11                                                                                                                                        1 ↵  10440  08:44:48    26.59   (anaconda3) 
Updating Homebrew...
==> Installing osgeo-gdal from osgeo/osgeo4mac
==> Downloading https://github.com/OSGeo/gdal/releases/download/v3.1.0/gdal-3.1.0.tar.gz
Already downloaded: /Users/heik6828/Library/Caches/Homebrew/downloads/8d9558d1ee5f33071324e5720abea6df45acac508ae01601a670e537b8e3d943--gdal-3.1.0.tar.gz
==> ./configure --prefix=/usr/local/Cellar/osgeo-gdal/3.1.0_1 --with-local=/usr/local/Cellar/osgeo-gdal/3.1.0_1 --with-dods-root=/usr/local/opt/libdap --with-libtool --with-bsb --with-grib --with-pam --with-opencl --with-pcre --with-thr
Last 15 lines from /Users/heik6828/Library/Logs/Homebrew/osgeo-gdal/01.configure:
checking for iconv... yes
checking for working iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
using ICONV_CPP_CONST=""
configure: Bash completions not requested
checking for PROJ >= 6 library... checking for proj_create_from_wkt in -lproj... yes
configure: proj.h found
checking for lzma_code in -llzma... yes
checking lzma.h usability... yes
checking lzma.h presence... yes
checking for lzma.h... yes
checking for ZSTD_decompressStream in -lzstd... yes
configure: error: Only --with-pg=yes/no supported

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/osgeo/homebrew-osgeo4mac/issues
alazarolop commented 4 years ago

I'll check this out, I think I know what it is. I'll let you know when the formula is fixed.

alazarolop commented 4 years ago

Here is the fix https://github.com/OSGeo/homebrew-osgeo4mac/commit/d2b4ff71be7f8556d0049a8027f4b143631147d9. I think it should work as long as you have osgeo-postgresql@11 linked (brew link osgeo-postgresql@11) before executing the command.

Let me know if find more issues.

alazarolop commented 4 years ago

BTW, I've seen Homebrew has released a new version of Python. If you've planned to install osgeo-gdal-python, you should add --build-from-source until new bottles are built.

HeikoH commented 4 years ago

Thanks, that fixes it. But it doesn't solve the issue I thought using PG 11 would solve, that is this error

ERROR 1: PQconnectdb failed.
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.

For now I switched to using osgeo\gdal Docker image, which works fine.

alazarolop commented 4 years ago

What query were you trying when you get this message?

HeikoH commented 4 years ago

ogrinfo -al PG:'host=... user=.. dbname=... password=... port=..

alazarolop commented 4 years ago

I couldn't reproduce it, but I used a slightly different string. According to the driver documentation, I double quoted de config string.

ogrinfo -so PG:"host='localhost' port=5432 user='user' password='pass' dbname='test'"

Have you tried this way?