Bug 210 - Cannot configure 4.1-fixes on Ubuntu
: Cannot configure 4.1-fixes on Ubuntu
Status: NEW
Product: TORQUE
libtorque
: 4.0.*
: PC Linux
: P5 enhancement
Assigned To: David Beer
:
:
:
  Show dependency treegraph
 
Reported: 2012-07-31 00:41 MDT by Chris Samuel
Modified: 2012-12-07 19:02 MST (History)
2 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Chris Samuel 2012-07-31 00:41:27 MDT
When you try and configure 4.1-fixes on Ubuntu 12.04 it fails, saying:

checking for xmlGetProp in -l/usr/lib/x86_64-linux-gnu -lxml2... no
configure: error: TORQUE needs libxml2-devel in order to build

But the error in the logs is:

configure:14048: checking for xmlGetProp in -l/usr/lib/x86_64-linux-gnu -lxml2
configure:14073: gcc -o conftest -g -O2 -D_LARGEFILE64_SOURCE   conftest.c
-l/usr/lib/x86_64-linux-gnu -lxml2 
 -lcrypto -lssl   -lpthread -lrt >&5
/usr/bin/ld: cannot find -l/usr/lib/x86_64-linux-gnu

Not sure where that came from..

The libxml2-dev package is installed:

samuel@eris:/tmp/4.1-fixes$ apt-cache policy libxml2-dev
libxml2-dev:
  Installed: 2.7.8.dfsg-5.1ubuntu4.1
  Candidate: 2.7.8.dfsg-5.1ubuntu4.1
Comment 1 Michael Jennings 2012-07-31 14:20:18 MDT
Patch to fix this:

Index: configure.ac
===================================================================
--- configure.ac        (revision 6611)
+++ configure.ac        (working copy)
@@ -702,10 +702,10 @@
 dnl
 dnl we need libxml2
 dnl 
-xmlLib=`xml2-config --libs`
+xmlLib=`xml2-config --libs | sed 's/-L[^[:space:]]* //g;s/-l//'`

 dnl skip the first two chars because its -l<libname>
-AC_CHECK_LIB(${xmlLib:2}, xmlGetProp,
+AC_CHECK_LIB(${xmlLib}, xmlGetProp,
   [],
   [AC_MSG_ERROR([TORQUE needs libxml2-devel in order to build]) ])


The problem is that xml2-config --libs may output link paths in addition to the
library link directive.  The above fix eliminates all linker paths as well as
removing the "-l" from the library name.
Comment 2 Chris Samuel 2012-07-31 19:24:03 MDT
I applied the patch to a pristine copy of 4.1-fixes and reran autogen.sh but it
still fails.  I checked and the configure script doesn't quite match what your
patch says, so my guess is that some meta-characters are getting expanded
unintentionally during generation:

samuel@eris:/tmp/4.1-fixes$ grep xml2-config configure
xmlLib=`xml2-config --libs | sed 's/-L^[:space:]* //g;s/-l//'`

So we've lost the [ and ] around the ^[:space:].

Running that command by hand shows:

samuel@eris:/tmp/4.1-fixes$ xml2-config --libs | sed 's/-L^[:space:]*
//g;s/-l//'
-L/usr/lib/x86_64inux-gnu -lxml2

Escaping the lost [ and ] doesn't help, I go from:

+xmlLib=`xml2-config --libs | sed 's/-L\[^[:space:]\]* //g;s/-l//'`

to:

xmlLib=`xml2-config --libs | sed 's/-L\^[:space:]\* //g;s/-l//'`
Comment 3 Michael Jennings 2012-08-01 14:03:31 MDT
Oops, sorry.  Fixed patch:

Index: configure.ac
===================================================================
--- configure.ac        (revision 6611)
+++ configure.ac        (working copy)
@@ -702,10 +702,10 @@
 dnl
 dnl we need libxml2
 dnl 
-xmlLib=`xml2-config --libs`
+xmlLib=`xml2-config --libs | sed 's/-L@<:@^@<:@:space:@:>@@:>@* //g;s/-l//'`

 dnl skip the first two chars because its -l<libname>
-AC_CHECK_LIB(${xmlLib:2}, xmlGetProp,
+AC_CHECK_LIB(${xmlLib}, xmlGetProp,
   [],
   [AC_MSG_ERROR([TORQUE needs libxml2-devel in order to build]) ])



Darn autoSPLATisms.  >:I
Comment 4 Chris Samuel 2012-08-01 22:20:42 MDT
Thanks Michael, that works!

Oh well, at least it's not cmake or scons.. ;-)
Comment 5 Michael Jennings 2012-12-07 19:02:36 MST
Looks like bdaw applied my patch from comment #3 to trunk r7195 (or master
commit 3684842 if you prefer), but the same bug exists in 4.1-dev.  Might want
to apply it there too since that's where this was originally reported.