intrepidcs / python_ics

Library for interfacing with Intrepid devices in Python
MIT License
62 stars 31 forks source link

Linux support #82

Closed jjguti closed 4 years ago

jjguti commented 4 years ago

Hi,

we are running on linux (debian 9) to connect to a RAD Pluto. According to the instructions, we should be using icsneoapi (https://github.com/intrepidcs/icsneoapi) but it doesn't seem to have support for that. If we use (https://github.com/intrepidcs/libicsneo) then the library names don't match, but if we use:

ics.override_library_name("/usr/lib/x86_64-linux-gnu/libicsneoc.so")

or

ics.override_library_name("/usr/lib/x86_64-linux-gnu/libicsneolegacy.so")

then we get a segmentation fault or the following error depending on how we install it:

ics.ics.RuntimeError: Error: open_device(): Failed to Retrieve address of function 'icsneoFindDevices': /usr/lib/x86_64-linux-gnu/libicsneoc.so: undefined symbol: icsneoFindDevices for library '/usr/lib/x86_64-linux-gnu/libicsneoc.so'.

So what's the correct procedure to installing python-ics on debian 9? Is there support for this configuration?

I can add that the C and CPP examples in libicsneo seem to work as expected, it's just the python support that seems to fail. Using python-ics in windows seems to work as expected.

hollinsky-intrepid commented 4 years ago

Hi @jjguti,

ics.override_library_name("/usr/lib/x86_64-linux-gnu/libicsneolegacy.so") is the correct import. This Python library is written against icsneo40, and the "legacy" bindings within libicsneo are meant to be a drop in replacement for that.

We should track down where you're seeing a segmentation fault. Do you know which line in your code triggers it?

jjguti commented 4 years ago

Ok, I will be able to try this again on Monday, but is this documented somewhere? I am maybe looking at the wrong documentation?

I tested this locally just now (I don't have the device with me) and it seemed to work but of course I cannot test the segmentation fault.

Thanks for the help!

drebbe-intrepid commented 4 years ago

I've updated the documentation to reflect this. Will be in the next build.

https://github.com/intrepidcs/python_ics/commit/e368845ee052f039e5ac56f2e22ef5a08e20d754

drebbe-intrepid commented 4 years ago

https://python-ics.readthedocs.io/en/v4.6/#installation-on-linux