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

Linking error on Arch Linux: ImportError: undefined symbol: ev_io_start #193

Open
0xabe-io opened this issue Nov 24, 2017 · 2 comments
Open

Comments

@0xabe-io
Copy link

I am on a up-to-date Arch Linux install with python 3.6.3 and libev 4.24. I cloned the repositories and checked out the 2.2.3 tag. The build and installation went fine either when I build my own aerospike-client-c or I build the one provided in AUR, both with libev.

However when I launch python and import aerospike, I end up with an ImportError:

$ python
Python 3.6.3 (default, Oct 24 2017, 14:48:20) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aerospike
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: /usr/lib/python3.6/site-packages/aerospike.cpython-36m-x86_64-linux-gnu.so: undefined symbol: ev_io_start

I can see that the shared object is not linked with libev:

$ ldd /usr/lib/python3.6/site-packages/aerospike.cpython-36m-x86_64-linux-gnu.so
	linux-vdso.so.1 (0x00007ffd9adbd000)
	libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007f5e669d0000)
	libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007f5e66553000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f5e66335000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007f5e65fe9000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007f5e65dd2000)
	librt.so.1 => /usr/lib/librt.so.1 (0x00007f5e65bca000)
	libpython3.6m.so.1.0 => /usr/lib/libpython3.6m.so.1.0 (0x00007f5e6566d000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007f5e652b5000)
	/usr/lib64/ld-linux-x86-64.so.2 (0x00007f5e66f42000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f5e650b1000)
	libutil.so.1 => /usr/lib/libutil.so.1 (0x00007f5e64eae000)

During the build, there is no -lev in the gcc command (there are the -lpthread, -lssl and so on). To fix that, I added ev in the libraries list in setup.py:

$ git diff setup.py
diff --git a/setup.py b/setup.py
index a750c74..345be59 100644
--- a/setup.py
+++ b/setup.py
@@ -175,7 +175,8 @@ libraries = [
   'crypto',
   'pthread',
   'm',
-  'z'
+  'z',
+  'ev',
   ]
 
 ################################################################################

After a rebuild all is fine:

$ ldd /usr/lib/python3.6/site-packages/aerospike.cpython-36m-x86_64-linux-gnu.so
[snip]
	libev.so.4 => /usr/lib/libev.so.4 (0x00007f6171d99000)
[snip]
$ python
Python 3.6.3 (default, Oct 24 2017, 14:48:20) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import aerospike
>>>

I don't think it is a correct fix for everyone, as it is possible to build aerospike-client-c with libev, libevent or libuv.

@aerospikerobertmarks
Copy link
Contributor

Apologies for the delayed response. The Aerospike Python client doesn't actually use any of the async features or event frameworks provided with the Async C client. So I would suggest building a C client without the optional event loop support, and using that as the basis for the Python Client.

I will add a note about that to our documentation for building the Python client with a pre-existing C client.

Thanks for bringing this to our attention.

@marknaero
Copy link
Contributor

With pip (>=19.0) and latest python client (>=3.8.0), you should be able to install on linux without needing to clone the c client or install any other dependencies anymore.

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

3 participants