Re: statically compiling postgres and problem with initdb

From: mona attariyan <mona_attarian(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org, Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Subject: Re: statically compiling postgres and problem with initdb
Date: 2011-07-01 09:11:02
Message-ID: 1309511462.936.YahooMailClassic@web161709.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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_ascii2micSTATEMENT:  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(at)postnewspapers(dot)com(dot)au> wrote:

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Subject: Re: [GENERAL] statically compiling postgres and problem with initdb
To: pgsql-general(at)postgresql(dot)org, mona_attarian(at)yahoo(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2011-07-01 09:18:06 pg_rman in Windows - is it possible?
Previous Message rdunklau 2011-07-01 08:56:29 Anonymous record type and inner types.