Thread: Errors while installing PostGIS by an unusual method
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
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
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
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
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
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-libxml2checking build system type... x86_64-unknown-linux-gnuchecking host system type... x86_64-unknown-linux-gnuchecking how to print strings... printfchecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking for a sed that does not truncate output... /bin/sedchecking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for fgrep... /bin/grep -Fchecking for ld used by gcc... /usr/bin/ldchecking if the linker (/usr/bin/ld) is GNU ld... yeschecking for BSD- or MS-compatible name lister (nm)... /usr/bin/nmchecking the name lister (/usr/bin/nm) interface... BSD nmchecking whether ln -s works... yeschecking the maximum length of command line arguments... 1572864checking whether the shell understands some XSI constructs... yeschecking whether the shell understands "+="... yeschecking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noopchecking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noopchecking for /usr/bin/ld option to reload object files... -rchecking for objdump... objdumpchecking how to recognize dependent libraries... pass_allchecking for dlltool... nochecking how to associate runtime and link libraries... printf %s\nchecking for ar... archecking for archiver @FILE support... @checking for strip... stripchecking for ranlib... ranlibchecking for gawk... gawkchecking command to parse /usr/bin/nm output from gcc object... okchecking for sysroot... nochecking for mt... nochecking if : is a manifest tool... nochecking how to run the C preprocessor... gcc -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for dlfcn.h... yeschecking for objdir... .libschecking if gcc supports -fno-rtti -fno-exceptions... nochecking for gcc option to produce PIC... -fPIC -DPICchecking if gcc PIC flag -fPIC -DPIC works... yeschecking if gcc static flag -static works... nochecking if gcc supports -c -o file.o... yeschecking if gcc supports -c -o file.o... (cached) yeschecking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yeschecking whether -lc should be explicitly linked in... nochecking dynamic linker characteristics... GNU/Linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... yeschecking whether to build static libraries... yeschecking for gcc... (cached) gccchecking whether we are using the GNU C compiler... (cached) yeschecking whether gcc accepts -g... (cached) yeschecking for gcc option to accept ISO C89... (cached) none neededchecking how to run the C preprocessor... gcc -Echecking for grep that handles long lines and -e... (cached) /bin/grepchecking for ant... nochecking for cpp... /usr/local/bin/cppchecking if gcc supports -Wall... yeschecking if gcc supports -Wmissing-prototypes... yeschecking if gcc supports -ffloat-store... yeschecking if gcc supports --exclude-libs... yeschecking for flex... flexchecking lex output file root... lex.yychecking lex library... none neededchecking whether yytext is a pointer... nochecking for bison... bison -ychecking ieeefp.h usability... nochecking ieeefp.h presence... nochecking for ieeefp.h... nochecking termios.h usability... yeschecking termios.h presence... yeschecking for termios.h... yeschecking for vasprintf... yeschecking for asprintf... yeschecking for _LARGEFILE_SOURCE value needed for large files... nochecking whether isfinite is declared... yeschecking whether isfinite is declared... yeschecking for perl... /usr/bin/perlchecking for xsltproc... /usr/bin/xsltprocchecking for convert... noconfigure: WARNING: ImageMagick does not seem to be installed. Documentation cannot be builtchecking for dblatex... noconfigure: WARNING: dblatex is not installed so PDF documentation cannot be builtchecking for xmllint... /usr/bin/xmllintconfigure: WARNING: could not locate Docbook stylesheets required to build the documentationchecking CUnit/CUnit.h usability... nochecking CUnit/CUnit.h presence... nochecking for CUnit/CUnit.h... noconfigure: WARNING: could not locate CUnit required for unit testschecking iconv.h usability... yeschecking iconv.h presence... yeschecking for iconv.h... yeschecking for libiconv_open in -liconv... nochecking for iconv_open in -lc... yeschecking for iconvctl... nochecking for libiconvctl... noUsing user-specified pg_config file: /pgsql/bin/pg_configchecking PostgreSQL version... PostgreSQL 9.6checking libpq-fe.h usability... yeschecking libpq-fe.h presence... yeschecking for libpq-fe.h... yeschecking for PQserverVersion in -lpq... yeschecking for xml2-config... /usr/bin/xml2-configchecking libxml/tree.h usability... yeschecking libxml/tree.h presence... yeschecking for libxml/tree.h... yeschecking libxml/parser.h usability... yeschecking libxml/parser.h presence... yeschecking for libxml/parser.h... yeschecking libxml/xpath.h usability... yeschecking libxml/xpath.h presence... yeschecking for libxml/xpath.h... yeschecking libxml/xpathInternals.h usability... yeschecking libxml/xpathInternals.h presence... yeschecking for libxml/xpathInternals.h... yeschecking for xmlInitParser in -lxml2... noconfigure: error: could not find libxml2I 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
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