-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
pip install z3-solver: bad path or elf header #5926
Comments
Alternatively a symlink could be added perhaps. (Update: If the path is meant to be changed. Below I conclude it is probably an issue with the SONAME so this is moot in that case). |
This is on an M1, (linux is docker on M1). |
When I test from an x86 machine, (z3) zwimer@thingy ~/.v/z/l/p/s/z/lib> readelf -a libz3.so| grep SONAME
0x000000000000000e (SONAME) Library soname: [libz3.so] To verify the version, the pip install command gave: |
I'm guessing the SONAME is being set improperly when |
Is this only a problem with 4.15 or is this a problem with M1? |
I ran some tests using after doing Using Using Also possibly relevant on macOS:
I tried linking my program against the mac version and indeed it failed looking for the versioned name of the library. Both arm packages had to build wheels (that is I had to This seems to happen on M1 hardware, however it happens both on macOS and on the linux VM mac docker uses; therefore it is quite possible that the problem is on the |
So, given the M1 wave, it sounds like we need to release for arm64 on at least the mac pipeline. |
I would agree with your statements, but I do not. In the meantime, while this is not a fix, it might be an acceptable patch if we were to add in a symlink. That is, under Likewise, perhaps a 'dumb', temporary, simple way of having native arm64 binaries is the same thing currently done to support multiple distros. If you pip install z3 on ubuntu 20.04 on x86, you'll notice the wheel contains both an The more correct way to do it, if there is bandwidth, is to create different wheels for different OS's and architectures. I believe pip and pypy support this, but it is not something I know how to do personally. For example, the cmake pypy wheels list different versions for different OS's, architectures, and other things. |
ouch. This is beyond something I know how to easily do so will take some time to deal with. A pedestrian attempt to create an ARM version for macos runs into some legacy issues so it is easily some days of on-off work fiddling with which build configuration works. |
As a very short-term stop-gap measure, may I suggest making the symlink? In a dockerfile I have for testing things I have these lines (since you obviously cannot rely on standard
All this does is functionally At the moment if you |
I've made a PR that I think should do the symlink patch I mentioned above. It is not a fix, but it should alleviate the problem a bit until a fix is made. #5974 |
The issue appears to be stale now that there is an ARM64 pip out. |
In the newest release of the z3 pip package, I've run into what I think is a bug on both macOS and Linux.
On Linux:
In
/lib
there islibz3.so
; this is the shared library, not a symlink. There are no other libs.If you run
readelf -a libz3.so | grep SONAME
you will fine the output is:When I try to link to the library the link command succeeds but it when I try to run the linked binary it looks for
libz3.so.4.8
, which does not exist. On macOS this same thing happens.For more details, here is my exact linking command:
Specifically, that last line; as you can see it links to
/venv/lib/python3.8/site-packages/z3/lib/libz3.so
; as one would expect. Then runningldd
on the resulting binary gives:As you can see in
libz3.so.4.8 => not found
, it is looking for a file that does not exist.If I had to guess, either the soname should just be
libz3.so
or the library path should belibz3.so.4.8
.To validate this all, I tried replacing the string "libz3.so.4.8" with libz3.so.4.7" in the shared library and relinked it; the result was indeed that ldd gave
libz3.so.4.7 => not found
.Also, on macOS the names are different slightly (
libz3.4.8.dylib
) where the numbers come before the extension; I'm not sure that is intentional or notThe text was updated successfully, but these errors were encountered: