error while installing auto_explain contrib module

Started by Sachin Kotwalalmost 10 years ago8 messagesgeneral
Jump to latest
#1Sachin Kotwal
kotsachin@gmail.com

Hi,

I am trying to install auto_explain on PostgreSQL-9.3.11
OS X EI Capitan - 10.11

I am getting following error:

------
$ pwd
/Users/sachin/postgres_git/postgres/contrib/auto_explain

$ make
gcc -g -O0 -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 -pg -I. -I. -I../../src/include
-I/opt/local/include/libxml2 -c -o auto_explain.o auto_explain.c
gcc -g -O0 -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 -pg -bundle -multiply_defined
suppress -o auto_explain.so auto_explain.o -L../../src/port
-L../../src/common -L/opt/local/lib -Wl,-dead_strip_dylibs
-bundle_loader ../../src/backend/postgres
ld: warning: directory not found for option '-L/usr/local/lib'
Undefined symbols for architecture x86_64:
"_MemoryContextSwitchTo", referenced from:
_explain_ExecutorStart in auto_explain.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: *** [auto_explain.so] Error 1

--

Thanks and Regards,
Sachin Kotwal

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sachin Kotwal (#1)
Re: error while installing auto_explain contrib module

On 04/18/2016 11:46 PM, Sachin Kotwal wrote:

Hi,

I am trying to install auto_explain on PostgreSQL-9.3.11
OS X EI Capitan - 10.11

Did you install the 9.3.11 server from source also?

I am getting following error:

------
$ pwd
/Users/sachin/postgres_git/postgres/contrib/auto_explain

What version of Postgres is the above pointing to?

$ make
gcc -g -O0 -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 -pg -I. -I. -I../../src/include
-I/opt/local/include/libxml2 -c -o auto_explain.o auto_explain.c
gcc -g -O0 -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 -pg -bundle -multiply_defined
suppress -o auto_explain.so auto_explain.o -L../../src/port
-L../../src/common -L/opt/local/lib -Wl,-dead_strip_dylibs
-bundle_loader ../../src/backend/postgres
ld: warning: directory not found for option '-L/usr/local/lib'
Undefined symbols for architecture x86_64:
"_MemoryContextSwitchTo", referenced from:
_explain_ExecutorStart in auto_explain.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: *** [auto_explain.so] Error 1

--

Thanks and Regards,
Sachin Kotwal

--
Adrian Klaver
adrian.klaver@aklaver.com

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

#3Sachin Kotwal
kotsachin@gmail.com
In reply to: Adrian Klaver (#2)
Re: error while installing auto_explain contrib module

On Tue, Apr 19, 2016 at 7:02 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

On 04/18/2016 11:46 PM, Sachin Kotwal wrote:

Hi,

I am trying to install auto_explain on PostgreSQL-9.3.11
OS X EI Capitan - 10.11

Did you install the 9.3.11 server from source also?

Yes. I have clone git repository and checkout for pg-9.3.11

I am getting following error:

------
$ pwd
/Users/sachin/postgres_git/postgres/contrib/auto_explain

What version of Postgres is the above pointing to?

This is my postgres git repository and i have checkout for pg-9.3.11
So above is pointing to auto_explain directory under contrib for same
postgres version.
Here is my pg_config output:

-----
$ pg_config
BINDIR = /Users/sachin/pg_git_install/9.3.11/bin
DOCDIR = /Users/sachin/pg_git_install/9.3.11/share/doc/postgresql
HTMLDIR = /Users/sachin/pg_git_install/9.3.11/share/doc/postgresql
INCLUDEDIR = /Users/sachin/pg_git_install/9.3.11/include
PKGINCLUDEDIR = /Users/sachin/pg_git_install/9.3.11/include/postgresql
INCLUDEDIR-SERVER =
/Users/sachin/pg_git_install/9.3.11/include/postgresql/server
LIBDIR = /Users/sachin/pg_git_install/9.3.11/lib
PKGLIBDIR = /Users/sachin/pg_git_install/9.3.11/lib/postgresql
LOCALEDIR = /Users/sachin/pg_git_install/9.3.11/share/locale
MANDIR = /Users/sachin/pg_git_install/9.3.11/share/man
SHAREDIR = /Users/sachin/pg_git_install/9.3.11/share/postgresql
SYSCONFDIR = /Users/sachin/pg_git_install/9.3.11/etc/postgresql
PGXS =
/Users/sachin/pg_git_install/9.3.11/lib/postgresql/pgxs/src/makefiles/
pgxs.mk
CONFIGURE = '--with-libxml' '--enable-cassert' '--enable-debug'
'--enable-profiling' '--prefix=/Users/sachin/pg_git_install/9.3.11/'
'--with-python' 'CFLAGS=-g -O0'
CC = gcc
CPPFLAGS = -I/usr/include/libxml2
CFLAGS = -g -O0 -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 -pg
CFLAGS_SL =
LDFLAGS = -L../../../src/common -Wl,-dead_strip_dylibs
LDFLAGS_EX =
LDFLAGS_SL =
LIBS = -lpgport -lpgcommon -lxml2 -lz -lreadline -lm
VERSION = PostgreSQL 9.3.11

----

$ make
gcc -g -O0 -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 -pg -I. -I. -I../../src/include
-I/opt/local/include/libxml2 -c -o auto_explain.o auto_explain.c
gcc -g -O0 -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 -pg -bundle -multiply_defined
suppress -o auto_explain.so auto_explain.o -L../../src/port
-L../../src/common -L/opt/local/lib -Wl,-dead_strip_dylibs
-bundle_loader ../../src/backend/postgres
ld: warning: directory not found for option '-L/usr/local/lib'
Undefined symbols for architecture x86_64:
"_MemoryContextSwitchTo", referenced from:
_explain_ExecutorStart in auto_explain.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: *** [auto_explain.so] Error 1

--

Thanks and Regards,
Sachin Kotwal

--
Adrian Klaver
adrian.klaver@aklaver.com

--

Thanks and Regards,
Sachin Kotwal

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Sachin Kotwal (#3)
Re: error while installing auto_explain contrib module

Sachin Kotwal <kotsachin@gmail.com> writes:

On Tue, Apr 19, 2016 at 7:02 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

Did you install the 9.3.11 server from source also?

Yes. I have clone git repository and checkout for pg-9.3.11

The reason for that question is that the most obvious explanation for this
failure is that the auto_explain build is seeing a different value for
PG_USE_INLINE than the main server build did. So probably your include
path is picking up a pg_config.h that does not match the postgres
executable the link is happening against.

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

#5Sachin Kotwal
kotsachin@gmail.com
In reply to: Tom Lane (#4)
Re: error while installing auto_explain contrib module

Hi Tom,

Thanks for reply.

On Tue, Apr 19, 2016 at 7:40 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Sachin Kotwal <kotsachin@gmail.com> writes:

On Tue, Apr 19, 2016 at 7:02 PM, Adrian Klaver <

adrian.klaver@aklaver.com>

wrote:

Did you install the 9.3.11 server from source also?

Yes. I have clone git repository and checkout for pg-9.3.11

The reason for that question is that the most obvious explanation for this
failure is that the auto_explain build is seeing a different value for
PG_USE_INLINE than the main server build did.

Ok. But I am not getting getting why auto_explain is doing that.
All pg_config parameters have correct value as per my installation posted
in last mail.

Is it correct behaviour of auto_explain or it is bug ?

So probably your include
path is picking up a pg_config.h that does not match the postgres
executable the link is happening against.

regards, tom lane

If pg_config showing following as INCLUDEDIR path

INCLUDEDIR = /Users/sachin/pg_git_install/9.3.11/include

How it can take pg_config.h from different include path?
Can you tell me where i should look in auto_explain to fix this?

--

Thanks and Regards,
Sachin Kotwal

#6Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sachin Kotwal (#5)
Re: error while installing auto_explain contrib module

On 04/21/2016 02:23 AM, Sachin Kotwal wrote:

Hi Tom,

Thanks for reply.

On Tue, Apr 19, 2016 at 7:40 PM, Tom Lane <tgl@sss.pgh.pa.us
<mailto:tgl@sss.pgh.pa.us>> wrote:

Sachin Kotwal <kotsachin@gmail.com <mailto:kotsachin@gmail.com>> writes:

On Tue, Apr 19, 2016 at 7:02 PM, Adrian Klaver <adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>
wrote:

Did you install the 9.3.11 server from source also?

Yes. I have clone git repository and checkout for pg-9.3.11

The reason for that question is that the most obvious explanation
for this
failure is that the auto_explain build is seeing a different value for
PG_USE_INLINE than the main server build did.

Ok. But I am not getting getting why auto_explain is doing that.
All pg_config parameters have correct value as per my installation
posted in last mail.

Do you have a Postgres instance installed that did not come from the Git
clone?

Is it correct behaviour of auto_explain or it is bug ?

So probably your include
path is picking up a pg_config.h that does not match the postgres
executable the link is happening against.

regards, tom lane

If pg_config showing following as INCLUDEDIR path

INCLUDEDIR = /Users/sachin/pg_git_install/9.3.11/include

How it can take pg_config.h from different include path?

Can you tell me where i should look in auto_explain to fix this?

--

Thanks and Regards,
Sachin Kotwal

--
Adrian Klaver
adrian.klaver@aklaver.com

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

#7Sachin Kotwal
kotsachin@gmail.com
In reply to: Adrian Klaver (#6)
Re: error while installing auto_explain contrib module

On Thu, Apr 21, 2016 at 7:20 PM, Adrian Klaver <adrian.klaver@aklaver.com>
wrote:

On 04/21/2016 02:23 AM, Sachin Kotwal wrote:

Hi Tom,

Thanks for reply.

On Tue, Apr 19, 2016 at 7:40 PM, Tom Lane <tgl@sss.pgh.pa.us
<mailto:tgl@sss.pgh.pa.us>> wrote:

Sachin Kotwal <kotsachin@gmail.com <mailto:kotsachin@gmail.com>>
writes:

On Tue, Apr 19, 2016 at 7:02 PM, Adrian Klaver <

adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>>

wrote:

Did you install the 9.3.11 server from source also?

Yes. I have clone git repository and checkout for pg-9.3.11

The reason for that question is that the most obvious explanation
for this
failure is that the auto_explain build is seeing a different value for
PG_USE_INLINE than the main server build did.

Ok. But I am not getting getting why auto_explain is doing that.
All pg_config parameters have correct value as per my installation
posted in last mail.

Do you have a Postgres instance installed that did not come from the Git
clone?

Currently I do not have Postgres installation from other than Git but i
will try that soon.

I did same Postgres version installation of on CentOS 6 , It is working
fine.

I think it is problem with OS X. On OS X contrib tools unable to find
correct installation paths.
I feel we need to fix them.

Is it correct behaviour of auto_explain or it is bug ?

So probably your include
path is picking up a pg_config.h that does not match the postgres
executable the link is happening against.

regards, tom lane

If pg_config showing following as INCLUDEDIR path

INCLUDEDIR = /Users/sachin/pg_git_install/9.3.11/include

How it can take pg_config.h from different include path?

Can you tell me where i should look in auto_explain to fix this?

--

Thanks and Regards,
Sachin Kotwal

--
Adrian Klaver
adrian.klaver@aklaver.com

--

Thanks and Regards,
Sachin Kotwal

#8Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sachin Kotwal (#7)
Re: error while installing auto_explain contrib module

On 04/21/2016 07:13 AM, Sachin Kotwal wrote:

On Thu, Apr 21, 2016 at 7:20 PM, Adrian Klaver
<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>> wrote:

On 04/21/2016 02:23 AM, Sachin Kotwal wrote:

Hi Tom,

Thanks for reply.

On Tue, Apr 19, 2016 at 7:40 PM, Tom Lane <tgl@sss.pgh.pa.us
<mailto:tgl@sss.pgh.pa.us>
<mailto:tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>>> wrote:

Sachin Kotwal <kotsachin@gmail.com
<mailto:kotsachin@gmail.com> <mailto:kotsachin@gmail.com
<mailto:kotsachin@gmail.com>>> writes:

On Tue, Apr 19, 2016 at 7:02 PM, Adrian Klaver

<adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>
<mailto:adrian.klaver@aklaver.com
<mailto:adrian.klaver@aklaver.com>>>

wrote:

Did you install the 9.3.11 server from source also?

Yes. I have clone git repository and checkout for pg-9.3.11

The reason for that question is that the most obvious
explanation
for this
failure is that the auto_explain build is seeing a
different value for
PG_USE_INLINE than the main server build did.

Ok. But I am not getting getting why auto_explain is doing that.
All pg_config parameters have correct value as per my installation
posted in last mail.

Do you have a Postgres instance installed that did not come from the
Git clone?

Currently I do not have Postgres installation from other than Git but i
will try that soon.

I did same Postgres version installation of on CentOS 6 , It is working
fine.

You did that as source install from the Git repo or via a package?

I think it is problem with OS X. On OS X contrib tools unable to find
correct installation paths.
I feel we need to fix them.

I do not use OS X, so I will not be of much help there.

Is it correct behaviour of auto_explain or it is bug ?

So probably your include
path is picking up a pg_config.h that does not match the
postgres
executable the link is happening against.

regards, tom lane

If pg_config showing following as INCLUDEDIR path

INCLUDEDIR = /Users/sachin/pg_git_install/9.3.11/include

How it can take pg_config.h from different include path?

Can you tell me where i should look in auto_explain to fix this?

--

Thanks and Regards,
Sachin Kotwal

--
Adrian Klaver
adrian.klaver@aklaver.com <mailto:adrian.klaver@aklaver.com>

--

Thanks and Regards,
Sachin Kotwal

--
Adrian Klaver
adrian.klaver@aklaver.com

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