Forum OpenACS Q&A: nspostgres on solaris

Collapse
Posted by Trenton Cameron on
I am having issues compiling nspostgres for aolserver.  When I compile the driver is compiles but throws errors.  The resulting module loads but when go to use it with openACS I get the error:
Your Postgres driver is either too old or was not compiled with |ACS=1|. Please update to a version 2.3 or higher and compile it with |ACS=1|.

I downloaded nspostgres from the openacs CVS repository so I know that it is a beyond 2.3  I am running postgesql version 7.4.6 that was compiled from source.  This is on Solaris 9 running on a sparc machine. I am running (or trying to run) Aolserver4.0.8 (also compiled from source). When I run ldd on the nspostgres.so everything resolves.

I have my LD_LIBRARY_PATH set to include /usr/local/pgsql/lib (the location of postgres)

I compiled nspostgres with the command
make install POSTGRES=/usr/local/pgsql ACS=1INST=/webroot/aol408
where /webroot/aol408 is the location of my aolserver install
the output of the above command was :
gcc -pipe -DBIND_EMULATION -I/usr/local/pgsql/include -DFOR_ACS_USE -O -Wall -Wconversion -Wno-implicit-int -fPIC  -I/webroot/aol408/include -I/usr/local/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 -DHAVE_STRUCT_DIRENT64=1
-DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -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
-DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1
-DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1
-DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TIMEZONE_VAR=1
-DHAVE_ST_BLKSIZE=1 -Dstrtod=fixstrtod -DSTDC_HEADERS=1
-DNO_UNION_WAIT=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1
-DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DHAVE_FORK1=1 -DHAVE_POLL=1 -DHAVE_DRAND48=1 -DHAVE_RANDOM=1 -DUSE_DUPHIGH=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYNAME_R_5=1 -DHAVE_GETHOSTBYADDR_R=1 -DHAVE_GETHOSTBYADDR_R_7=1    -c -o
nspostgres.o nspostgres.c
nspostgres.c: In function `Ns_PgExec':
nspostgres.c:296: warning: subscript has type `char'
nspostgres.c: In function `Ns_PgTableList':
nspostgres.c:679: warning: passing arg 3 of `Tcl_DStringAppend' as
signed due to prototype
nspostgres.c: In function `encode3':
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:752: warning: passing arg 1 of `enc_one' with different
width due to prototype
nspostgres.c: In function `decode3':
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:775: warning: passing arg 1 of `get_one' with different
width due to prototype
nspostgres.c: In function `stream_actually_write':
nspostgres.c:864: warning: passing arg 3 of `write' as unsigned due to
prototype
nspostgres.c: In function `blob_send_to_stream':
nspostgres.c:980: warning: 'fd' might be used uninitialized in this function
nspostgres.c:982: warning: 'conn' might be used uninitialized in this
function
nspostgres.c: In function `parse_bind_variables':
nspostgres.c:1211: warning: unused variable `first_bind'
nspostgres.c: In function `PgBindCmd':
nspostgres.c:1327: warning: unused variable `value_frag_len'
/bin/rm -f nspostgres.so
gcc -pipe -shared -nostartfiles -L/webroot/aol408/lib -o nspostgres.so
nspostgres.o -L/usr/local/pgsql/lib -lpq -lnsdb -lnsthread -lnsd
-L/usr/local/lib -ltcl8.4 -ldl  -lsocket -lnsl -lpthread -lm -lrt
-Wl,-R,/webroot/aol408/lib -Wl,-R,/usr/local/lib -Wl,-R,/usr/lib/lwp
/webroot/aol408/bin/install-sh -c nspostgres.so /webroot/aol408/bin/

Any help in fixing this problem would be greatly appreciated.
-Trent

Collapse
2: Re: nspostgres on solaris (response to 1)
Posted by Jade Rubick on
I think you need a space after ACS=1

It definitely seems to be the case that that portion is not being executed, so if that isn't the problem, then you may need to edit the Makefile, or look at what it's doing there.

Collapse
3: Re: nspostgres on solaris (response to 2)
Posted by Trenton Cameron on
Sorry the missing space was just a cut and paste errer it really was there when I ran the command as you can see from the -DFOR_ACS_USE flag durring compile.  Please let me know if you have any other ideas
Collapse
4: Re: nspostgres on solaris (response to 1)
Posted by xx xx on
Sorry, this should be in the docs. I have banged my head against this before. As far as I know you can just ignore the errors: https://openacs.org/forums/message-view?message_id=176263
Collapse
5: Re: nspostgres on solaris (response to 1)
Posted by Jade Rubick on
Can one of you make a patch for the docs. How to is in the FAQ: https://openacs.org/faq
Collapse
6: Re: nspostgres on solaris (response to 4)
Posted by Trenton Cameron on
But when I ignore the errors I still get the error when I start openacs.:

Your Postgres driver is either too old or was not compiled with |ACS=1|. Please update to a version 2.3 or higher and compile it with |ACS=1|

So I don't think I can ignore the warnings.  Any other ideas?