Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create zookeeper.so for newer version #10

Closed
mihir6692 opened this issue May 23, 2017 · 5 comments
Closed

How to create zookeeper.so for newer version #10

mihir6692 opened this issue May 23, 2017 · 5 comments

Comments

@mihir6692
Copy link

Hi,
I am trying to build libzookeeper_mt.so.2.0.0 and zookeeper.so for newer version of zookeeper.

I am following README . I have been able to create files from README procedure but when i use them , it gives error like below :-

ImportError: dynamic module does not define init function (initzookeeper)

Can you point to any link which can resolve issue or give some instruction for this?

@mihir6692
Copy link
Author

@phunt

@phunt
Copy link
Owner

phunt commented May 23, 2017

Which version of ZK are you trying to update to?

@mihir6692
Copy link
Author

I am trying create files for 3.4.x ( currently 3.4.10) versions.

@phunt
Copy link
Owner

phunt commented May 24, 2017

That's odd. When you run zksmokes python scripts they are going to need access to the python native libraries as well as the zookeeper c client libraries.

Notice there are two libraries here:


$ ls lib.linux-i686-2.6/
libzookeeper_mt.so.2* zookeeper.so*


initzookeeper is in ./src/contrib/zkpython/src/c/zookeeper.c from zookeeper - meaning it's the python library, not in the zk client library. (python lib uses the zk c client lib)

Are you sure that both sets of libraries are available when you run the zk smoketest python script?

A few things to check: did you recompile zkpython as well from zk contrib and make it accessible to the smoketest python scripts when executing?

I haven't regenerated those files myself in quite some time. I just tried it using the following process and it worked OK.

  1. used docker to spin up an ubuntu container with 14.04 (and nothing ZK specific)
  2. used git to clone zk and checked out 3.4.10 release tag.
  3. compiled the java code, c client, and zkpython in zk. used "install" targets to ensure everything is in the expected location (python 2.7.6 with python-dev also installed via apt-get)
  4. started the zk server so that we'd have something to talk to
  5. cloned zk-smoketest. deleted the "lib*" directories from zk-smoketest
  6. ran "./zk-smoketest.py --servers "localhost:2181" which executed successfully

@mihir6692
Copy link
Author

mihir6692 commented May 24, 2017

Thanks for tip. I was not building Java code and because of that test-classes were not created in build/ folder. Also i didnt build contrib code earlier.

Here are the steps i followed :-

From zookeeper repo:-

ant

ant mvn-deploy

ant complie_jute

cd src/c/

find where ACLOCAL is installed
ACLOCAL="aclocal -I /usr/share/aclocal" autoreconf -if

./configure

sudo make install

cd ../contrib

ant

cd zkpython

this last step will create zookeeper.so and install zookeeper.so into python/dist-packages
location of zookeeper.so :- zookeeper/build/contrib/zkpython/lib.linux-x86_64-2.7/

sudo ant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants