I'm having a hard time attempting to use libmesos.so and hoping for
guidance.
Issue:
Libmesos.so as installed by the mesosphere .deb pkg or built from source
statically links all sources including:
1. Protobuf (2.5)
2. Zookeeper (3.4.5)
This is a problem because when you start any int main(args, char**) it is
suggested by the protobuf to initialize it for proper behavior. (check
versions)
Here is the snippet from source:
build/include/google/protobuf/stubs/common.h
149:#define GOOGLE_PROTOBUF_VERIFY_VERSION
// Place this macro in your main() function (or somewhere before you attempt
// to use the protobuf library) to verify that the version you link against
// matches the headers you compiled against. If a version mismatch is
// detected, the process will abort.
#define GOOGLE_PROTOBUF_VERIFY_VERSION \
::google::protobuf::internal::VerifyVersion( \
GOOGLE_PROTOBUF_VERSION, GOOGLE_PROTOBUF_MIN_LIBRARY_VERSION, \
__FILE__)
To deinitialize the library you are suggested you call 'shutdown'
build/include/google/protobuf/stubs/common.cc
void ShutdownProtobufLibrary() {
internal::InitShutdownFunctionsOnce();
// ... stuff
}
Well the issue is that when linking w/ libmesos (the static fat lib 298MB
as of rc3)
my protobufs now double free :(
I haven't yet been able to play w/ zookeeper and its internal state as it
interacts w/
libmesos.so. The issue is fundamentally static state (ugh). But I have to
use
these libs (zookeeper, protobuf) for a project.
The tentative solution suggested (mesos/docs/configuration.md) is
to use the compile time flags --with-zookeeper=/path/to/root/not/src/c
*this is where i'd like guidance*
I have not been able to compile libmesos as a lib without statically
linking all the deps
Note: I have read the mainling list post describing why the build system
was originally
set up this way (mainly that there are patches -- look at the .patch files)
Things I've done to try and build libmesos.so without statically linking
protobufs, boost, zookeeper:
Here are the command line args passing to configure:
// assume TLD=/absolute/path/to/libs
./configure --enable-shared=yes \
--enable-bundled=no \
--disable-python \
--with-zookeeper="${TLD}/zookeeper" \
--with-leveldb="${TLD}/leveldb"
The first problem is that passing just -with-leveldb= to the dir w/ leveldb
for example
doesn't find the -lleveldb.
I tried looking at the make file and the paths seem correct mainly:
Lines 129 & 130 (I guess this might change from system to system)
am__append_2 = $(LEVELDB)/libleveldb.a
am__append_3 = $(ZOOKEEPER)/src/c/libzookeeper_mt.la
Notes about my desktop system:
Using gcc 4.8
$ lsb_release -a
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
The questions i'm looking to get some pointers are:
* Has anyone actually built a shared libmesos.so without included
dependencies, if so, how.
* Is there a pre-build binaries (lib mesos w/out deps) for linux x86_64
systems avail for download
perhaps the mesosphere guys have some solution here.
* How have other people building native apps (c++) linked and used
libmesos.so in their projects
successfully? (either remove their versions of the lib and be forced to
use libmesos.so or ...?)
Kindly let me know if I can provide clarification.
Thanks in advance for reading.
-Alex
Sincerely,
Alexander Gallego
---*---
------*
* * *