Monday, December 31, 2007

ClassAds and gLite UI 3.1(3.0)

There is a long-living problem in gLiteUI 3.x. I decided to post this topic here since I have received many requests of help in this issue (I received them most probably because I was the first who posted the according bug #22696 in CERN Savannah).
The problem is that one needs to compile ClassAds with namespace support enabled, because gLite UI distributive contains ClassAds which compiled without support of namespaces, though some of gLite API libraries (WMSUI for example) require ClassaAds with namespace support. And if one tries to compile its application, which uses gLite WMS API it will end up with the something like:


libglite_wms_util.so.0: undefined reference to `classad::ClassAdParser::ParseClassAd(std::basic_istream >&, bool)'
libglite_wms_jdl.so.0: undefined reference to `classad::ExprList::insert(__gnu_cxx::__normal_iterator > >, classad::ExprTree)'
libglite_wms_jdl.so.0: undefined reference to `classad::ExprList::ExprList[in-charge](std::vector > const&)' libglite_wms_jdl.so.0: undefined reference to `classad::ClassAd::SameAs(classad::ExprTree const) const' libglite_wms_jdl.so.0: undefined reference to `classad::ExprList::erase(__gnu_cxx::__normal_iterator > >, __gnu_cxx::__normal_iterator > >)'
libglite_wms_jdl.so.0: undefined reference to `classad::ExprList::erase(__gnu_cxx::__normal_iterator > >)'
libglite_wms_jdl.so.0: undefined reference to `classad::ExprList::push_back(classad::ExprTree)'
libglite_wms_jdl.so.0: undefined reference to `classad::ClassAd::EvaluateExpr(classad::ExprTree const, classad::Value&) const'
libglite_wms_jdl.so.0: undefined reference to `classad::ClassAd::find(std::basic_string, std::allocator &

Well, I didn't so far find a better way, but just compile own version of ClassAds library.

Download classads-0.9.6 from here.
tar -xzvf classads_0.9.6.tar.gz
cd classads_0.9.6
./configure --enable-namespace
make
make install
BTW, the following patch helps to compile CLASSADS with gcc-4.x (for classads-0.9.8) or you can use classads-0.9.9, where the problem is FIXED already.

--- ../classads-0.9.8.orig/classad_stl.h 2006-06-14 21:39:30.000000000 +0200
+++ classad_stl.h 2006-11-09 10:59:25.000000000 +0100
@@ -48,7 +48,7 @@
#define classad_hash_map std::hash_map
#define classad_slist std::slist
#elif defined(__GNUC__)
- #if (__GNUC__ == 3 && __GNUC_MINOR__ > 0)
+ #if ((__GNUC__ == 3 && __GNUC_MINOR__ > 0) || (__GNUC__ > 3))
#define classad_hash_map __gnu_cxx::hash_map
#define classad_slist __gnu_cxx::slist
#else
--- ../classads-0.9.8.orig/Makefile 2006-06-14 21:39:30.000000000 +0200
+++ Makefile 2006-11-10 08:19:13.000000000 +0100
@@ -76,15 +76,17 @@
shared: shared.C
$(CPlusPlus) -fPIC -shared -o libshared.so shared.C

+test: classad_version classad_unit_tester classad_functional_tester test_xml extra_tests
+ ./classad_version
+ ./classad_unit_tester -all
+ ./test_xml
+ ./extra_tests
+
install:: $(LIB_NAME) classad_functional_tester classad_unit_tester classad_version
- mkdir -p $(LIB_INSTALL)
- mkdir -p $(BIN_INSTALL)
- mkdir -p $(INCLUDE_INSTALL)
- cp $(LIB_NAME) $(LIB_INSTALL)
- cp classad_functional_tester $(BIN_INSTALL)
- cp classad_unit_tester $(BIN_INSTALL)
- cp classad_version $(BIN_INSTALL)
- cp $(HEADER_FILES) $(INCLUDE_INSTALL)
+ mkdir -p $(LIB_INSTALL) $(BIN_INSTALL) $(INCLUDE_INSTALL)
+ install -m 644 $(LIB_NAME) $(LIB_INSTALL)
+ install -m 755 classad_functional_tester classad_unit_tester classad_version $(BIN_INSTALL)
+ install -m 644 $(HEADER_FILES) $(INCLUDE_INSTALL)

clean: tidy
rm -f classad_functional_tester classad_unit_tester classad_version

No comments: