Forum OpenACS Q&A: where is ns.h when building postgres.o?

At least, that is what my compiler wants to know.  Check this:

postgresql 7.0 (all packages! even devel!) installed via RPM
aolserver 3.0 (untarred at /home/nsadmin)

within the pgsql driver makefile:

PGLIB=/usr/lib
PGINC=/usr/include/pgsql
NSHOME=/home/nsadmin

Ends up telling me something like this:

postgres.c:32: ns.h: No such file or directory

(Also can't find nsdb.h and nstcl.h)

Thanks.

Collapse
Posted by Roberto Mello on
Did you have these lines uncommented (especially the COPTS one) ?
# RedHat Linux with RPM PostgreSQL
#CC=gcc
#PGLIB=/usr/lib
#PGINC=/usr/include/pgsql
#COPTS=-fpic -shared -I$(PGINC) -I$(NSHOME)/include -I-/usr/include
Yes, the RH w/ RPM pgsql section was uncommented.  I've noticed that the PGLIB & PGINC locations are repeated, so I commented out the top lines...also a stray CC=gcc and COPTS at the top of the different 'flavor' sections...commented those out.  No luck.  No luck with different variations of above, too.
Staring thoughtfully into my cream of wheat this morning I thought I should mention that haven't built aolserver 3.0 from the source.  I downloaded the linux2.2-i386 tarball and put it at /home/nsadmin ... neither have I run nsbootstrap, which isn't in the bin directory ...

I've just now tried building from the source and I am getting undefined reference errors sprouting from the thread directory.

Collapse
Posted by Nathan Reeves on
Okay,  just from memory here, if you've only grabbed the precompiled linux executable, wou won't have the required source files to make the postgres driver.

Head back to the AOLServer site and download the source distribution, expand this into your ~nsadmin dir and try making the postgres driver again.  (What I usually do at this point is make a copy of my existing ~nsadmin dir, prior to expanding the source dist., make the driver then replace the ~nsadmin dir with my copy.  Just keeps the directory to a minimum).

I think this has been mentioned before and was noted that it had been requested to the AOLServer team to try and inlude the source files in the binary distributions in the next release.

Hope this helps.

Cheers

Boom!  That did the trick.  I was noticing some of the files I needed where in the source dist...  Thanks for the technique!
Collapse
Posted by Roberto Mello on
I am including this note in the docs so others don't fall in the same trap.
Collapse
Posted by Andrew Spencer on
Another technique (if you already have AOLserver running production servers) is to copy just the include/ directory from the AOLserver source to the AOLserver home directory (nsadmin, aolserv, etc.)

Otherwise you could have problems if AOLserver wants to read or write any files (like logs) in it's home directory.  Of course, why would you have production servers running without OpenACS anyway, right? :)