Forum OpenACS Development: Problem compiling nspostgres module in aolserver4.5.1

Hello,

I am trying to install openacs in open suse 13. I installed all, but nspostgres module. I download the source of the module using the command:

#cvs -z3 -d:pserver:mailto:anonymous@aolserver.cvs.sourceforge.net:/cvsroot/aolserver co nspostgres

The source of the aolserver I use is the one that can be downloaded as a tar.gz file; it is a 4.5.1 version. I use postres 9.0.0 version.

Then I try to install it using:

#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib

# make install POSTGRES=LSB ACS=1 INST=/usr/local/aolserver AOLSERVER=/usr/local/aolserver40r10

and it does not compile.

First it does not finds the libpq-fe.h and postgres_ext.h

which are located at:
/usr/local/pgsql/include/

so then I use:

#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/loca/pgsql/lib:/usr/loca/pgsql/include

# make install POSTGRES=LSB ACS=1 INST=/usr/local/aolserver AOLSERVER=/usr/local/aolserver

and now I get the next logs:

gcc -shared -DBIND_EMULATION -I/usr/local/pgsql/include -DFOR_ACS_USE -g -Wall -fPIC -pipe -I/usr/local/aolserver/include -I/usr/local/aolserver/include -DNO_CONST -DPACKAGE_NAME=\"tcl\" -DPACKAGE_TARNAME=\"tcl\" -DPACKAGE_VERSION=\"8.5\" -DPACKAGE_STRING=\"tcl\ 8.5\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_PTHREAD_GETATTR_NP=1 -DGETATTRNP_NOT_DECLARED=1 -DTCL_THREADS=1 -DTCL_CFGVAL_ENCODING=\"iso8859-1\" -DMODULE_SCOPE=extern\ __attribute__\(\(__visibility__\(\"hidden\"\)\)\) -DTCL_SHLIB_EXT=\".so\" -DTCL_CFG_OPTIMIZED=1 -DTCL_CFG_DEBUG=1 -DTCL_TOMMATH=1 -DMP_PREC=4 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_IS_LONG=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRTOL=1 -DHAVE_WAITPID=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETPWUID_R_5=1 -DHAVE_GETPWUID_R=1 -DHAVE_GETPWNAM_R_5=1 -DHAVE_GETPWNAM_R=1 -DHAVE_GETGRGID_R_5=1 -DHAVE_GETGRGID_R=1 -DHAVE_GETGRNAM_R_5=1 -DHAVE_GETGRNAM_R=1 -DHAVE_GETHOSTBYNAME_R_6=1 -DHAVE_GETHOSTBYNAME_R=1 -DHAVE_GETHOSTBYADDR_R_8=1 -DHAVE_GETHOSTBYADDR_R=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1 -DTIME_WITH_SYS_TIME=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_MKTIME=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_STRUCT_STAT_ST_BLOCKS=1 -DHAVE_STRUCT_STAT_ST_BLKSIZE=1 -DHAVE_BLKCNT_T=1 -DHAVE_INTPTR_T=1 -DHAVE_UINTPTR_T=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DHAVE_SYS_IOCTL_H=1 -DTCL_UNLOAD_DLLS=1 -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DTCL_CFG_DEBUG=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_TIMEGM=1 -DHAVE_DRAND48=1 -DHAVE_RANDOM=1 -DHAVE_POLL=1 -DHAVE_GETADDRINFO=1 -DHAVE_GETNAMEINFO=1 -nostartfiles -o nspostgres.so nspostgres.o -L/usr/lib -lpq -L. -lnspostgres -L/usr/local/aolserver/lib -lnsd -lnsthread -L/usr/local/aolserver/lib -ltcl8.5 -ldl -lpthread -lieee -lm -lgcc_s -Wl,-rpath,/usr/local/aolserver/lib
/usr/lib64/gcc/x86_64-suse-linux/4.5/../../../../x86_64-suse-linux/bin/ld: cannot find -lpq
collect2: ld returned 1 exit status
make: *** [nspostgres.so] Error 1

it says that cannot find -lpq

Anybody can help me?

Thanks in advance

Can it be, that the line
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/loca/pgsql/lib:/usr/loca/pgsql/include
should read
#export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib:/usr/local/pgsql/include
?
Collapse
Posted by rosae rosae on
Oops,

I misstyped the line I wrote when I posted in the forum. I solved the problem downloading the source not using the cvs command in the docs, but using the source from the page
http://sourceforge.net/projects/aolserver/files/nspostgres/

and compiling the 4.1 version of the module.

But now I have another problem even BIGGER than first because I get an ERROR that says:

Error: Bootstrap: RDBMS type could not be determined for any pool.

and I have well configured the database in the config file that uses the aolserver to start.

Any idea of what is happening?

Thanks in advance.

You need to copy:

./packages/acs-core-docs/www/files/nsd-postgres.txt

into where ever your aolserver was installed, in my case is /usr/local/aolserver so I do this:

cp ./packages/acs-core-docs/www/files/nsd-postgres.txt /usr/local/aolserver/bin/nsd-postgres

then open the file and make sure the PATH and LD_LIBRARY_PATH variables are correct.

chmod a+x /usr/local/aolserver/bin/nsd-postgres

Now start aolserver this way:

/usr/local/aolserver/bin/nsd-postgres -t /path/to/your/config.tcl

Collapse
Posted by Jim Lynch on
Note that you can also have the nspostgres makefile use the pg_config binary which supplies info about where everything is in your postgres install.

make install POSTGRES=PG_CONFIG PG_CONFIG=/path/to/pg_config ACS=1 INST=/usr/local/aolserver AOLSERVER=/usr/local/aolserver40r10

and btw INST and AOLSERVER should probably point to the same thing, the prefix where aolserver is installed.

-Jim

Collapse
Posted by Jim Lynch on
PS, nspostgres-4.1 is the first to have POSTGRES=PG_CONFIG and the first one I worked on, to add this and other features to the build system, and improve error message reporting.
Collapse
Posted by rosae rosae on
Hello,

I had ./packages/acs-core-docs/www/files/nsd-postgres.txt copied and installed when I wrote the previous post. The postgres module problem was solved starting the server using the nsd-postgres command instead of run. But still remain the tdom and the tcclib libraries problems. They are both installed on my operating system, but aolserver is not able to find them. I think both problems can be solved installing them from source. Where can I download the tdom package? The page that appears on the documentation does not exists (that site has not that package). Can I install the tcllib pacakge from the openacs distribution?

I think that now these are the problems I have to start the server. In the following lines I show the error logs that appears:

[20/Oct/2010:12:16:09][7095.1601132288][-main-] Error: 0-acs-init.tcl: error loading tdom: can't find package tdom

[20/Oct/2010:12:16:10][7095.1601132288][-main-] Error: Error sourcing /var/lib/aolserver/service0/packages/acs-tcl/tcl/html-email-procs.tcl:
can't find package mime
while executing
"package require mime"
(file "/var/lib/aolserver/service0/packages/acs-tcl/tcl/html-email-procs.tcl" line 12)
invoked from within
"source $__file "

[20/Oct/2010:12:16:10][7095.1601132288][-main-] Error: Error parsing queryfile /var/lib/aolserver/service0/packages/acs-tcl/lib/page-error.xql:

invalid command name "dom"

invalid command name "dom"
while executing
"dom parse -simple [lindex $args 1]"
(procedure "xml_parse" line 4)
invoked from within
"xml_parse -persist $stuff_to_parse"
(procedure "db_qd_internal_parse_init" line 4)
invoked from within
"db_qd_internal_parse_init $whole_file $file_tag"
(procedure "db_qd_internal_load_queries" line 15)
invoked from within
"db_qd_internal_load_queries $stream $file_path"
(procedure "db_qd_internal_load_cache" line 9)
invoked from within
"db_qd_internal_load_cache $file_path"
[20/Oct/2010:12:16:10][7095.1601132288][-main-] Error: Error parsing queryfile /var/lib/aolserver/service0/packages/acs-tcl/tcl/00-database-procs-postgresql-postgresql.xql:

Anybody can help me?

Thanks in advance.

Collapse
Posted by rosae rosae on
Hello,

I installed tcllib package from source and the error

can't find package mime
while executing
"package require mime"
(file "/var/lib/aolserver/service0/packages/acs-tcl/tcl/html-email-procs.tcl" line 12)
invoked from within
"source $__file "

has disappeared. The only module I need to install is the tdom package. Where can I download it? Do somebody can send me it by email if there is not available on the web?

Thanks in advance.