Opened 23 months ago

Last modified 9 months ago

#5177 closed enhancement

Can't build commandline tools only and --without-pgconfig seems broken — at Version 2

Reported by: robe Owned by: pramsey
Priority: medium Milestone: PostGIS 3.4.0
Component: postgis Version: master
Keywords: Cc:

Description (last modified by robe)

I thought we had solved this problem already, but it seems not.

I tried building the command-line tools on a CentOS, thinking I could do it with.

export PKG_CONFIG_PATH="/projects/rel/lib/pkgconfig"
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/projects/rel/lib:/projects/rel/bin:/projects/rel/include"

./configure --prefix=/projects/rel \
  --with-geosconfig=/projects/rel/bin/geos-config \
  --without-pgconfig --without-protobuf \
  --with-libiconv=/projects/rel

What happens with the above, even though I have GDAL installed in /projects/rel

I still get error:

configure: WARNING: gdal.h: present but cannot be compiled
configure: WARNING: gdal.h:     check for missing prerequisite headers?
configure: WARNING: gdal.h: see the Autoconf documentation
configure: WARNING: gdal.h:     section "Present But Cannot Be Compiled"
configure: WARNING: gdal.h: proceeding with the compiler's result
checking for gdal.h... no
configure: error: could not find GDAL headers

If I do

configure: WARNING: gdal.h: present but cannot be compiled
configure: WARNING: gdal.h:     check for missing prerequisite headers?
configure: WARNING: gdal.h: see the Autoconf documentation
configure: WARNING: gdal.h:     section "Present But Cannot Be Compiled"
configure: WARNING: gdal.h: proceeding with the compiler's result
checking for gdal.h... no
configure: error: could not find GDAL headers

If I do,

export PKG_CONFIG_PATH="/projects/rel/lib/pkgconfig"
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/projects/rel/lib:/projects/rel/bin:/projects/rel/include"

./configure --prefix=/projects/rel \
  --with-geosconfig=/projects/rel/bin/geos-config \
  --without-pgconfig --without-protobuf \
  --with-libiconv=/projects/rel \
  --without-raster

Then configure succeeds, and even make completes with:

/usr/bin/ar: creating .libs/liblwgeom.a
libtool: link: gcc-ranlib .libs/liblwgeom.a
libtool: link: rm -fr .libs/liblwgeom.lax
libtool: link: ( cd ".libs" && rm -f "liblwgeom.la" && ln -s "../liblwgeom.la" "liblwgeom.la" )

but make install just outputs

 make install
for s in liblwgeom; do \
        echo "---- Making install in ${s}"; \
        make -C ${s} install || exit 1; \
done;

I would have assumed the shp2pgsql, pgsql2shp would get installed in the —prefix folder, but no nothing. Even building with below the —prefix is ignored and all by commandline tools end up in /projects/rel/pg14/bin

export PKG_CONFIG_PATH="/projects/rel/lib/pkgconfig"
export PATH="/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/projects/rel/lib:/projects/rel/bin:/projects/rel/include"
export PGPATH=/projects/rel/pg14

./configure --prefix=/projects/rel --without-protobuf --with-pgconfig=${PGPATH}/bin/pg_config \
  --with-geosconfig=/projects/rel/bin/geos-config \
  --with-libiconv=/projects/rel

make && make install

What I am expecting, is that since shp2pgsql and raster2pgsql do not have ANY dependency on PostgreSQL or libpq for that matter, I should be able to get those built with below and they should be installed in —prefix=/projects/rel/bin

./configure --prefix=/projects/rel --without-protobuf \
  --with-geosconfig=/projects/rel/bin/geos-config \
  --without-pgconfig --without-protobuf \
  --with-libiconv=/projects/rel \
  --without-raster

make && make install

I thought this used to work, but perhaps was broken after our numerous changes to liblwgeom config

I'm going to try older versions to see

Change History (2)

comment:1 by robe, 23 months ago

Summary: Can't build commandline tools only and =-without-pgconfig seems brokenCan't build commandline tools only and --without-pgconfig seems broken

comment:2 by robe, 23 months ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.