Re: statically compiling postgres and problem with initdb - Mailing list pgsql-general

From mona attariyan
Subject Re: statically compiling postgres and problem with initdb
Date
Msg-id 1309511462.936.YahooMailClassic@web161709.mail.bf1.yahoo.com
Whole thread Raw
In response to Re: statically compiling postgres and problem with initdb  (Craig Ringer <craig@postnewspapers.com.au>)
Responses Re: statically compiling postgres and problem with initdb
List pgsql-general
Sorry about the incomplete question. I'm compiling postgres 9.0.4 from source code and I got the tar ball from here: http://www.postgresql.org/ftp/source/v9.0.4/

I'm using Postgres to evaluate a research tool and the tool doesn't work with dynamic libraries. That's why I need to compile it statically. I also have a custom version of glibc which is slightly different from glibc 2.5.1. The difference is related to the use of hardware counters for network related libc functions. Shouldn't matter for Postgres compilation. Here is what I pass to configure (I try to compile statically with my custom glibc):

CFLAGS="-O0 -I/[PATH]/glibc-2.5.1-custom/prefix/include -static -pthread $CFLAGS" \
CPPFLAGS="-O0 -I/[PATH]/glibc-2.5.1-custom/prefix/include -static -pthread $CPPFLAGS" \
LDFLAGS="-static -Wl,-rpath,/[PATH]/glibc-2.5.1-custom/prefix/lib -L/[PATH]/glibc-2.5.1-custom/prefix/lib -Wl,-z,now -Wl,--dynamic-linker=/[PATH]/glibc-2.5.1-custom/prefix/lib/ld-linux.so.2 $LDFLAGS" \
./configure --without-readline

and I'm compiling on a Fedora 7 on a custom kernel which is close to 2.6.26.
The compilation finished fine and it installed correctly. When I try to run initdb I get the following message:

creating conversions ... FATAL:  could not load library "/usr/local/pgsql/lib/ascii_and_mic.so": /usr/local/pgsql/lib/ascii_and_mic.so: undefined symbol: pg_ascii2mic
STATEMENT:  CREATE OR REPLACE FUNCTION ascii_to_mic (INTEGER, INTEGER, CSTRING, INTERNAL, INTEGER) RETURNS VOID AS '$libdir/ascii_and_mic', 'ascii_to_mic' LANGUAGE C STRICT;

Thanks
--Mona

--- On Fri, 7/1/11, Craig Ringer <craig@postnewspapers.com.au> wrote:

From: Craig Ringer <craig@postnewspapers.com.au>
Subject: Re: [GENERAL] statically compiling postgres and problem with initdb
To: pgsql-general@postgresql.org, mona_attarian@yahoo.com
Date: Friday, July 1, 2011, 1:26 AM

On 1/07/2011 3:28 PM, mona attariyan wrote:
> Hi,
> I statically compiled my postgres and I got the following message when I
> ran initdb:

How did you compile Pg statically?

Please show your configure command line, any environment variables you set, etc.

You've also left out a huge amount of information, like your Pg version, where you got the sources from, your OS version, your compiler version, etc. I strongly suggest that you read this:

  http://wiki.postgresql.org/wiki/Guide_to_reporting_problems

before posting a follow-up.

> There was a discussion about this in the archive, but there wasn't any
> fix for it. I have to compile postgres statically for the project I'm
> doing.

Why? Perhaps if you explained that in a bit more detail it'd be possible to find an alternative.

--
Craig Ringer

pgsql-general by date:

Previous
From: rdunklau@gmail.com
Date:
Subject: Anonymous record type and inner types.
Next
From: AI Rumman
Date:
Subject: pg_rman in Windows - is it possible?