Forum OpenACS Q&A: PostgreSQL installon Mac OS X -- readline library not found, compile wows

Trying to install PostgreSQL on Mac OS X (10.2.6), I get an error message:

checking for readline... no
configure: error: readline library not found
If you have readline already installed, see config.log for details on the
failure.  It is possible the compiler isn't looking in the proper directory.
Use --without-readline to disable readline support.

I downloaded and compiled the realine function from GNU, ran the postgrSQL ./configure command again and got the same error.

I then tried the ./configure command with --without-readline and this time it worked.

Can anyone tell me why the installer didin't locate the readline library when I had downloaded and compiled it?

Also, I am now trying to run make on the postgres installer and I get all these other errors, see below...

I feel like I just haven't got all the include files but I don't know where to look.

[jupiter:backend/storage/ipc] jfb% make
gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../src/include  -c -o ipc.o ipc.c
gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../src/include  -c -o ipci.o ipci.c
gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../src/include  -c -o pmsignal.o pmsignal.c
gcc -traditional-cpp -g -O2 -Wall -Wmissing-prototypes -Wmissing-declarations -I../../../../src/include  -c -o shmem.o shmem.c
In file included from /usr/include/math.h:24,
                from ../../../../src/include/utils/timestamp.h:17,
                from ../../../../src/include/utils/nabstime.h:21,
                from ../../../../src/include/access/xact.h:19,
                from ../../../../src/include/utils/tqual.h:19,
                from shmem.c:66:
/usr/include/architecture/ppc/math.h:128: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:128: error: parse error before "__cplusplus"
/usr/include/architecture/ppc/math.h:129: error: syntax error before "inline"
/usr/include/architecture/ppc/math.h:130: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:130: error: parse error before "else"
/usr/include/architecture/ppc/math.h:131: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:132: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:140: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:140: error: parse error before "__cplusplus"
/usr/include/architecture/ppc/math.h:141: error: syntax error before "inline"
/usr/include/architecture/ppc/math.h:142: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:142: error: parse error before "else"
/usr/include/architecture/ppc/math.h:143: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:144: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:151: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:151: error: parse error before "__cplusplus"
/usr/include/architecture/ppc/math.h:152: error: syntax error before "inline"
/usr/include/architecture/ppc/math.h:153: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:153: error: parse error before "else"
/usr/include/architecture/ppc/math.h:154: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:155: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:163: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:163: error: parse error before "__cplusplus"
/usr/include/architecture/ppc/math.h:164: error: syntax error before "inline"
/usr/include/architecture/ppc/math.h:165: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:165: error: parse error before "else"
/usr/include/architecture/ppc/math.h:166: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:167: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:175: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:175: error: parse error before "__cplusplus"
/usr/include/architecture/ppc/math.h:176: error: syntax error before "inline"
/usr/include/architecture/ppc/math.h:177: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:177: error: parse error before "else"
/usr/include/architecture/ppc/math.h:178: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:179: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:187: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:187: error: parse error before "__cplusplus"
/usr/include/architecture/ppc/math.h:188: error: syntax error before "inline"
/usr/include/architecture/ppc/math.h:189: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:189: error: parse error before "else"
/usr/include/architecture/ppc/math.h:190: error: syntax error at '#' token
/usr/include/architecture/ppc/math.h:191: error: syntax error at '#' token
make: *** [shmem.o] Error 1

it depends on where you installed readline when you built it, and whether the PG configure was able to find it there - the install location is set with --prefix=/path/to/install when you configure readline, and you can tell the PG configure where to find it with --with-includes=DIRS and --with-libraries=DIRS

Personally, I use fink for infrastructure type stuff like readline, and configure all my local software with "--with-includes=/sw/include --with-libraries=/sw/lib" and stuff tends to work without manual massaging...

From the other errors you're seeing, it looks like you may be using a version of PG that must be patched to work with OSX >= 10.2. What version of PG are you trying to build? If it's 7.2, you'll need to apply this patch to your source tree (it's against 7.2.1, but I'd expect it'll apply cleanly against whatever is at the head of 7.2 these days)

cheers

i'm running 10.2.6.

i've had no trouble compiling either 7.2.3 or 7.3x

the instructions on http://www.borkware.com/rants/openacs/ were helpful to me.

for readline specifically, you can either install it using fink (http://fink.sourceforge.net) or by compiling readline from scratch.

compiling readline:
% curl -O ftp://ftp.gnu.org/pub/gnu/readline/readline-4.3.tar.gz
% tar zxvf readline-4.3.tar.gz
% cd readline-4.3
% perl -i.bak -p -e \
    "s/SHLIB_LIBS=.*/SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'/g" \
    support/shobj-conf
% ./configure
% make
% make install

fink is probably easiest...

install fink then:
% sudo /sw/bin/fink install readline
and from your postgresql source dir:
% ./configure --with-includes=/sw/include/ --with-libraries=/sw/lib
% make
% install

I just installed openacs HEAD on 10.2 with the following packages:
aolserver-4.0-beta10-src
nssha1-0.1
tDOM-0.7.8
nscache-1.5
openacs-4
tcl8.4.4
nspostgres-4.0beta1
postgresql-7.3.4
I built postgres with --without-readline. I also had to change postgresql.conf
#
#       Locale settings
#
# (initialized by initdb -- may be changed)
LC_MESSAGES = 'C'    
LC_MONETARY = 'C'
LC_NUMERIC = 'C'
LC_TIME = 'C'
I had to add require package tdom to 0-acs-init.tcl. Safari will timeout installing but if you just wait awhile then reload the process continues.
barry,

i've been able to compile everything except the nspostgres driver, and i don't really have the knowledge to figure out what is going wrong.

is there any way i could grab a copy of the so from you?  i would be infinitely grateful!

I see in another thread you got the driver compiled. Here is my config file. You'll have to change a couple of paths and perhaps the postgres config but it should get you started.