-
Notifications
You must be signed in to change notification settings - Fork 160
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
ZFPY osx wheels delocate dylibs #107
Comments
I was going to experiment with zfpy on MacOS but it seems installing from source didn't work well either. Thanks for putting this library together!
|
I'm not sure what |
Hi Dr. Lindstrom! Yes, it's possible to pass it using https://github.com/seung-lab/pyspng-seunglab/blob/master/setup.py#L46-L55 |
Great. Does |
I took a closer look and it seems that was not sufficient to get it to build. I was able to compress and decompress a numpy array after using
ext_modules=[
Extension("zfpy", ["python/zfpy.pyx"],
include_dirs=["include", np.get_include()],
libraries=["zfp"],
library_dirs=["lib"],
)
] I tried to see if I could at least reproduce this using an sdist, but the
This makes sure all the necessary c files are included in the package. However, this isn't sufficient because libzfp.a has not been built. In the pyspng-seunglab setup.py file referenced above I call out to I do have one cmake example I could follow which is located here: https://github.com/seung-lab/DracoPy/blob/master/setup.py I recognize that you have a more formal build process here, so I'm sure you'd want to tweak the exact build sequence and folders. I think others may disagree with me, but in my own libraries, I like to pre-compile the cython and build from there which eliminates the cython dependency. This might not be as future proof though I can't articulate specifically in what ways it could fail. |
You can try pip install zfpy today, it may be all problems gone now.
…Sent from my iPhone
On Feb 24, 2022, at 10:18 AM, William Silversmith ***@***.***> wrote:
I took a closer look and it seems that was not sufficient to get it to build. I was able to compress and decompress a numpy array after using python setup.py develop with the following modifications:
run make
modify setup.py as follows:
ext_modules=[
Extension("zfpy", ["python/zfpy.pyx"],
include_dirs=["include", np.get_include()],
libraries=["zfp"],
library_dirs=["lib"],
)
]
I tried to see if I could at least reproduce this using an sdist, but the zfp.pxd was not included by default using this setup, so I added a MANIFEST.in file in the same directory as setup.py with the following contents:
include python/zfpy.pxd
include python/zfpy.pyx
recursive-include include *.h
recursive-include src *.c *.h
This makes sure all the necessary c files are included in the package. However, this isn't sufficient because libzfp.a has not been built. In the pyspng-seunglab setup.py file referenced above I call out to make in a subshell for building on macos (for some reason only clang on MacOS didn't want to build for that module). For Linux and MacOS, I think the same strategy would work here. Windows is another beast, but probably a cmake solution would work for all three of them (but I'm not very good at cmake...).
I do have one cmake example I could follow which is located here: https://github.com/seung-lab/DracoPy/blob/master/setup.py
I recognize that you have a more formal build process here, so I'm sure you'd want to tweak the exact build sequence and folders.
I think others may disagree with me, but in my own libraries, I like to pre-compile the cython and build from there which eliminates the cython dependency. This might not be as future proof though I can't articulate specifically in what ways it could fail.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
|
Just gave it a try and still getting the same error unfortunately. T_T
|
Can you try zfpy-py310-macos version? I tried this morning, and have no any problem.
…Sent from my iPhone
On Feb 24, 2022, at 11:22 AM, William Silversmith ***@***.***> wrote:
Just gave it a try and still getting the same error unfortunately. T_T
(tmp) wms:~$ pip install zfpy --force-reinstall --no-cache-dir
Collecting zfpy
Downloading zfpy-0.5.5-cp39-cp39-macosx_10_9_x86_64.whl (95 kB)
|████████████████████████████████| 95 kB 9.3 MB/s
Installing collected packages: zfpy
Successfully installed zfpy-0.5.5
WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available.
You should consider upgrading via the '/Users/wms/.virtualenvs/tmp/bin/python -m pip install --upgrade pip' command.
(tmp) wms:~$ python
Python 3.9.7 (v3.9.7:1016ef3790, Aug 30 2021, 16:25:35)
[Clang 12.0.5 (clang-1205.0.22.11)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import zfpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/Users/wms/.virtualenvs/tmp/lib/python3.9/site-packages/zfpy.cpython-39-darwin.so, 0x0002): Library not loaded: @rpath/libzfp.0.dylib
Referenced from: /Users/wms/.virtualenvs/tmp/lib/python3.9/site-packages/zfpy.cpython-39-darwin.so
Reason: tried: '/usr/lib/libzfp.0.dylib' (no such file)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you authored the thread.
|
Oh hey, that worked! I can definitely use this for experiments. Thank you! |
ZFPY osx wheels are not linked with dylibs, we need to figure out how to delocate the dylibs correctly.
The text was updated successfully, but these errors were encountered: