Skip to main content.
home | support | download

Back to List Archive

Problem with make, ld & libxml2

From: Andrew Lord <andrewlord(at)not-real.internode.on.net>
Date: Tue Mar 04 2003 - 13:55:41 GMT
Hello Bill,

I am having some difficulties making swish-e-2.2.3 on a remote server.  
Despite the package doing './configure' and 'make' without any problems on my 
own computer (running Mandrake 9) 'make' fails when run on the remote server 
(a commercial distribution, based on RedHat).

I don't have access to the 'make' command on the server and so I must provide 
instructions to the server administrators for all things such as 
installations.  It's all a bit painful, so I want to identify the problem 
before contacting them yet another time to try the installation again.

History:

Initially on the RedHat server they did:

./configure --with-libxml2=/home/virtual/sitex/fst/var/www/html/libxml2  
--prefix=/home/virtual/sitex/fst/var/www/html/swish1
make
make install

The make failed so they tried again, this time without libxml2.  They did:

./configure --without-libxml2   
--prefix=/home/virtual/sitex/fst/var/www/html/swish1
make
make install

The report for the second attempt (without-libxml2) is shown below.  The make 
fails again but what's got me stumpped is that despite re-configuring 
--without-libxml2, 'make[1]' still seems to be trying to 'look for' libxml2. 

Then further on, we get "/usr/bin/ld: cannot find -lxml2".  So ld is still 
looking for libxml2 (? if my interpretation is correct ?) for some reason, 
despite the --without-libxml2 switch being specified.

Then after attempting (and failing) to make swish-e, and proceeding to the 
perl Makefile.PL, we get the line "It seems as if you built swish-e with 
libxml2".  So Makefile.PL also thinks it needs to look for libxml2.  This is 
despite no swish-e binary having been created at all.  Then further along the 
report we get another 'echo' of this with the following statement being 
printed:  "Swish was built with libxml2 support"

Funny thing is that Makefile.PL does find -lxml2, ("'-lxml2' found at 
/usr/lib/libxml2.so.2.4.10").  But then further down the installation 
printout, we again get "/usr/bin/ld: cannot find -lxml2".

End result; I'm confused.  It seems as if whatever I want to do (whether I 
want to compile --with or --without-libxml2), ld (on the remote server) needs 
to look to -lxml2.  Do you have any suggestions as to what I should be trying 
here to remove this dependence on libxml2? Or should I just be 'going with 
the flow' and doing 
"LD_RUN_PATH=/dir/to/libxml2_directory  make" to get swish to make ?


Cheers,

AndrewLord


PS.  You will also note an error "config.status: error: cannot find input 
file: doc/Makefile.in".  This is not critical and merely reflects that I 
removed the documentation prior to uploading to the server (to save on 
space).  I have tested the package on my own computer without this and it 
makes and tests fine.


######## Output of my bash script which does --without-libxml2   
--prefix=/home/virtual/sitex/fst/var/www/html/swish1, make, make install, 
Makefile.PL, make, make test, make install.


checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for BSDgettimeofday... no
checking for gettimeofday... yes
checking whether #! works in shell scripts... yes
checking whether make sets $(MAKE)... yes
checking for perl... /usr/bin/perl
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ANSI C... (cached) none needed
checking for ranlib... ranlib
checking for main in -lm... yes
checking for vsnprintf in -lsnprintf... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking for stdlib.h... (cached) yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for an ANSI C-conforming const... yes
checking for pid_t... yes
checking for size_t... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for working alloca.h... yes
checking for alloca... yes
checking for strftime... yes
checking for vprintf... yes
checking for _doprnt... no
checking for unistd.h... (cached) yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for re_comp... yes
checking for regcomp... yes
checking for strdup... yes
checking for strstr... yes
checking for lstat... yes
checking for log in -lm... yes
checking for vsnprintf... yes
Not building with libxml2 - use --with-libxml2 to enable
checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking for gzread in -lz... HTTP Server terminated
yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating doc/Makefile
config.status: error: cannot find input file: doc/Makefile.in
making swish-e
(cd src; make)
make[1]: Entering directory `/home/virtual/sitex/fst/var/www/html/swish1/src'
gcc -o swish-e -Wall -DHAVE_CONFIG_H -DSWISH_VERSION=\"2.2.3\" -Iexpat/xmltok 
-Iexpat/xmlparse -I/usr/include/libxml2  -g -O2  swish.o keychar_out.o                      
libswish-e.a -lm -lm  -lxml2 -lz -lm -lz
HTTP Server terminated
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make[1]: *** [swish-e] Error 1
make[1]: Leaving directory `/home/virtual/sitex/fst/var/www/html/swish1/src'
make: *** [swish-e] Error 2
(cd src; make test)
make[1]: Entering directory `/home/virtual/sitex/fst/var/www/html/swish1/src'
gcc -o swish-e -Wall -DHAVE_CONFIG_H -DSWISH_VERSION=\"2.2.3\" -Iexpat/xmltok 
-Iexpat/xmlparse -I/usr/include/libxml2  -g -O2  swish.o keychar_out.o                      
libswish-e.a -lm -lm  -lxml2 -lz -lm -lz
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make[1]: *** [swish-e] Error 1
make[1]: Leaving directory `/home/virtual/sitex/fst/var/www/html/swish1/src'
make: *** [test] Error 2
cp src/swish-e /home/virtual/sitex/fst/var/www/html/swish1/bin/swish-e
cp: cannot stat `src/swish-e': No such file or directory
make: *** [install] Error 1

Parsing ../src/acconfig.h...

==========================================================
Note about libxml2.

It seems as if you built swish-e with libxml2.

If libxml2 is not found automatically, then you may
need to mess with CCFLAGS and LDFROM flags.

For example:

   perl Makefile.PL \
   CCFLAGS=-I$HOME/local/include \
   LDFROM="-L$HOME/local/lib -R$HOME/local/lib"

libxml2 is not needed for the perl module -- it's only
used for indexing.  It will increase the size of the
perl module if included and/or require libxml2 to be
loaded even though it's not used.

This is not a problem and can be ignored, but:

You may wish to rebuild swish-e without libxml2
support, and then create the perl module.  Note that
rebuilding swish will overwrite the swish-e binary, so you
may want to copy or install the swish-e binary before
rebuilding without libxml2 support.

Hopefully this will better in the future.

==========================================================

press return: HTTP Server terminated

Swish was built with zlib support
Swish was built with libxml2 support
MakeMaker (v5.45)
	DIR => []
	INSTALLBIN => q[/home/virtual/sitex/fst/var/www/html/perlLibrary/bin]
	INSTALLMAN1DIR => 
q[/home/virtual/sitex/fst/var/www/html/perlLibrary/lib/perl5/man]
	INSTALLMAN3DIR => 
q[/home/virtual/sitex/fst/var/www/html/perlLibrary/lib/perl5/man3]
	INSTALLPRIVLIB => 
q[/home/virtual/sitex/fst/var/www/html/perlLibrary/lib/perl5]
	INSTALLSCRIPT => q[/home/virtual/sitex/fst/var/www/html/perlLibrary/bin]
	INSTALLSITELIB => 
q[/home/virtual/sitex/fst/var/www/html/perlLibrary/lib/perl5/site_perl]
	LIBS => [q[-L../src -lswish-e -lz -lxml2]]
	NAME => q[SWISHE]
	NORECURS => q[1]
	PREFIX => q[/home/virtual/sitex/fst/var/www/html/perlLibrary]
	PREREQ_PM => {  }
	VERSION_FROM => q[SWISHE.pm]
Defaulting INSTALLARCHLIB to 
/home/virtual/sitex/fst/var/www/html/perlLibrary/lib/perl5/i386-linux
Defaulting INSTALLSITEARCH to 
/home/virtual/sitex/fst/var/www/html/perlLibrary/lib/perl5/site_perl/i386-linux
Using PERL=/usr/bin/perl
Potential libraries are '-L../src -lswish-e -lz -lxml2':
Warning: -L../src changed to 
-L/home/virtual/sitex/fst/var/www/html/swish1/perl/../src
'-lswish-e' found at 
/home/virtual/sitex/fst/var/www/html/swish1/perl/../src/libswish-e.a
z not found in /home/virtual/sitex/fst/var/www/html/swish1/perl/../src
z not found in /usr/local/lib
z not found in /lib
'-lz' found at /usr/lib/libz.so.1.1.3
xml2 not found in /home/virtual/sitex/fst/var/www/html/swish1/perl/../src
xml2 not found in /usr/local/lib
xml2 not found in /lib
'-lxml2' found at /usr/lib/libxml2.so.2.4.10
Writing Makefile for SWISHE
gcc -c  -fno-strict-aliasing -I/usr/local/include -O2 -march=i386 -mcpu=i686     
-DVERSION=\"0.02\" -DXS_VERSION=\"0.02\" -fPIC 
-I/usr/lib/perl5/5.6.0/i386-linux/CORE  SWISHE.c
Running Mkbootstrap for SWISHE ()
chmod 644 SWISHE.bs
LD_RUN_PATH="/home/virtual/sitex/fst/var/www/html/swish1/perl/../src:/usr/lib" 
gcc -o blib/arch/auto/SWISHE/SWISHE.so  -shared -L/usr/local/lib SWISHE.o    
-L/home/virtual/sitex/fst/var/www/html/swish1/perl/../src -lswish-e -lz 
-lxml2
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/SWISHE/SWISHE.so] Error 1
LD_RUN_PATH="/home/virtual/sitex/fst/var/www/html/swish1/perl/../src:/usr/lib" 
gcc -o blib/arch/auto/SWISHE/SWISHE.so  -shared -L/usr/local/lib SWISHE.o    
-L/home/virtual/sitex/fst/var/www/html/swish1/perl/../src -lswish-e -lz 
-lxml2 
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/SWISHE/SWISHE.so] Error 1
LD_RUN_PATH="/home/virtual/sitex/fst/var/www/html/swish1/perl/../src:/usr/lib" 
gcc -o blib/arch/auto/SWISHE/SWISHE.so  -shared -L/usr/local/lib SWISHE.o    
-L/home/virtual/sitex/fst/var/www/html/swish1/perl/../src -lswish-e -lz 
-lxml2 
/usr/bin/ld: cannot find -lxml2
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/SWISHE/SWISHE.so] Error 1
Received on Tue Mar 4 13:56:12 2003