Forum OpenACS Development: nsxml compile error with Red Hat 7.2

Collapse
Posted by Ola Hansson on
I get an error when I try to compile nsxml on Red Hat 7.2 with the latest libxml2 RPMs, libxml2-2.4.6-1 and libxml2-devel-2.4.6-1:
[root@hal 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
[root@hal nsxml]# locate libxml/xmlmemory.h libxml/parser.h
/usr/include/libxml2/libxml/xmlmemory.h
/usr/include/libxml2/libxml/parser.h
I have left the Makefile alone (i.e. MODLIBS = -lxml2 and no XSLT support).

Thanks,
Collapse
Posted by Gaizka Villate on

I found a similar problem, and i fixed it adding a couple of lines at the end of the Makefile file.

LIBXMLHOME = /usr/include/libxml2/libxml

CFLAGS    += -I$(LIBXMLHOME)

I hope that helps!

Collapse
Posted by Ola Hansson on
Thank you Gaizka! That worked with this slight modification: LIBXMLHOME = /usr/include/libxml2

Cheers,
Collapse
Posted by Hans Gaasenbeek on
Should there be a + after CFLAGS or is it a typo?

CFLAGS += ......

or

CFLAGS =

BTW thanks... it took me ages to find this solution.

Collapse
Posted by Jon Griffin on
There should be a +. The reason being that any system global CFLAGS vars will be added.

Case in point, RH loves to build in 386 compatibility mode. I haven't used a 386 in 5 years or more. I change my .rpmlib and also add a CFLAGS line in /etc/profile to make cpu=i686 and etc.

Without the += you will not pick up the environments CFLAGS and therefor get a build that is probably not optimized.

Regarding your problem, this shouldn't make any difference unless the software depends on some screwy compiler setting.

See http://jongriffin.com/static/linuxnotes for some settings you might want to try.