jeffdaily/parasail

CMake on MacOS; OSError: dlopen(libparasail.dylib, 6): image not found

callumparr opened this issue · 5 comments

I need parasail as a dependency for another repository

https://github.com/nanoporetech/pychopper

But I cannot get to parasail to build properly so tried installing parasail from source and seems to be no error but still see same error when I run pychopper command. Does anyone have any ideas?

tm1612s-MacBook-Pro:~ callum$ cdna_classifier.py -h
Traceback (most recent call last):
File "/Users/callum/miniconda3/bin/cdna_classifier.py", line 4, in
import('pkg_resources').run_script('pychopper==0.1.0', 'cdna_classifier.py')
File "/Users/callum/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 658, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/Users/callum/miniconda3/lib/python3.6/site-packages/pkg_resources/init.py", line 1438, in run_script
exec(code, namespace, namespace)
File "/Users/callum/miniconda3/lib/python3.6/site-packages/pychopper-0.1.0-py3.6.egg/EGG-INFO/scripts/cdna_classifier.py", line 9, in
from pychopper import chopper
File "/Users/callum/miniconda3/lib/python3.6/site-packages/pychopper-0.1.0-py3.6.egg/pychopper/chopper.py", line 6, in
from pychopper import seq_detect
File "/Users/callum/miniconda3/lib/python3.6/site-packages/pychopper-0.1.0-py3.6.egg/pychopper/seq_detect.py", line 5, in
import parasail
File "/Users/callum/miniconda3/lib/python3.6/site-packages/parasail-1.1.12-py3.6.egg/parasail/init.py", line 30, in
_lib = ctypes.CDLL(_libname)
File "/Users/callum/miniconda3/lib/python3.6/ctypes/init.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: dlopen(libparasail.dylib, 6): image not found

Sorry you're having trouble. Looks like this could be related to the issues we're seeing over on the parasail-python bindings on Mac. Lots of related build problems on Mac.

The dlopen error I think is because it is unable to find libparasail.dylib. When building parasail-python from source, it is supposed to download the latest parasail master, unzip it, configure+make to produce the libparasail.dylib, and put the *.dylib under the parasail folder so that the bdist_wheel step can package it as a 'data' object.

When building from source, did you run python setup.py bdist_wheel?

Can you find libparasail.dylib inside the parasail module wherever you installed it?

In other news, I'm blown away that parasail-python has become a dependency to another package. Thanks for being a user. Let's get this fixed.

Hey, thank you for rapid response.

Downloaded the compressed source for v2.2 and unpacked in my User folder on MacOS. I could find the libparasail.dylib in the build folder

/Users/callum/parasail-2.2/build/libparasail.dylib

I installed following the CMake instructions in the readme section. I did not run python setup.py bdist_wheel. I cannot find a setup.py file in the parasail-2.2 directory.

In what directory should I run this command?

You need to put the libparasail.dylib into the separate repo sources for parasail-python, specifically into the parasail-python/parasail subfolder. Then run parasail-python's setup.py. This is usually all taken care of for you when you run setup.py bdist_wheel from the parasail-python sources. It downloads the latest C parasail master, builds the dylib, puts it in the right place, and builds the wheel, and makes sure the dylib gets packaged.

Sorry for the confusion. You raised this issue in the C library repo.

Thank you, sorry for causing confusing. Will try this now......it worked! Thanks again for such speedy response. And now crack on with pychopper.