Nikita Vetoshkin created MESOS-1010:
---------------------------------------

             Summary: Undefined symbol in Python extension
                 Key: MESOS-1010
                 URL: https://issues.apache.org/jira/browse/MESOS-1010
             Project: Mesos
          Issue Type: Bug
          Components: build, python api
         Environment: Fedora 20, amd64. GCC: 4.8.2.
            Reporter: Nikita Vetoshkin


In my environment mesos build from master results in broken python api module 
{{_mesos.so}}:
{noformat}
nekto0n@ya-darkstar ~/workspace/mesos/src/python $ 
PYTHONPATH=build/lib.linux-x86_64-2.7/ python -c "import _mesos"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: 
/home/nekto0n/workspace/mesos/src/python/build/lib.linux-x86_64-2.7/_mesos.so: 
undefined symbol: _ZN6google14FlagRegistererC1EPKcS2_S2_S2_PvS3_
{noformat}
Unmangled version of symbol looks like this:
{noformat}
google::FlagRegisterer::FlagRegisterer(char const*, char const*, char const*, 
char const*, void*, void*)
{noformat}
Digging a bit deeper into build process I found that {{gflags}} library is 
dynamically linked and when autools(?) machinery assembles python library it 
doesn't mention {{-lgflags}}:
{noformat}
g++ -pthread -shared -Wl,-z,relro,--export-dynamic 
build/temp.linux-x86_64-2.7/native/mesos_executor_driver_impl.o 
build/temp.linux-x86_64-2.7/native/proxy_scheduler.o 
build/temp.linux-x86_64-2.7/native/proxy_executor.o 
build/temp.linux-x86_64-2.7/native/mesos_scheduler_driver_impl.o 
build/temp.linux-x86_64-2.7/native/module.o 
/home/nekto0n/workspace/mesos/src/.libs/libmesos_no_3rdparty.a 
/home/nekto0n/workspace/mesos/3rdparty/libprocess/3rdparty/protobuf-2.5.0/src/.libs/libprotobuf.a
 /home/nekto0n/workspace/mesos/3rdparty/leveldb/libleveldb.a 
/home/nekto0n/workspace/mesos/3rdparty/zookeeper-3.4.5/src/c/.libs/libzookeeper_mt.a
 /home/nekto0n/workspace/mesos/3rdparty/libprocess/.libs/libprocess.a 
/home/nekto0n/workspace/mesos/3rdparty/libprocess/3rdparty/glog-0.3.3/.libs/libglog.a
 
/home/nekto0n/workspace/mesos/3rdparty/libprocess/3rdparty/libev-4.15/.libs/libev.a
 -L/usr/lib64 -L./src/.libs/ -lpython2.7 -o 
build/lib.linux-x86_64-2.7/_mesos.so -lsasl2 -lcurl -lz -lrt -lunwind
{noformat}
Simply adding this agrument fixes the issue:
{noformat}
nekto0n@ya-darkstar ~/workspace/mesos/src/python $ ldd 
build/lib.linux-x86_64-2.7/_mesos.so 
        ...
        libgflags.so.0 => /lib64/libgflags.so.0 (0x00007f0f07e1f000)
        ...
{noformat}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to