Forum OpenACS Q&A: OACS4.x install, make for nsxml fails
Any suggestions would be greatly appreciated. This is on an SuSE system (which seems similar to RedHat for installation purposes)
Here's what happened in context with the documenation:
In order for nsxml to compile, you need libxml2 (available from http:// xmlsoft.org). On Debian, this can be installed by doing apt-get install libxml2-dev. You will probably need to adjust the Makefile. Edit it so that the last few lines look like: (I believe this should work for RedHat as well - Please let me know if it doesn't)
#MODLIBS = -lxml2 MODLIBS = $(shell xml2-config --libs) CFLAGS = $(shell xml2-config --cflags) include $(NSHOME)/include/Makefile.moduleThen, compile and install:
nsadmin:/usr/local/src/root/nssha1$ cd ../nsxml nsadmin:/usr/local/src/root/nsxml$ emacs Makefile nsadmin:/usr/local/src/root/nsxml$ tar xzf /tmp/libxml2-2.4.9.tar.gz nsadmin:/usr/local/src/root/nsxml$ mv libxml2-2.4.9 libxml nsadmin:/usr/local/src/root/nsxml$ make make: xml2-config: Command not found @s@@s@gcc -I../aolserver/include -D_REENTRANT=1 -DNDEBUG=1 -g -fPIC - Wall -Wno-unused -mcpu=i686 -DHAVE_CMMSG=1 -DUSE_FIONREAD=1 - DHAVE_COND_EINTR=1 -c -o ns_xml.o ns_xml.c ns_xml.c:40: libxml/parser.h: No such file or directory ns_xml.c:41: libxml/xmlmemory.h: No such file or directory make: *** [ns_xml.o] Error 1 nsadmin:/usr/local/src/root/nsxml$ cd libxml nsadmin:/usr/local/src/root/nsxml/libxml$ ls AUTHORS config.sub missing triodef.h COPYING configure mkinstalldirs trionan.c COPYING.LIB configure.in nanoftp.c trionan.h ChangeLog debugXML.c nanohttp.c triop.h DOCBparser.c doc parser.c uri.c HTMLparser.c encoding.c parserInternals.c valid.c HTMLtree.c entities.c result vms INSTALL error.c stamp-h.in win32 Makefile.am example strio.c xinclude.c Makefile.in globals.c strio.h xlink.c NEWS hash.c test xml2-config.1 README include testDocbook.c xml2-config.in SAX.c install-sh testHTML.c xml2Conf.sh.in SAXresult libxml-2.0.pc.in testSAX.c xmlIO.c TODO libxml.4 testThreads.c xmlcatalog.c acconfig.h libxml.h testURI.c xmllint.c acinclude.m4 libxml.m4 testXPath.c xmlmemory.c aclocal.m4 libxml.spec threads.c xpath.c catalog.c libxml.spec.in tree.c xpointer.c config.guess list.c trio.c config.h.in ltmain.sh trio.h nsadmin:/usr/local/src/root/nsxml/libxml$
In that case, you can try doing
./configure
before the make command. This should generate the xml2-config script which make is complaining about.
Alternately, if SuSe is close enough to Red Hat, try my Red Hat RPMs for OpenACS4, and so just avoid all this config/compile stuff completely 😊 😊
Jonathan, Thank you for the suggestions.
http://xmlsoft.org/FAQ.html confirms your "./configure" suggestion. Unfortunately http://www.fifthgate.org/articles/aolserver/xml/ns_xml_doc.html from the nsxml README doesn't mention details of the libxml2 install process.
I would use your RPMs, but my current objective is installing via the source route for the benefit of OACS 4.x docs and my own learning experience. It's been almost 20 years since I've played with C (wow time has flown!), so I really appreciate the obvious and not so obvious. =)
Here's an update of what I have done, and the current error condition:
nsadmin:/usr/local/src/root/nsxml$ tar xzf /tmp/libxml2-2.4.9.tar.gz nsadmin:/usr/local/src/root/nsxml$ mv libxml2-2.4.9 libxml2 nsadmin:/usr/local/src/root/nsxml$ cd libxml2 nsadmin:/usr/local/src/root/nsxml/libxml2$ ./configure nsadmin:/usr/local/src/root/nsxml/libxml2$ emacs Makefile # per OACS forums put the following at the end of Makefile: LIBXMLHOME = /usr/include/libxml2 # previously tried LIBXMLHOME = /usr/include/libxml2/libxml CFLAGS += -I$(LIBXMLHOME) nsadmin:/usr/local/src/root/nsxml/libxml2$ make nsadmin:/usr/local/src/root/nsxml/libxml2$ make install Making install in include make[1]: Entering directory `/usr/local/src/root/nsxml/libxml2/include' Making install in libxml make[2]: Entering directory `/usr/local/src/root/nsxml/libxml2/include/libxml' make[3]: Entering directory `/usr/local/src/root/nsxml/libxml2/include/libxml' make install-exec-hook make[4]: Entering directory `/usr/local/src/root/nsxml/libxml2/include/libxml' /bin/sh ../../mkinstalldirs /usr/local/include/libxml2/libxml mkdir /usr/local/include/libxml2 mkdir: cannot make directory `/usr/local/include/libxml2': Permissiondenied mkdir /usr/local/include/libxml2/libxml mkdir: cannot make directory `/usr/local/include/libxml2/libxml': No such file or directory make[4]: *** [install-exec-hook] Error 1 make[4]: Leaving directory `/usr/local/src/root/nsxml/libxml2/include/libxml' make[3]: *** [install-exec-am] Error 2 make[3]: Leaving directory `/usr/local/src/root/nsxml/libxml2/include/libxml' make[2]: *** [install-am] Error 2 make[2]: Leaving directory `/usr/local/src/root/nsxml/libxml2/include/libxml' make[1]: *** [install-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/root/nsxml/libxml2/include' make: *** [install-recursive] Error 1
Should I make some adjustments to libxml2's Makefile? Change permissions for /usr/local? /usr/local/libxml2 or?
Here are the variable initialization lines of libxml2's Makefile: SHELL = /bin/sh srcdir = . top_srcdir = . prefix = /usr/local exec_prefix = ${prefix} bindir = ${exec_prefix}/bin sbindir = ${exec_prefix}/sbin libexecdir = ${exec_prefix}/libexec datadir = ${prefix}/share sysconfdir = ${prefix}/etc sharedstatedir = ${prefix}/com localstatedir = ${prefix}/var libdir = ${exec_prefix}/lib infodir = ${prefix}/info mandir = ${prefix}/man includedir = ${prefix}/include oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/libxml2 pkglibdir = $(libdir)/libxml2 pkgincludedir = $(includedir)/libxml2 top_builddir = . ACLOCAL = aclocal AUTOCONF = autoconf AUTOMAKE = automake AUTOHEADER = autoheader INSTALL = /usr/bin/ginstall -c INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = ${INSTALL} -m 644 INSTALL_SCRIPT = ${INSTALL_PROGRAM} transform = s,x,x, NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : host_alias = i686-pc-linux-gnu host_triplet = i686-pc-linux-gnu AS = @AS@ CATALOG_OBJ = catalog.o CC = gcc CFLAGS = -g -O2 -Wall CPP = gcc -E DEBUG_OBJ = debugXML.o DLLTOOL = @DLLTOOL@ DOCB_OBJ = DOCBparser.o ECHO = echo EXEEXT = FTP_OBJ = nanoftp.o HAVE_ISINF = HAVE_ISNAN = HTML_DIR = $(prefix)/doc HTML_OBJ = HTMLparser.o HTMLtree.o HTTP_OBJ = nanohttp.o ICONV_LIBS = -L/lib LIBTOOL = $(SHELL) $(top_builddir)/libtool LIBXML_MAJOR_VERSION = 2 LIBXML_MICRO_VERSION = 9 LIBXML_MINOR_VERSION = 4 LIBXML_VERSION = 2.4.9 LIBXML_VERSION_INFO = 6:9:4 LIBXML_VERSION_NUMBER = 20409 LN_S = ln -s MAINT = # MAKEINFO = makeinfo MV = /bin/mv M_LIBS = OBJDUMP = @OBJDUMP@ OBJEXT = o PACKAGE = libxml2 RANLIB = ranlib RDL_LIBS = RM = /bin/rm STRIP = strip TAR = /bin/tar TEST_THREADS = THREAD_CFLAGS = THREAD_LIBS = U = VERSION = 2.4.9 WITH_CATALOG = 1 WITH_DEBUG = 1 WITH_DOCB = 1 WITH_FTP = 1 WITH_HTML = 1 WITH_HTTP = 1 WITH_ICONV = 1 WITH_MEM_DEBUG = 0 WITH_THREADS = 0 WITH_TRIO = 0 WITH_XINCLUDE = 1 WITH_XPATH = 1 WITH_XPTR = 1 XINCLUDE_OBJ = xinclude.o XML_CFLAGS = XML_INCLUDEDIR = -I${includedir}/libxml2/libxml -I${includedir}/libxml 2 -I/include XML_LIBDIR = -L${libdir} XML_LIBS = -lxml2 -lz -L/lib -lm XPATH_OBJ = xpath.o XPTR_OBJ = xpointer.o Z_CFLAGS = Z_LIBS = -lz
It looks like my instructions were a bit confusing. You need the libxml2
and libxml2-dev
packages installed on your system before you can compile nsxml
. The Makefile that needs to be edited is the nsxml
one, not the libxml2
one.
So, I would recommend installing the libxml2
& libxml2-devel
RPMs from xmlsoft.org (if they work on SUSe. If they don't work, then you'll need to install them from source, but you shouldn't need to edit the Makefile).
Once these libraries and header files are installed in your distro-specific areas (like /usr/lib
), then you'll need to go back to nsxml
and edit the Makefile.
If you are creating OpenACS4 install info for SuSe users, using RPMs is probably the best way forward long term, since SuSe is an RPM-based distribution. So minimizing install pain for 'real' OpenACS4/SuSe users would mean using an installation approach they are likely to be familiar with already -- RPMs.
This is doubly so if you don't have a lot of experience with autoconf and make, which is my suspicion (from the posts you have made). There are only so many hours in a day -- why not use them on OpenACS stuff, instead of on arcana relating to autoconf and make and compiling etc.
I'm not really sure about the benefit or wisdom of untarring libxml2 underneath nsxml. These are two very different things. You need libxml2 installed in order to compile nsxml, but you don't need to unpack it in the nsxml source directory (well, at least, I don't, on Red Hat 7.1). libxml2 is not a part of nsxml, so why unpack it there?
There is a new issue with libxml2-devel which might be what you are running into. The RPMs from xmlsoft now put the header files under
/usr/include/libxml2/libxml instead of
/usr/include/libxml
I suspect this is a mistake, though I have not contacted xmlsoft to verify that. The fix for our purposes is pretty trivial: hack the nsxml Makefile to add -I/usr/include/libxml2 to CFLAGS.
For sure, installing libxml2 and libxml2-devel RPMs as Vinod suggests
is likely to help you a lot (or installing libxml2 from tarball sources if you insist and want another challenge). BTW, if you had tried installing my aolserver-nsxml RPM it would have let you know it needed libxml2 -- in other words, RPM dependency checking could have helped you towards your goal.
If (as Vinod and I both suggest) you will agree to use RPMs for libxml2 and libxslt, my question is, why not be consistent, and use RPMs for the other necessary components (including AolServer and its nsxml module) too? And then... well, why not stay consistent, and use an RPM for OpenACS4 itself too 😊 😊
Ultimately a consistent and simple installation method is what will
probably help 'real' SuSe users to get started with OpenACS4. Compiling and installing everything from tarballed sources is quite possibly fun for some people, and might be useful as a learning experience for you personally, but it may well not be the easist approach to OpenACS4 installation for SuSe users in the long term.
Downloading 10 or so RPMs and typing
rpm -Uvh *rpm
seems a lot easier than what you are currently going through ... doesn't it? And that is what I do to install
PG/AolServer/OpenACS4. OpenACS4 up and running in under 3 minutes
(plus download time of course).
I confess I am currently slightly confused by the multiple people apparently doing (or wanting to do?) installation documentation related to OpenACS4, so for now I am just building RPMs once in a while, and waiting for a beta announcement; once we have 'official' install docs included in a release and in CVS, I can look at submitting patches to them for RPM users, as I did for OpenACS 3.2.5. Or, I'd welcome someone who is a real doc writer looking at how best to deal with the documentation needs of RPM as well as tarball based installs!
My current Aolserver 3.3.1-1+ad13 RPM set can fail to install OpenACS4 on Red Hat 7.1 under some circumstances... a new set 3.3.1-2+ad13 should be appearing very soon to fix that... it works here so far! Whether it works on SuSe or any other Linux distribution I can't say... I'd love to hear what happens when people try this, whether it works for them, or not!
From an operations perspective, there is a certain risk involved in depending on others to issue RPMs in a timely manner. Also, I am an OACS developer in training, so I need to understand how to put together a system beyond the theory. That is one of the purposes of installing via source.
Installing xmllib2 requires more of an implicit understanding of linux OS operations (in context with OACS) than I expected from the docs.. the implications of xmllib2 placement etc. and so it seems beneficial to work it out up front for anyone who cannot use RPMS --the worst case scenario. Do it once up front and everyone else benefits later --long term thinking while learning.
I will install using your RPMS on some subsequent machines (which I have yet to get to). For a standard alternate install. Are your RPMs using source or binary?
I will be installing OACS4.x on some PPC machines running SuSE also. Installing from source, one can be relatively machine independent, which for me has advantages since no two machines I operate are alike.