Re: EnterpriseDB installed PostgreSQL 9.6 vs. REPMGR. Round 3 - libraries resolved, still can't compile :(

From: Martin Goodson <kaemaril(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Subject: Re: EnterpriseDB installed PostgreSQL 9.6 vs. REPMGR. Round 3 - libraries resolved, still can't compile :(
Date: 2017-05-14 09:43:07
Message-ID: 66203717-ab35-c4ad-f990-3027ad469f33@googlemail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/05/2017 18:57, Adrian Klaver wrote:

> On 05/12/2017 09:19 AM, Martin Goodson wrote:
>> On 12/05/2017 16:59, Adrian Klaver wrote:
>>
>>> Configuring Automatic failover using Replication Manager 2.0 on
>>> PostgreSQL 9.3.5
>>>
>>> http://raghavt.blogspot.com/2015/01/configuring-automatic-failover-using.html
>>>
>>>
>>> "In this post, am demonstrating Replication Manager on single
>>> node(localhost) on RHEL 6.5 - PostgreSQL 9.3.5. In order to achieve
>>> an easy and good understanding of concept I have compiled repmgr
>>> with EnterpriseDB One Click Installer(a pre-build binary package)
>>> instead of PG source."
>>>
>>
>> Looks interesting! I'll give it a go tonight on a clean install and
>> report back on how easy it was and how much of an idiot I am, or my
>> abject failure and how much of an idiot I am :)
>
> To make things easier I would remove the deb installed Postgres, it
> just adds complexity to the situation without providing benefit.
>
>>
>> Many thanks!
>>
>> Regards,
>>
>> Martin.
>
>
Progress of a sort. Kinda.

On a clean Ubuntu server 17.04 virtual machine I've installed PostgreSQL
9.6 using the EnterpriseDB installer. The software was installed by
sudo'ing the installer, configuring ownership to the 'pginst' userid and
is up and running :

pginst 2582 1 0 09:22 ? 00:00:00
/postgresql/software/9.6.2/bin/postgres -D /postgresql/software/9.6.2/data
pginst 2585 2582 0 09:22 ? 00:00:00 postgres: logger process
pginst 2587 2582 0 09:22 ? 00:00:00 postgres: checkpointer
process
pginst 2588 2582 0 09:22 ? 00:00:00 postgres: writer process
pginst 2589 2582 0 09:22 ? 00:00:00 postgres: wal writer process
pginst 2590 2582 0 09:22 ? 00:00:00 postgres: autovacuum
launcher process
pginst 2591 2582 0 09:22 ? 00:00:00 postgres: stats
collector process

I then downloaded the repmgr package (repmgr-3.3.1.tar.gz) from 2nd
quadrant, unzipped and untarred etc to the directory
/home/master/repmgr-3.3.1. I've followed the advice of the article
Adrian suggested and installed some packages:

gcc, make, libxslt1-dev, libpam0g-dev, libssl-dev, libkrb5-dev,
libedit-dev, postgresql-server-dev-9.6

I have now apparently resolved the missing libraries problem. Or, at
least, it's no longer complaining that libs are missing.

I built a little install script which I sudo:

clear
PATH=/postgresql/software/9.6.2/bin:$PATH
echo "PATH = $PATH"
echo ""
pg_config
echo ""
echo "make USE_PGXS=1 clean all"
echo ""
make USE_PGXS=1 clean all

Which produces this output (including the output of pg_config):

PATH =
/postgresql/software/9.6.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin

BINDIR = /postgresql/software/9.6.2/bin
DOCDIR = /postgresql/software/9.6.2/doc/postgresql
HTMLDIR = /postgresql/software/9.6.2/doc/postgresql
INCLUDEDIR = /postgresql/software/9.6.2/include
PKGINCLUDEDIR = /postgresql/software/9.6.2/include/postgresql
INCLUDEDIR-SERVER = /postgresql/software/9.6.2/include/postgresql/server
LIBDIR = /postgresql/software/9.6.2/lib
PKGLIBDIR = /postgresql/software/9.6.2/lib/postgresql
LOCALEDIR = /postgresql/software/9.6.2/share/locale
MANDIR = /postgresql/software/9.6.2/share/man
SHAREDIR = /postgresql/software/9.6.2/share/postgresql
SYSCONFDIR = /postgresql/software/9.6.2/etc/postgresql
PGXS = /postgresql/software/9.6.2/lib/postgresql/pgxs/src/makefiles/pgxs.mk
CONFIGURE = '--enable-debug' '--with-libs=/opt/local/Current/lib'
'--with-includes=/opt/local/Current/include/libxml2:/opt/local/Current/include'
'--prefix=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64'
'--with-ldap' '--with-openssl' '--with-perl' '--with-python'
'--with-tcl'
'--with-tclconfig=/opt/local/EnterpriseDB/LanguagePack/9.6/Tcl-8.5/lib'
'--with-pam' '--enable-thread-safety' '--with-libxml' '--with-ossp-uuid'
'--docdir=/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/doc/postgresql'
'--with-libxslt' '--with-libedit-preferred' '--with-gssapi'
'LD_LIBRARY_PATH=/opt/local/Current/lib' 'CFLAGS=-O2 -DMAP_HUGETLB=0x40000'
CC = gcc
CPPFLAGS = -DFRONTEND -D_GNU_SOURCE -I/opt/local/Current/include/libxml2
-I/opt/local/Current/include
CFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2 -DMAP_HUGETLB=0x40000
CFLAGS_SL = -fpic
LDFLAGS = -L../../src/common -L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/mnt/hgfs/pginstaller.auto/server/staging/linux-x64/lib',--enable-new-dtags
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto
-lgssapi_krb5 -lz -ledit -lrt -lcrypt -ldl -lm
VERSION = PostgreSQL 9.6.2

make USE_PGXS=1 clean all

rm -f *.o
rm -f repmgrd
rm -f repmgr
make -C sql clean
make[1]: Entering directory '/home/master/repmgr-3.3.1/sql'
rm -f repmgr_funcs.so librepmgr_funcs.a librepmgr_funcs.pc
rm -f repmgr_funcs.sql
rm -f repmgr_funcs.o
make[1]: Leaving directory '/home/master/repmgr-3.3.1/sql'
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
dbutils.o dbutils.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
config.o config.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
repmgrd.o repmgrd.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
log.o log.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 -I/postgresql/software/9.6.2/include -I. -I./
-I/postgresql/software/9.6.2/include/postgresql/server
-I/postgresql/software/9.6.2/include/postgresql/internal -D_GNU_SOURCE
-I/opt/local/Current/include/libxml2 -I/opt/local/Current/include -c -o
strutil.o strutil.c
gcc -o repmgrd -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -g -O2
-DMAP_HUGETLB=0x40000 dbutils.o config.o repmgrd.o log.o strutil.o
-L/postgresql/software/9.6.2/lib -lpgcommon -lpgport
-L/postgresql/software/9.6.2/lib -lpq -L/postgresql/software/9.6.2/lib
-L/opt/local/Current/lib -Wl,--as-needed
-Wl,-rpath,'/postgresql/software/9.6.2/lib',--enable-new-dtags
-lpgcommon -lpgport -lxslt -lxml2 -lpam -lssl -lcrypto -lgssapi_krb5 -lz
-ledit -lrt -lcrypt -ldl -lm
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgcommon.a(exec.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgcommon.a(wait_error.o):
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld:
/postgresql/software/9.6.2/lib/libpgcommon.a(fe_memutils.o): relocation
R_X86_64_32 against `.rodata.str1.1' can not be used when making a
shared object; recompile with -fPIC
/usr/bin/ld: /postgresql/software/9.6.2/lib/libpgport.a(path.o):
relocation R_X86_64_32 against `.rodata.str1.1' can not be used when
making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:20: recipe for target 'repmgrd' failed
make: *** [repmgrd] Error 1

This is getting rather frustrating :)

Any suggestions, anyone? Is this another obvious thing that crops up
when compiling anything in PostgreSQL? Or have I hit an 'issue'?

Regards,

Martin.
--
Martin Goodson

"Have you thought up some clever plan, Doctor?"
"Yes, Jamie, I believe I have."
"What're you going to do?"
"Bung a rock at it."

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-05-14 13:55:03 Re: EnterpriseDB installed PostgreSQL 9.6 vs. REPMGR. Round 3 - libraries resolved, still can't compile :(
Previous Message Bruce Momjian 2017-05-14 01:48:55 Re: Top posting....