LabJackPython icon indicating copy to clipboard operation
LabJackPython copied to clipboard

liblabjackusb.so: undefined symbol: DigitalIO

Open llarose opened this issue 6 years ago • 1 comments

I got an installation and library issue.

I followed these installation steps for an installation on ubuntu 16.04. https://labjack.com/support/software/installers/exodriver/mac-and-linux/...

The following code brings me to an undefined symbol for DigitalIO in the liblabjackusb.so

$ python
>>> import u12
>>> d =u12.U12()
>>> d.digitalIO(idNum=-1, demo=0, trisD=3, trisIO=0, stateD=0, stateIO=0, updateDigital=1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "build/bdist.linux-x86_64/egg/u12.py", line 2506, in digitalIO
    def getFirmwareVersion(self, idNum=None):
  File "/usr/lib/python2.7/ctypes/__init__.py", line 375, in __getattr__
    func = self.__getitem__(name)
  File "/usr/lib/python2.7/ctypes/__init__.py", line 380, in __getitem__
    func = self._FuncPtr((name_or_ordinal, self))
AttributeError: /usr/local/lib/liblabjackusb.so: undefined symbol: DigitalIO

I was looking around for the DigitalIO implementation and i found it in ljacklm.h and ljacklm.c.

$cd ljacklm/libljacklm
$ nm ljacklm.o | grep DigitalIO
0000000000007489 T DigitalIO
$ nm libljacklm.so.1.20.2 | grep DigitalIO
00000000000091a9 T DigitalIO

u12.py loads the liblabjackusb.so but it should load the ljacklm.so.1.20.2 (see u12.py line 348) .

There is forum discussion on labjack about this issue: https://labjack.com/forums/u12/liblabjackusbso-undefined-symbol-digitalio#comment-form

There is also a stackoverflow question about it : https://stackoverflow.com/questions/46206357/liblabjackusb-so-undefined-symbol-digitalio#46220124

llarose avatar Sep 14 '17 13:09 llarose

Take a look at the LabJack Forum discussion you linked to for my original response to this and a workaround to try for now. To add to that, you could make a single digital I/O function that uses the workaround.

Current functionality is that some functions are cross-platform as mentioned in the u12.py module doc, but not ljacklm/ljackuw functions like digitalIO since u12.py was implemented before they were available on Linux/MacOS.

I will put ljacklm function support in u12.py on my todo list, but note that U12 development is low priority so there is no timeline on when this will be fully implemented. I did some coding today, and this is not a simple fix without breaking existing raw functions. If you need a quick u12.py fix where only ljacklm functions are working but not raw functions, email me at [email protected] .

davelopez01 avatar Sep 15 '17 01:09 davelopez01