Forum OpenACS Q&A: Problem with installing nsxml

Collapse
Posted by jay he on
Hi. All.

I installed OpenACS 3.2.5, PostGreSQL7.2 and Aolserver3.4.2 on
Redhat7.0. It works well. But when I tried to install libxml2 and
nsxml, I got some problems.

I downloaded libxml2 from xmlsoft.org and installed it.
[root@dev libxml]# gunzip -c libxml2-xxx.tar.gz | tar xvf -

[root@dev libxml]#cd libxml-xxxx

[root@dev nsxml]#./configure

[root@dev nsxml]#make

[root@dev nsxml]#make install

Everything went well. Then I run ./sbin/ldconfig.

Then I tried to install nsxml:

[root@dev nsxml]# make
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:27: libxml/parser.h: No such file or directory
ns_xml.c:41:30: libxml/xmlmemory.h: No such file or directory
make: *** [ns_xml.o] Error 1

Then I tried to locate libxml.

[root@dev nsxml]# locate libxml/xmlmemory.h libxml/parser.h'

I got nothing. But I can manually
find /usr/local/include/libxml2/libxml/xmlmemory.h
and /usr/local/include/libxml2/libxml/parser.h

I read some postings and tried two thing:

First, I put the following in the makefile:
LIBXMLHOME = /usr/include/libxml2/libxml

CFLAGS    += -I$(LIBXMLHOME)

But it didn't work and I still got the same error.

Then I downloaded rpm verion of libxml2 (both dev and normal
versions) and reinstall libxml2. And I still got the same error when
I tried to install nsxml.

I don't know what's wrong with my installation. Can anyone help?

Thanks,

Jianxiao He

Collapse
Posted by Torben Brosten on

Hello Jay He,

Here's info I found helpful for a 4.x install. (quoted from: http://xmlsoft.org/FAQ.html#Installati )

5. I can't install the libxml(2) RPM package due to failed dependancies

The most generic solution is to refetch the latest src.rpm , and rebuild it locally with

rpm --rebuild libxml(2)-xxx.src.rpm

if everything goes well it will generate two binary rpm (one providing the shared libs and xmllint, and the other one, the -devel package providing includes, static libraries and scripts needed to build applications with libxml(2)) that you can install locally.

Hope this helps. If not, you might try posting more information about your operating system etc.

Collapse
Posted by Jonathan Ellis on
you set LIBXMLHOME = /usr/include/libxml2/libxml

but you said above that you installed in /usr/local/, so try changing LIBXMLHOME to /usr/local/include/libxml2/libxml

Collapse
Posted by jay he on
Torben and Jonathan:

Thanks for help!

I set LIBXMLHOME = /usr/local/include/libxml2/libxml but didn't type "local" in my posting. Sorry for that.

I tried Torben's suggestion but got different errors.

I downloaded libxml2-2.4.19-1.src.rpm from ftp://xmlsoft.org.
            rpm --rebuild libxml2-2.4.19-1.src.rpm

It goes well.
Then go to /home/nsxml and
Change the makefile:
          LIBXMLHOME = /usr/include/libxml2/libxml
          CFLAGS += -I$(LIBXMLHOME)
Then
          make

Then I got the error:

gcc: can't specify -o with -c  or -S and multiple compliations.

I did a locate libxml/xmlmemory.h and got the following result:
/home/libxml/include/libxml/xmlmemory.h

/usr/include/include/libxml2/libxml/xmlmemory.h

/usr/include/libxml2/libxml/xmlmemory.h

/usr/local/include/libxml2/libxml/xmlmemory.h

Look like I got too many libxml2 installed and nsxml does not know which one to use. How can I uninstall those libxml2s that are not necessary or tell nsxml which one to use?

Thanks

Collapse
Posted by Torben Brosten on
Hello Jay He,

Well, just to rule out any confusion by the system, I would try erasing all current libxml2 installs that you have found by 'rm'ing the libxml2 and nsxml installed files, then re-install the src-rpm and nsxml. That may not be the elegant way to do it, but it worked for me and hopefully works for you, too.

Collapse
Posted by Yon Derek on
Make sure you use the latest v1.4 of nsxml (http://acs-misc.sourceforge.net/nsxml.html), not nsxml 1.0 that can be downloaded from arsdigita/aolserver site. nsxml 1.0 is not compatible with libxml2, if memory serves, and that might cause the compilation problem you're seeing.
Collapse
7: Thanks! (response to 1)
Posted by jay he on
Thanks. All.

I tried to delete the previous installation. By unfortunately I rm some rpm installation, which I should use rpm -e. That caused me one trouble: when I tried to install nsxml, I was told no libxml2 was installed. But when I tried to install libxml2 (rpm), I was told it was installed. Finally I decided to reinstall my OS (red hat 7.0) and reinstall aolserver/postgresql and libxml2.

After reinstallation, I can install nsxml and call it from my page. Silly, yeah, a little bit. But it solved the problem.

Thank you all for help!