Forum OpenACS Q&A: Re: compiling nspostgres

Collapse
11: Re: compiling nspostgres (response to 1)
Posted by Chris Rasch on
Russell,

I did compile Postgres with OpenSSL support.  Here's the configure line I used:

./configure --with-includes=/sw/include --with-libs=/sw/lib --with-openssl --with-python --with-perl

I tried adding the line you suggested.  This time, I got the following error when I tried to compile nspostgres:

dhcp232:/usr/local/src/aolserver/nspostgres-4.0beta1 chris$ make POSTGRES=/usr/local/pgsql INST=/usr/local/aolserver ACS=1
gcc -pipe -DBIND_EMULATION -I/usr/local/pgsql/include -DFOR_ACS_USE -Os -Wall -Wconversion -Wno-implicit-int -fno-common -DMAC_OSX_TCL -DHAVE_CFBUNDLE -DUSE_VFORK -DTCL_DEFAULT_ENCODING=\"utf-8\" -I/usr/local/aolserver/include -I/usr/local/aolserver/include -DNO_CONST  -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -DTCL_WIDE_INT_TYPE=long\ long -DWORDS_BIGENDIAN=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=1 -DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DNO_VALUES_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_PUTENV_THAT_COPIES=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1  -DHAVE_TIMEGM=1 -DHAVE_POLL=1 -DHAVE_DRAND48=1 -DHAVE_RANDOM=1 -DHAVE__NSGETENVIRON=1 -DUSE_DYLD=1 -DHAVE_CMMSG=1    -c -o nspostgres.o nspostgres.c
nspostgres.c: In function `Ns_PgTableList':
nspostgres.c:678: warning: passing arg 3 of `Tcl_DStringAppend' as signed due to prototype
nspostgres.c: In function `encode3':
nspostgres.c:748: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c:749: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c:750: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c:751: warning: passing arg 1 of `enc_one' with different width due to prototype
nspostgres.c: In function `decode3':
nspostgres.c:771: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c:772: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c:773: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c:774: warning: passing arg 1 of `get_one' with different width due to prototype
nspostgres.c: In function `stream_actually_write':
nspostgres.c:863: warning: passing arg 3 of `write' as unsigned due to prototype
nspostgres.c: In function `blob_send_to_stream':
nspostgres.c:979: warning: `fd' might be used uninitialized in this function
nspostgres.c:981: warning: `conn' might be used uninitialized in this function
nspostgres.c: In function `parse_bind_variables':
nspostgres.c:1210: warning: unused variable `first_bind'
nspostgres.c: In function `PgBindCmd':
nspostgres.c:1326: warning: unused variable `value_frag_len'
/bin/rm -f nspostgres.so
cc -bundle -L/usr/local/aolserver/lib -o nspostgres.so nspostgres.o -L/usr/local/pgsql/lib -lpq -lnsdb -lssl -lnsthread -lnsd -L/usr/local/aolserver/lib -ltcl8.4  -lpthread -framework CoreFoundation
ld: /usr/local/pgsql/lib/libpq.a(fe-secure.o) illegal reference to symbol: _BIO_free defined in indirectly referenced dynamic library /usr/lib/libcrypto.0.9.7.dylib
make: *** [nspostgres.so] Error 1

Collapse
12: Re: compiling nspostgres (response to 11)
Posted by russ m on
Chris,

Well the first thing to try woud be adding a "-lcrypto" to the MODLIBS line, but that error message almost looks like there's a problem in how libpq was built (it looks like it's complaining about not having a direct reference to the BIO_free symbol, which would have been set when libpq.a was built).

Do you actually need SSL inside your database? The quick and dirty solution is to rebuild PG without SSL, since that seems to be the source of these problems...

Another thing to try would be to rename all the libpq.so.whatever files under /usr/local/pgsql/lib to libpq.dylib.whatever and rebuild nspostgres - that might let nspostgres link to the shared rather than static version of libpq, which might fix the problem with indirect references. In which case the problem is with the postgres build scripts for using the wrong extension for shared libraries on OSX...