Installing PostgreSQL 10 on Mac OSX Undefined Symbol _heap_modify_tuple_by_cols

Started by Ben Madinover 8 years ago4 messagesgeneral
Jump to latest
#1Ben Madin
ben@ausvet.com.au

G'day,

we are quite excited about the parallelisation enhancements, and keen to
try, but trying to build (using the same configure as we have used for 9.6)
is giving some warnings and errors.

The detail is below, but the oddity I'm really wondering about is the
reference in the command to /usr/local/pgsql965/... this was my current 9.6
install (which went smoothly) - but why is it being referenced in the make
for 10...? Is this looking for an existing environment variable (which
seems unlikely for a build process) or is something else unusual?

I am still on Sierra (Darwin orion.local 16.7.0 Darwin Kernel Version
16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64
x86_64)

and using this configure:

./configure --prefix=/usr/local/pgsql-10 --with-extra-version=BM
--with-python --with-openssl --with-bonjour --with-uuid=e2fs --with-libxml
--with-libxslt
PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3

and the build failure ends with:

/Applications/Xcode.app/Contents/Developer/usr/bin/make -C
../../../contrib/spi
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -O2 -arch x86_64 -DREFINT_VERBOSE -I.
-I./ -I/usr/local/pgsql965/include/server
-I/usr/local/pgsql965/include/internal
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2
-I/usr/local/include -c -o autoinc.o autoinc.c
autoinc.c:116:14: warning: implicit declaration of function
'heap_modify_tuple_by_cols' is invalid in C99
[-Wimplicit-function-declaration]
rettuple = heap_modify_tuple_by_cols(rettuple, tupdesc,
^
autoinc.c:116:12: warning: incompatible integer to pointer conversion
assigning to 'HeapTuple' (aka 'struct HeapTupleData *') from 'int'
[-Wint-conversion]
rettuple = heap_modify_tuple_by_cols(rettuple, tupdesc,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -O2 -arch x86_64
-L/usr/local/pgsql965/lib
-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/lib
-L/usr/local/lib -Wl,-dead_strip_dylibs -arch x86_64
-L/usr/local/pgsql965/lib/pgxs/src/makefiles/../../src/port -lpgport
-bundle -bundle_loader /usr/local/pgsql965/bin/postgres -o autoinc.so
autoinc.o
ld: warning: directory not found for option
'-L/usr/local/pgsql965/lib/pgxs/src/makefiles/../../src/port'
Undefined symbols for architecture x86_64:
"_heap_modify_tuple_by_cols", referenced from:
_autoinc in autoinc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
make[3]: *** [autoinc.so] Error 1
make[2]: *** [submake-contrib-spi] Error 2
make[1]: *** [all-test/regress-recurse] Error 2
make: *** [all-src-recurse] Error 2

cheers

Ben

--

Ben Madin

m : +61 448 887 220
w : +61 8 7200 7220

e : ben@ausvet.com.au

5 Shuffrey Street, Fremantle
Western Australia

on the web: www.ausvet.com.au

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this email are the opinion of the
writer only and are not endorsed by Ausvet unless expressly stated
otherwise. Although Ausvet uses virus scanning software we do not accept
liability for viruses or similar in any attachments.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ben Madin (#1)
Re: Installing PostgreSQL 10 on Mac OSX Undefined Symbol _heap_modify_tuple_by_cols

Ben Madin <ben@ausvet.com.au> writes:

we are quite excited about the parallelisation enhancements, and keen to
try, but trying to build (using the same configure as we have used for 9.6)
is giving some warnings and errors.

Something's definitely messed up there:

gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -O2 -arch x86_64 -DREFINT_VERBOSE -I.
-I./ -I/usr/local/pgsql965/include/server
-I/usr/local/pgsql965/include/internal
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2
-I/usr/local/include -c -o autoinc.o autoinc.c

Looking at this example of a v10 build log on macOS:
https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?nm=longfin&amp;dt=2017-10-23%2018%3A15%3A34&amp;stg=make

the compile command for autoinc is

ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -O2 -fno-common -Wno-deprecated-declarations -Werror -DREFINT_VERBOSE -I. -I. -I../../src/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2 -I/usr/local/ssl/include -c -o autoinc.o autoinc.c

Some of the discrepancies (e.g. -Werror on the buildfarm machine) are
explainable as different configuration choices, but the references to
/usr/local/pgsql965 in your build sure look like trouble.

Is this looking for an existing environment variable (which
seems unlikely for a build process) or is something else unusual?

I believe the configure script *does* pay attention to environment
variables, particularly CPPFLAGS and CFLAGS. Most likely you had
version-specific values in those when you ran configure, and they
got absorbed into src/Makefile.global.

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

#3Ben Madin
ben@ausvet.com.au
In reply to: Tom Lane (#2)
Re: Installing PostgreSQL 10 on Mac OSX Undefined Symbol _heap_modify_tuple_by_cols

G'day Tom,

Thanks for the feedback. I couldn't find anywhere that suggested that I had
set the CPPFLAGS or CFLAGS environment variables, so I removed the
following lines from my profile:

#export USE_PGXS=1
#export PG_LIB_DIR="/usr/local/pgsql/lib"
#export PG_CONFIG="/usr/local/pgsql/bin/pg_config"
#export PGDATA="/usr/local/pgsql/data"

and tried again - worked a treat!

I haven't tried to work out which of these lines caused the problem, but
hopefully if anyone else has a similar problem they might benefit!

cheers

Ben

On 24 October 2017 at 02:43, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ben Madin <ben@ausvet.com.au> writes:

we are quite excited about the parallelisation enhancements, and keen to
try, but trying to build (using the same configure as we have used for

9.6)

is giving some warnings and errors.

Something's definitely messed up there:

gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -O2 -arch x86_64 -DREFINT_VERBOSE -I.
-I./ -I/usr/local/pgsql965/include/server
-I/usr/local/pgsql965/include/internal
-I/Applications/Xcode.app/Contents/Developer/Platforms/

MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2

-I/usr/local/include -c -o autoinc.o autoinc.c

Looking at this example of a v10 build log on macOS:
https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?
nm=longfin&dt=2017-10-23%2018%3A15%3A34&stg=make

the compile command for autoinc is

ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument
-g -O2 -fno-common -Wno-deprecated-declarations -Werror -DREFINT_VERBOSE
-I. -I. -I../../src/include -I/Applications/Xcode.app/
Contents/Developer/Platforms/MacOSX.platform/Developer/
SDKs/MacOSX10.13.sdk/usr/include/libxml2 -I/usr/local/ssl/include -c -o
autoinc.o autoinc.c

Some of the discrepancies (e.g. -Werror on the buildfarm machine) are
explainable as different configuration choices, but the references to
/usr/local/pgsql965 in your build sure look like trouble.

Is this looking for an existing environment variable (which
seems unlikely for a build process) or is something else unusual?

I believe the configure script *does* pay attention to environment
variables, particularly CPPFLAGS and CFLAGS. Most likely you had
version-specific values in those when you ran configure, and they
got absorbed into src/Makefile.global.

regards, tom lane

--

Dr Ben Madin
Managing Director

m : +61 448 887 220

e : ben@ausvet.com.au

5 Shuffrey Street, Fremantle
Western Australia

on the web: www.ausvet.com.au

This transmission is for the intended addressee only and is confidential
information. If you have received this transmission in error, please delete
it and notify the sender. The contents of this email are the opinion of the
writer only and are not endorsed by Ausvet unless expressly stated
otherwise. Although Ausvet uses virus scanning software we do not accept
liability for viruses or similar in any attachments.

#4Ben Madin
ben@ausvet.com.au
In reply to: Ben Madin (#3)
Re: Installing PostgreSQL 10 on Mac OSX Undefined Symbol _heap_modify_tuple_by_cols

to clarify, I commented them out, hence the # - it wasn't that I removed
lines that were already commented out :)

On 25 October 2017 at 22:21, Ben Madin <ben@ausvet.com.au> wrote:

Show quoted text

G'day Tom,

Thanks for the feedback. I couldn't find anywhere that suggested that I
had set the CPPFLAGS or CFLAGS environment variables, so I removed the
following lines from my profile:

#export USE_PGXS=1
#export PG_LIB_DIR="/usr/local/pgsql/lib"
#export PG_CONFIG="/usr/local/pgsql/bin/pg_config"
#export PGDATA="/usr/local/pgsql/data"

and tried again - worked a treat!

I haven't tried to work out which of these lines caused the problem, but
hopefully if anyone else has a similar problem they might benefit!

cheers

Ben

On 24 October 2017 at 02:43, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ben Madin <ben@ausvet.com.au> writes:

we are quite excited about the parallelisation enhancements, and keen to
try, but trying to build (using the same configure as we have used for

9.6)

is giving some warnings and errors.

Something's definitely messed up there:

gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -O2 -arch x86_64 -DREFINT_VERBOSE

-I.

-I./ -I/usr/local/pgsql965/include/server
-I/usr/local/pgsql965/include/internal
-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOS

X.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include/libxml2

-I/usr/local/include -c -o autoinc.o autoinc.c

Looking at this example of a v10 build log on macOS:
https://buildfarm.postgresql.org/cgi-bin/show_stage_log.pl?n
m=longfin&dt=2017-10-23%2018%3A15%3A34&stg=make

the compile command for autoinc is

ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith
-Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
-Wformat-security -fno-strict-aliasing -fwrapv
-Wno-unused-command-line-argument -g -O2 -fno-common
-Wno-deprecated-declarations -Werror -DREFINT_VERBOSE -I. -I.
-I../../src/include -I/Applications/Xcode.app/Cont
ents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX10.13.sdk/usr/include/libxml2 -I/usr/local/ssl/include -c -o
autoinc.o autoinc.c

Some of the discrepancies (e.g. -Werror on the buildfarm machine) are
explainable as different configuration choices, but the references to
/usr/local/pgsql965 in your build sure look like trouble.

Is this looking for an existing environment variable (which
seems unlikely for a build process) or is something else unusual?

I believe the configure script *does* pay attention to environment
variables, particularly CPPFLAGS and CFLAGS. Most likely you had
version-specific values in those when you ran configure, and they
got absorbed into src/Makefile.global.

regards, tom lane