Re: Failure during initdb - creating dictionaries ... FATAL: could not access file "$libdir/libdict_snowball": No such file or directory - Mailing list pgsql-general

From Tom Lane
Subject Re: Failure during initdb - creating dictionaries ... FATAL: could not access file "$libdir/libdict_snowball": No such file or directory
Date
Msg-id 27615.1242222896@sss.pgh.pa.us
Whole thread Raw
In response to Failure during initdb - creating dictionaries ... FATAL: could not access file "$libdir/libdict_snowball": No such file or directory  (Jonathan Groll <lists@groll.co.za>)
Responses Re: Failure during initdb - creating dictionaries ... FATAL: could not access file "$libdir/libdict_snowball": No such file or directory
List pgsql-general
Jonathan Groll <lists@groll.co.za> writes:
> Custom built postgresql 8.3.5 using the pkgsrc build system on OS X
> Leopard;

Uh ... what is the "pkgsrc build system", and what changes does it make
to a straight-from-source PG build?

> creating conversions ... ok
> creating dictionaries ... FATAL:  could not access file
> "$libdir/libdict_snowball": No such file or directory

What you've apparently got here is a problem with shared-library
building, but it's odd that it would've got through the "creating
conversions" step, which also relies heavily on shared libraries.

> sh-3.2$ ls -l /Volumes/pkgsrc/pkg/lib/postgresql | grep snowball
> -rwxr-xr-x  1 root  wheel   341480 Feb 27 17:06
> libdict_snowball.0.0.0.dylib
> lrwxr-xr-x  1 root  wheel       28 Feb 27 17:06
> libdict_snowball.0.dylib -> libdict_snowball.0.0.0.dylib
> lrwxr-xr-x  1 root  wheel       28 Feb 27 17:06 libdict_snowball.dylib
> -> libdict_snowball.0.0.0.dylib
> -rwxr-xr-x  1 root  wheel      893 Feb 27 17:06 libdict_snowball.la

I find this pretty suspicious.  On my OSX machine, the contents of the
pkglibdir directory are all named something.so:

$ ls version83/lib/postgresql
ascii_and_mic.so*                       utf8_and_euc_cn.so*
cyrillic_and_mic.so*                    utf8_and_euc_jis_2004.so*
dict_snowball.so*                       utf8_and_euc_jp.so*
euc_cn_and_mic.so*                      utf8_and_euc_kr.so*
euc_jis_2004_and_shift_jis_2004.so*     utf8_and_euc_tw.so*
euc_jp_and_sjis.so*                     utf8_and_gb18030.so*
euc_kr_and_mic.so*                      utf8_and_gbk.so*
euc_tw_and_big5.so*                     utf8_and_iso8859.so*
latin2_and_win1250.so*                  utf8_and_iso8859_1.so*
latin_and_mic.so*                       utf8_and_johab.so*
pgxs/                                   utf8_and_shift_jis_2004.so*
plpgsql.so*                             utf8_and_sjis.so*
utf8_and_ascii.so*                      utf8_and_uhc.so*
utf8_and_big5.so*                       utf8_and_win.so*
utf8_and_cyrillic.so*
$

Notice also the lack of the "lib" prefix.  The source code that you are
quoting should look like this:

CREATE FUNCTION dsnowball_init(INTERNAL)
    RETURNS INTERNAL AS '$libdir/dict_snowball', 'dsnowball_init'
LANGUAGE C STRICT;

so how did it get to be 'libdir/libdict_snowball'?

It looks to me like you are using code that someone has hacked up to try
to impose their own ideas of how to build/name shared libraries for OS X,
and done a pretty darn poor job of it.

Recommendation: get an unmodified copy of Postgres and build it
yourself.  It works fine out-of-the-box on OS X.

            regards, tom lane

pgsql-general by date:

Previous
From: Jonathan Groll
Date:
Subject: Failure during initdb - creating dictionaries ... FATAL: could not access file "$libdir/libdict_snowball": No such file or directory
Next
From: Alvaro Herrera
Date:
Subject: Re: Btree indizes, FILLFACTOR, vacuum_freeze_min_age and CLUSTER