Errors while installing PostGIS by an unusual method

Started by Ankit Sablokover 9 years ago6 messagesgeneral
Jump to latest
#1Ankit Sablok
ankitsab@buffalo.edu

I am trying to install PostGIS on a RHEL_5 system and failing at it
miserably. The way I am trying to install it is as follows. I copy over all
the artifacts of postgresql server as in the bin, lib, share directories of
postgresql server in a directory called pgql and I place it in the root
directory i.e /pgsql is the directory which contains things like pg_config
and all the other libs and bins that one gets by installing postgresql
using the standard installation. All the dependencies of PostGIS get
installed successfully using the standard build process of *./configure
--prefix=/pgsql, make and make install* but when I issue the following
command for building PostGIS using the same process :

./configure --with-gdalconfig=/pgsql/bin/gdal-config
--with-geosconfig=/pgsql/bin/geos-config --with-projdir=/pgsql
--with-jsondir=/pgsql --with-pgconfig=/pgsql/bin/pg_config

I get the following error in the configure step :

checking PostgreSQL version... PostgreSQL 9.6

checking libpq-fe.h usability... no

checking libpq-fe.h presence... no

checking for libpq-fe.h... no

configure: error: could not find libpq-fe.h"

to remedy this error I tried placing the include files in the include
directory of postgresql by find the appropriate path using

/pgsql/bin/pg_config --includedir

and then when I try to install PostGIS, it still fails. Can anyone suggest
some workaround to build PostGIS using this non-standard approach of
building PostGIS?

Edit: When I try to add all the include files which includes the libpq-fe.h
and libpq headers as well along with other header I get the following error
when configuring PostGIS

checking for PQserverVersion in -lpq... no

configure: error: could not find libpq

#2Asif Naeem
anaeem.it@gmail.com
In reply to: Ankit Sablok (#1)
Re: Errors while installing PostGIS by an unusual method

Hi Ankit,

Can you please share the generated config.log ?

Following works for me i.e.

export
PATH=/work/postgresql/inst/bin:/opt/proj-4.7.0/inst/bin:/opt/gdal-1.9.1/inst/bin:/opt/geos-3.3.5/inst/bin:$PATH

export

LD_LIBRARY_PATH=/work/postgresql/inst/lib:/opt/proj-4.7.0/inst/lib:/opt/gdal-1.9.1/inst/lib:/opt/geos-3.3.5/inst/lib:$LD_LIBRARY_PATH

./configure --prefix=$PWD/inst --with-projdir=/opt/proj-4.7.0/inst &>

configure.log
make &> make.log

Regards,
Muhammad Asif Naeem

On Mon, Oct 24, 2016 at 11:15 AM, Ankit Sablok <ankitsab@buffalo.edu> wrote:

Show quoted text

I am trying to install PostGIS on a RHEL_5 system and failing at it
miserably. The way I am trying to install it is as follows. I copy over all
the artifacts of postgresql server as in the bin, lib, share directories of
postgresql server in a directory called pgql and I place it in the root
directory i.e /pgsql is the directory which contains things like pg_config
and all the other libs and bins that one gets by installing postgresql
using the standard installation. All the dependencies of PostGIS get
installed successfully using the standard build process of *./configure
--prefix=/pgsql, make and make install* but when I issue the following
command for building PostGIS using the same process :

./configure --with-gdalconfig=/pgsql/bin/gdal-config
--with-geosconfig=/pgsql/bin/geos-config --with-projdir=/pgsql
--with-jsondir=/pgsql --with-pgconfig=/pgsql/bin/pg_config

I get the following error in the configure step :

checking PostgreSQL version... PostgreSQL 9.6

checking libpq-fe.h usability... no

checking libpq-fe.h presence... no

checking for libpq-fe.h... no

configure: error: could not find libpq-fe.h"

to remedy this error I tried placing the include files in the include
directory of postgresql by find the appropriate path using

/pgsql/bin/pg_config --includedir

and then when I try to install PostGIS, it still fails. Can anyone suggest
some workaround to build PostGIS using this non-standard approach of
building PostGIS?

Edit: When I try to add all the include files which includes the
libpq-fe.h and libpq headers as well along with other header I get the
following error when configuring PostGIS

checking for PQserverVersion in -lpq... no

configure: error: could not find libpq

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ankit Sablok (#1)
Re: Errors while installing PostGIS by an unusual method

Ankit Sablok <ankitsab@buffalo.edu> writes:

I am trying to install PostGIS on a RHEL_5 system and failing at it
miserably. The way I am trying to install it is as follows. I copy over all
the artifacts of postgresql server as in the bin, lib, share directories of
postgresql server in a directory called pgql and I place it in the root
directory i.e /pgsql is the directory which contains things like pg_config
and all the other libs and bins that one gets by installing postgresql
using the standard installation.

(1) did you remember the include directory?

(2) I think this process will not work unless /pgsql was also the install
directory on the source machine. You can check that by running pg_config
by hand and seeing what it prints for INCLUDEDIR, but it looks to me like
it just parrots what PG's configure expected the installation path to be.

(This is assuming that PostGIS's configure even pays attention to what
pg_config says for INCLUDEDIR. I've not checked.)

Is there a good reason why you're not building Postgres on the same
machine where you're building PostGIS? It seems like a recipe for
trouble, with little to be gained.

regards, tom lane

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

#4Ankit Sablok
ankitsab@buffalo.edu
In reply to: Tom Lane (#3)
Re: Errors while installing PostGIS by an unusual method

Thanks for replying Tom and Asif, I think the issue was that libpq.so
present in the /pgsql/lib directory did not have all its dependencies
installed on the system namely openssl hence I execute the command sudo yum
install openssl and that proceeded the configure script forward, but now I
ran into a separate issue where I do see libxml2 libraries present in the
/pgsql/lib directory and I have also set the appropriate PATH and
LD_LIBRARY_PATH for the build to happen successfully, here is the configure
log when I execute the following command

./configure --with-gdalconfig=/pgsql/bin/gdal-config
--with-geosconfig=//pgsql/bin/geos-config
--with-projdir=/pgsql --with-jsondir=/rdsdbbin/apg-1.0.6.2
--with-pgconfig=/pgsql/bin/pg_config --with-libxml2=/pgsql/bin/xml2-config

*configure: WARNING: unrecognized options: --with-libxml2*
*checking build system type... x86_64-unknown-linux-gnu*
*checking host system type... x86_64-unknown-linux-gnu*
*checking how to print strings... printf*
*checking for gcc... gcc*
*checking whether the C compiler works... yes*
*checking for C compiler default output file name... a.out*
*checking for suffix of executables... *
*checking whether we are cross compiling... no*
*checking for suffix of object files... o*
*checking whether we are using the GNU C compiler... yes*
*checking whether gcc accepts -g... yes*
*checking for gcc option to accept ISO C89... none needed*
*checking for a sed that does not truncate output... /bin/sed*
*checking for grep that handles long lines and -e... /bin/grep*
*checking for egrep... /bin/grep -E*
*checking for fgrep... /bin/grep -F*
*checking for ld used by gcc... /usr/bin/ld*
*checking if the linker (/usr/bin/ld) is GNU ld... yes*
*checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm*
*checking the name lister (/usr/bin/nm) interface... BSD nm*
*checking whether ln -s works... yes*
*checking the maximum length of command line arguments... 1572864*
*checking whether the shell understands some XSI constructs... yes*
*checking whether the shell understands "+="... yes*
*checking how to convert x86_64-unknown-linux-gnu file names to
x86_64-unknown-linux-gnu format... func_convert_file_noop*
*checking how to convert x86_64-unknown-linux-gnu file names to toolchain
format... func_convert_file_noop*
*checking for /usr/bin/ld option to reload object files... -r*
*checking for objdump... objdump*
*checking how to recognize dependent libraries... pass_all*
*checking for dlltool... no*
*checking how to associate runtime and link libraries... printf %s\n*
*checking for ar... ar*
*checking for archiver @FILE support... @*
*checking for strip... strip*
*checking for ranlib... ranlib*
*checking for gawk... gawk*
*checking command to parse /usr/bin/nm output from gcc object... ok*
*checking for sysroot... no*
*checking for mt... no*
*checking if : is a manifest tool... no*
*checking how to run the C preprocessor... gcc -E*
*checking for ANSI C header files... yes*
*checking for sys/types.h... yes*
*checking for sys/stat.h... yes*
*checking for stdlib.h... yes*
*checking for string.h... yes*
*checking for memory.h... yes*
*checking for strings.h... yes*
*checking for inttypes.h... yes*
*checking for stdint.h... yes*
*checking for unistd.h... yes*
*checking for dlfcn.h... yes*
*checking for objdir... .libs*
*checking if gcc supports -fno-rtti -fno-exceptions... no*
*checking for gcc option to produce PIC... -fPIC -DPIC*
*checking if gcc PIC flag -fPIC -DPIC works... yes*
*checking if gcc static flag -static works... no*
*checking if gcc supports -c -o file.o... yes*
*checking if gcc supports -c -o file.o... (cached) yes*
*checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes*
*checking whether -lc should be explicitly linked in... no*
*checking dynamic linker characteristics... GNU/Linux ld.so*
*checking how to hardcode library paths into programs... immediate*
*checking whether stripping libraries is possible... yes*
*checking if libtool supports shared libraries... yes*
*checking whether to build shared libraries... yes*
*checking whether to build static libraries... yes*
*checking for gcc... (cached) gcc*
*checking whether we are using the GNU C compiler... (cached) yes*
*checking whether gcc accepts -g... (cached) yes*
*checking for gcc option to accept ISO C89... (cached) none needed*
*checking how to run the C preprocessor... gcc -E*
*checking for grep that handles long lines and -e... (cached) /bin/grep*
*checking for ant... no*
*checking for cpp... /usr/local/bin/cpp*
*checking if gcc supports -Wall... yes*
*checking if gcc supports -Wmissing-prototypes... yes*
*checking if gcc supports -ffloat-store... yes*
*checking if gcc supports --exclude-libs... yes*
*checking for flex... flex*
*checking lex output file root... lex.yy*
*checking lex library... none needed*
*checking whether yytext is a pointer... no*
*checking for bison... bison -y*
*checking ieeefp.h usability... no*
*checking ieeefp.h presence... no*
*checking for ieeefp.h... no*
*checking termios.h usability... yes*
*checking termios.h presence... yes*
*checking for termios.h... yes*
*checking for vasprintf... yes*
*checking for asprintf... yes*
*checking for _LARGEFILE_SOURCE value needed for large files... no*
*checking whether isfinite is declared... yes*
*checking whether isfinite is declared... yes*
*checking for perl... /usr/bin/perl*
*checking for xsltproc... /usr/bin/xsltproc*
*checking for convert... no*
*configure: WARNING: ImageMagick does not seem to be installed.
Documentation cannot be built*
*checking for dblatex... no*
*configure: WARNING: dblatex is not installed so PDF documentation cannot
be built*
*checking for xmllint... /usr/bin/xmllint*
*configure: WARNING: could not locate Docbook stylesheets required to build
the documentation*
*checking CUnit/CUnit.h usability... no*
*checking CUnit/CUnit.h presence... no*
*checking for CUnit/CUnit.h... no*
*configure: WARNING: could not locate CUnit required for unit tests*
*checking iconv.h usability... yes*
*checking iconv.h presence... yes*
*checking for iconv.h... yes*
*checking for libiconv_open in -liconv... no*
*checking for iconv_open in -lc... yes*
*checking for iconvctl... no*
*checking for libiconvctl... no*
*Using user-specified pg_config file: /pgsql/bin/pg_config*
*checking PostgreSQL version... PostgreSQL 9.6*
*checking libpq-fe.h usability... yes*
*checking libpq-fe.h presence... yes*
*checking for libpq-fe.h... yes*
*checking for PQserverVersion in -lpq... yes*
*checking for xml2-config... /usr/bin/xml2-config*
*checking libxml/tree.h usability... yes*
*checking libxml/tree.h presence... yes*
*checking for libxml/tree.h... yes*
*checking libxml/parser.h usability... yes*
*checking libxml/parser.h presence... yes*
*checking for libxml/parser.h... yes*
*checking libxml/xpath.h usability... yes*
*checking libxml/xpath.h presence... yes*
*checking for libxml/xpath.h... yes*
*checking libxml/xpathInternals.h usability... yes*
*checking libxml/xpathInternals.h presence... yes*
*checking for libxml/xpathInternals.h... yes*
*checking for xmlInitParser in -lxml2... no*
*configure: error: could not find libxml2*

I am not sure how to fix that in general :(?

On Mon, Oct 24, 2016 at 5:37 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Show quoted text

Ankit Sablok <ankitsab@buffalo.edu> writes:

I am trying to install PostGIS on a RHEL_5 system and failing at it
miserably. The way I am trying to install it is as follows. I copy over

all

the artifacts of postgresql server as in the bin, lib, share directories

of

postgresql server in a directory called pgql and I place it in the root
directory i.e /pgsql is the directory which contains things like

pg_config

and all the other libs and bins that one gets by installing postgresql
using the standard installation.

(1) did you remember the include directory?

(2) I think this process will not work unless /pgsql was also the install
directory on the source machine. You can check that by running pg_config
by hand and seeing what it prints for INCLUDEDIR, but it looks to me like
it just parrots what PG's configure expected the installation path to be.

(This is assuming that PostGIS's configure even pays attention to what
pg_config says for INCLUDEDIR. I've not checked.)

Is there a good reason why you're not building Postgres on the same
machine where you're building PostGIS? It seems like a recipe for
trouble, with little to be gained.

regards, tom lane

#5Daniel Caldeweyher
dcalde@gmail.com
In reply to: Ankit Sablok (#4)
Re: Errors while installing PostGIS by an unusual method

Hi Ankit,

You might have specific requirements to need PG 9.6. But if 9.5 is
sufficient, it will be easier to simply do a rpm/yum install.

Regards,
Daniel

On Tue, Oct 25, 2016 at 4:08 AM, Ankit Sablok <ankitsab@buffalo.edu> wrote:

Show quoted text

Thanks for replying Tom and Asif, I think the issue was that libpq.so
present in the /pgsql/lib directory did not have all its dependencies
installed on the system namely openssl hence I execute the command sudo yum
install openssl and that proceeded the configure script forward, but now I
ran into a separate issue where I do see libxml2 libraries present in the
/pgsql/lib directory and I have also set the appropriate PATH and
LD_LIBRARY_PATH for the build to happen successfully, here is the configure
log when I execute the following command

./configure --with-gdalconfig=/pgsql/bin/gdal-config
--with-geosconfig=//pgsql/bin/geos-config --with-projdir=/pgsql --with-jsondir=/rdsdbbin/apg-1.0.6.2
--with-pgconfig=/pgsql/bin/pg_config --with-libxml2=/pgsql/bin/xml2-config

*configure: WARNING: unrecognized options: --with-libxml2*
*checking build system type... x86_64-unknown-linux-gnu*
*checking host system type... x86_64-unknown-linux-gnu*
*checking how to print strings... printf*
*checking for gcc... gcc*
*checking whether the C compiler works... yes*
*checking for C compiler default output file name... a.out*
*checking for suffix of executables... *
*checking whether we are cross compiling... no*
*checking for suffix of object files... o*
*checking whether we are using the GNU C compiler... yes*
*checking whether gcc accepts -g... yes*
*checking for gcc option to accept ISO C89... none needed*
*checking for a sed that does not truncate output... /bin/sed*
*checking for grep that handles long lines and -e... /bin/grep*
*checking for egrep... /bin/grep -E*
*checking for fgrep... /bin/grep -F*
*checking for ld used by gcc... /usr/bin/ld*
*checking if the linker (/usr/bin/ld) is GNU ld... yes*
*checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm*
*checking the name lister (/usr/bin/nm) interface... BSD nm*
*checking whether ln -s works... yes*
*checking the maximum length of command line arguments... 1572864*
*checking whether the shell understands some XSI constructs... yes*
*checking whether the shell understands "+="... yes*
*checking how to convert x86_64-unknown-linux-gnu file names to
x86_64-unknown-linux-gnu format... func_convert_file_noop*
*checking how to convert x86_64-unknown-linux-gnu file names to toolchain
format... func_convert_file_noop*
*checking for /usr/bin/ld option to reload object files... -r*
*checking for objdump... objdump*
*checking how to recognize dependent libraries... pass_all*
*checking for dlltool... no*
*checking how to associate runtime and link libraries... printf %s\n*
*checking for ar... ar*
*checking for archiver @FILE support... @*
*checking for strip... strip*
*checking for ranlib... ranlib*
*checking for gawk... gawk*
*checking command to parse /usr/bin/nm output from gcc object... ok*
*checking for sysroot... no*
*checking for mt... no*
*checking if : is a manifest tool... no*
*checking how to run the C preprocessor... gcc -E*
*checking for ANSI C header files... yes*
*checking for sys/types.h... yes*
*checking for sys/stat.h... yes*
*checking for stdlib.h... yes*
*checking for string.h... yes*
*checking for memory.h... yes*
*checking for strings.h... yes*
*checking for inttypes.h... yes*
*checking for stdint.h... yes*
*checking for unistd.h... yes*
*checking for dlfcn.h... yes*
*checking for objdir... .libs*
*checking if gcc supports -fno-rtti -fno-exceptions... no*
*checking for gcc option to produce PIC... -fPIC -DPIC*
*checking if gcc PIC flag -fPIC -DPIC works... yes*
*checking if gcc static flag -static works... no*
*checking if gcc supports -c -o file.o... yes*
*checking if gcc supports -c -o file.o... (cached) yes*
*checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports
shared libraries... yes*
*checking whether -lc should be explicitly linked in... no*
*checking dynamic linker characteristics... GNU/Linux ld.so*
*checking how to hardcode library paths into programs... immediate*
*checking whether stripping libraries is possible... yes*
*checking if libtool supports shared libraries... yes*
*checking whether to build shared libraries... yes*
*checking whether to build static libraries... yes*
*checking for gcc... (cached) gcc*
*checking whether we are using the GNU C compiler... (cached) yes*
*checking whether gcc accepts -g... (cached) yes*
*checking for gcc option to accept ISO C89... (cached) none needed*
*checking how to run the C preprocessor... gcc -E*
*checking for grep that handles long lines and -e... (cached) /bin/grep*
*checking for ant... no*
*checking for cpp... /usr/local/bin/cpp*
*checking if gcc supports -Wall... yes*
*checking if gcc supports -Wmissing-prototypes... yes*
*checking if gcc supports -ffloat-store... yes*
*checking if gcc supports --exclude-libs... yes*
*checking for flex... flex*
*checking lex output file root... lex.yy*
*checking lex library... none needed*
*checking whether yytext is a pointer... no*
*checking for bison... bison -y*
*checking ieeefp.h usability... no*
*checking ieeefp.h presence... no*
*checking for ieeefp.h... no*
*checking termios.h usability... yes*
*checking termios.h presence... yes*
*checking for termios.h... yes*
*checking for vasprintf... yes*
*checking for asprintf... yes*
*checking for _LARGEFILE_SOURCE value needed for large files... no*
*checking whether isfinite is declared... yes*
*checking whether isfinite is declared... yes*
*checking for perl... /usr/bin/perl*
*checking for xsltproc... /usr/bin/xsltproc*
*checking for convert... no*
*configure: WARNING: ImageMagick does not seem to be installed.
Documentation cannot be built*
*checking for dblatex... no*
*configure: WARNING: dblatex is not installed so PDF documentation cannot
be built*
*checking for xmllint... /usr/bin/xmllint*
*configure: WARNING: could not locate Docbook stylesheets required to
build the documentation*
*checking CUnit/CUnit.h usability... no*
*checking CUnit/CUnit.h presence... no*
*checking for CUnit/CUnit.h... no*
*configure: WARNING: could not locate CUnit required for unit tests*
*checking iconv.h usability... yes*
*checking iconv.h presence... yes*
*checking for iconv.h... yes*
*checking for libiconv_open in -liconv... no*
*checking for iconv_open in -lc... yes*
*checking for iconvctl... no*
*checking for libiconvctl... no*
*Using user-specified pg_config file: /pgsql/bin/pg_config*
*checking PostgreSQL version... PostgreSQL 9.6*
*checking libpq-fe.h usability... yes*
*checking libpq-fe.h presence... yes*
*checking for libpq-fe.h... yes*
*checking for PQserverVersion in -lpq... yes*
*checking for xml2-config... /usr/bin/xml2-config*
*checking libxml/tree.h usability... yes*
*checking libxml/tree.h presence... yes*
*checking for libxml/tree.h... yes*
*checking libxml/parser.h usability... yes*
*checking libxml/parser.h presence... yes*
*checking for libxml/parser.h... yes*
*checking libxml/xpath.h usability... yes*
*checking libxml/xpath.h presence... yes*
*checking for libxml/xpath.h... yes*
*checking libxml/xpathInternals.h usability... yes*
*checking libxml/xpathInternals.h presence... yes*
*checking for libxml/xpathInternals.h... yes*
*checking for xmlInitParser in -lxml2... no*
*configure: error: could not find libxml2*

I am not sure how to fix that in general :(?

On Mon, Oct 24, 2016 at 5:37 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ankit Sablok <ankitsab@buffalo.edu> writes:

I am trying to install PostGIS on a RHEL_5 system and failing at it
miserably. The way I am trying to install it is as follows. I copy over

all

the artifacts of postgresql server as in the bin, lib, share

directories of

postgresql server in a directory called pgql and I place it in the root
directory i.e /pgsql is the directory which contains things like

pg_config

and all the other libs and bins that one gets by installing postgresql
using the standard installation.

(1) did you remember the include directory?

(2) I think this process will not work unless /pgsql was also the install
directory on the source machine. You can check that by running pg_config
by hand and seeing what it prints for INCLUDEDIR, but it looks to me like
it just parrots what PG's configure expected the installation path to be.

(This is assuming that PostGIS's configure even pays attention to what
pg_config says for INCLUDEDIR. I've not checked.)

Is there a good reason why you're not building Postgres on the same
machine where you're building PostGIS? It seems like a recipe for
trouble, with little to be gained.

regards, tom lane

#6John R Pierce
pierce@hogranch.com
In reply to: Ankit Sablok (#4)
Re: Errors while installing PostGIS by an unusual method

On 10/24/2016 11:08 AM, Ankit Sablok wrote:

Thanks for replying Tom and Asif, I think the issue was that libpq.so
present in the /pgsql/lib directory did not have all its dependencies
installed on the system namely openssl hence I execute the command
sudo yum install openssl and that proceeded the configure script
forward, but now I ran into a separate issue where I do see libxml2
libraries present in the /pgsql/lib directory and I have also set the
appropriate PATH and LD_LIBRARY_PATH for the build to happen
successfully, here is the configure log when I execute the following
command

you typically need to install the corresponding -devel packages if
you're building software with those libraries, like libxml2-devel,
openssl-devel, etcetc.

--
john r pierce, recycling bits in santa cruz

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general