Search Postgresql Archives

Re: statically compiling postgres and problem with initdb

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx> wrote:

From: Craig Ringer <craig@xxxxxxxxxxxxxxxxxxxxx>
Subject: Re: statically compiling postgres and problem with initdb
To: pgsql-general@xxxxxxxxxxxxxx, mona_attarian@xxxxxxxxx
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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux