Print

Print


Hi Bill,

My first instinct is just as you said: the log4cxx library isn't being 
linked to.  Perhaps you forgot to specify the appropriate library when 
linking the .so?

When python tries to import it as a module, it won't try to link with 
anything it wasn't told to, so it will try to resolve all the symbols 
against the libraries it knows about, which are the ones already linked 
in the python process and the ones that the .so claims it needs. Note 
that in this case, ld won't give you an error when creating a shared 
object (.so) that can't be dynamically loaded by the process (e.g., 
python) you have in mind--for all it knows, the unresolved symbols might 
exist in the host process.

Hope this helps,
-Daniel

(dynamic linking/loading is actually quite complex--I have a book to 
recommend if you're curious)

On 02/12/2014 01:49 AM, Bill Chickering wrote:
> Greetings -
>
> I'm experimenting with log4cxx and qserv but have run into 
> swig-related difficulties. After locally installing log4cxx within a 
> qserv instance, I am able to use it without trouble in stand-alone 
> programs. When I include calls to log4cxx within qserv, however, I 
> receive the following error when attempting to start qserv_master:
>
> Traceback (most recent call last):
>   File "/u1/bchick/sandbox2/mystuff/qserv/master/dist/startQserv.py", 
> line 36, in <module>
>     from lsst.qserv.master.appTest import TestAppFunctions
>   File 
> "/u1/bchick/src/mystuff/master/dist/lsst/qserv/master/__init__.py", 
> line 26, in <module>
>     from masterLib import *
>   File 
> "/u1/bchick/src/mystuff/master/dist/lsst/qserv/master/masterLib.py", 
> line 25, in <module>
>     _masterLib = swig_import_helper()
>   File 
> "/u1/bchick/src/mystuff/master/dist/lsst/qserv/master/masterLib.py", 
> line 21, in swig_import_helper
>     _mod = imp.load_module('_masterLib', fp, pathname, description)
> ImportError: 
> /u1/bchick/src/mystuff/master/dist/lsst/qserv/master/_masterLib.so: 
> undefined symbol: _ZTIN7log4cxx7helpers13ObjectPtrBaseE
>
> For context, I made the following code changes (note: this version of 
> qserv is pre- new modular layout). I added the following includes to 
> the top of AsyncQueryManager.cc <http://AsyncQueryManager.cc>:
>
> #include <log4cxx/logger.h>
> #include <log4cxx/consoleappender.h>
> #include <log4cxx/simplelayout.h>
> #include <log4cxx/logmanager.h>
>
> And added the following lines to the AsyncQueryManager::add() function:
>
> log4cxx::LoggerPtr logger(log4cxx::Logger::getLogger("Qserv"));
> LOG4CXX_INFO(logger, "EXECUTING AsyncQueryManager::add()")
>
> And that's it. I believe the correctness of this code is beside the 
> point. The problem appears to be that the log4cxx library, located 
> within %QSERV_BASE_DIR%/lib is not being linked to.
>
> I seem to be missing one or more steps in my attempt to incorporate a 
> new library into qserv.
>
> Any clues?
>
> Thanks in advance,
> Bill
>
>
> ------------------------------------------------------------------------
>
> Use REPLY-ALL to reply to list
>
> To unsubscribe from the QSERV-L list, click the following link:
> https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1
>

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the QSERV-L list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1