Forum OpenACS Q&A: Do NOT compile nsxml with -O !
I'm trying to install OpenACS 4.6 on Debian 3.0, using Oracle. Initially, I compiled all of AOLserver 3.3+ad13 with "-O2 -g". I'm using the latest nsxml from SourceForge (nsxml.c rev. 1.12 2002/07/23), and libxml2 ver. 2.4.19 (the GNOME XML library).
Debian keeps it's libxml2 headers and libraries in a different place, so I had to tweak the nsxml Makefile slightly:
#XML_HEADERS = /usr/local/include #XML_LIBS = /usr/local/lib # For Debian: XML_HEADERS = /usr/include/libxml2 XML_LIBS = /usr/lib
Everything goes smoothly through the "Done installing the OpenACS kernel data model" message on the web page. However, immediately after that, the install stops, with this error in the server log:
[09/Dec/2002:18:14:19][23784.4101][-conn0-] Error: Error sourcing /web/test-46-ora/packages/acs-bootstrap-installer/installer/install-data-model.tcl: invalid token "n2" while executing "GetHandle node $token node" (procedure "dom::node" line 5) invoked from within "dom::node cget $element -nodeName" (procedure "apm_required_attribute_value" line 4) invoked from within "apm_required_attribute_value $package key" (procedure "apm_read_package_info_file" line 50) invoked from within "apm_read_package_info_file $spec_file_path" (procedure "apm_package_install" line 4) invoked from within "apm_package_install -callback apm_ns_write_callback "[file join [acs_root_dir] packages acs-kernel acs-kernel.info]"" invoked from within "apm_version_enable -callback apm_ns_write_callback [apm_package_install -callback apm_ns_write_callback "[file join [acs_root_dir] packages acs-kernel..." (file "/web/test-46-ora/packages/acs-bootstrap-installer/installer/install-data-model.tcl" line 63) invoked from within "source $__file "
That DOM stuff is probably using nsxml, so my guess is I have some sort of problem with my nsxml. But I don't really know. Luckily, even though I didn't think it would matter I tried re-compiling nsxml with just plain "-g", no -O at all. And it worked!
I don't know why though. Anyone have ideas?
Also, would it be bad to compile nsxml with "-g" but the rest of AOLserver with "-O1 -g"? Is it bad to mix loadable modules compiled with different optimization settings? How do you folks compile your AOLservers? Does anyone use any optimization at all, or are you all just using plain "-g"?
I don't think I care about optimizing the AOLserver C code, but I would like to try compiling the Tcl interpreter with optimization, as that part I've managed to make crawl in the past. Any thoughts on this?
That's what I did in the compiler I wrote, but perhaps gcc is smarter.
They do say that your program will have unpredictable results when being debugged though. So if you're not planning to debug it, it should be safe to just not put any optimizations in.
I'm making an educated guess here, but it should also be okay to compile AOLserver with -Ox and ns_xml without.
Anyway, I do -g -O2 on everything and have not had any problems either. As for debugging things compiled -g -O2, usually it's pretty easy to do. Your life is easier when you have debugable executables and with gcc allowing optimization together with debug symbols there aren't too many reasons not to always have the symbols.
Error: SQL(): ora8.c:3682:ora_tcl_command: error in `OCIStmtPrepare ()': ORA-24373: invalid length specified for statement
Compile nsxml with just -g on this box, and everything still works fine.