0

I have been testing out a spectrometer called Nano lambda SPR on ubuntu. I simply followed their installation manual to install libusb-1.0.9 and libusb-compat-1.0.4. The link to their installation manual with pictures and explanation of what to install is here. I simply followed the beginning and went straight to the last page to run their python examples. Now I am trying to run one of their example scripts. However, I get the following error and I am not sure what libgsl.so.0 is and where to start looking to resolve this issue.

**********************************************************************
[Python-3]        Python Version :  3 . 8  Detected
**********************************************************************
[PythonPrism] CrystalBase Library Loaded Successfully!
[PythonPrism] CrystalCorePath:  ../Libs/libCrystalCore.so
Traceback (most recent call last):
  File "example_wrapper_python.py", line 32, in <module>
    pSpecCore =   initialize_core_api("../Libs/libCrystalCore.so")
  File "../../../../wrappers/python/wrapper_python3/core/initialize_core_api.py", line 16, in initialize_core_api
    pSpecCore = ctypes.CDLL(crystal_core_library_path)
  File "/usr/lib/python3.8/ctypes/__init__.py", line 369, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: libgsl.so.0: cannot open shared object file: No such file or directory

I also followed the this link and ran the command: sudo find / -name libgsl.so and it gave me the following outputs: /usr/local/lib/libgsl.so /usr/lib/x86_64-linux-gnu/libgsl.so

So I then set LD_LIBRARY_PATH=/usr/local/lib and export LD_LIBRARY_PATH and ran the script with python, but I still get the same error.

I also ran sudo apt install libgsl-dev and got it installed. But the error is still the same.

I also ran the following command ls -l /usr/local/lib/libgsl* and got the following output:

-rw-r--r-- 1 root root 23265766 /usr/local/lib/libgsl.a
-rw-r--r-- 1 root root  1893050 /usr/local/lib/libgslcblas.a
-rwxr-xr-x 1 root root      949 /usr/local/lib/libgslcblas.la
lrwxrwxrwx 1 root root       20 /usr/local/lib/libgslcblas.so -> libgslcblas.so.0.0.0
lrwxrwxrwx 1 root root       20 /usr/local/lib/libgslcblas.so.0 -> libgslcblas.so.0.0.0
-rwxr-xr-x 1 root root  1098776 /usr/local/lib/libgslcblas.so.0.0.0
-rwxr-xr-x 1 root root      918 /usr/local/lib/libgsl.la
lrwxrwxrwx 1 root root       16 /usr/local/lib/libgsl.so -> libgsl.so.25.0.0
lrwxrwxrwx 1 root root       16 /usr/local/lib/libgsl.so.25 -> libgsl.so.25.0.0
-rwxr-xr-x 1 root root 13525872 /usr/local/lib/libgsl.so.25.0.0

Jeff Boker
  • 803
  • 1
  • 9
  • 25

1 Answers1

0

Did you Google this? libgsl is the Gnu Scientific Library. If you're running Ubuntu, do sudo apt install libgsl-dev.

Tim Roberts
  • 48,973
  • 4
  • 21
  • 30
  • Ya, I installed it but I still get the same error when running the example script – Jeff Boker Mar 19 '21 at 20:13
  • Hmm. Could be a version problem. If you `ls -l /usr/local/lib/libgsl*`, what versions are there? This is looking specifically for `libgsl.so.0`. At least, I think so. Your image is very difficult to read. You should have posted it as text. – Tim Roberts Mar 19 '21 at 20:37
  • These are the versions. I replaced the image with the text as well. ```rwxrwxrwx /usr/local/lib/libgslcblas.so -> libgslcblas.so.0.0.0 lrwxrwxrwx /usr/local/lib/libgslcblas.so.0 -> libgslcblas.so.0.0.0 -rwxr-xr-x /usr/local/lib/libgslcblas.so.0.0.0 lrwxrwxrwx /usr/local/lib/libgsl.so -> libgsl.so.25.0.0 lrwxrwxrwx /usr/local/lib/libgsl.so.25 -> libgsl.so.25.0.0 -rwxr-xr-x 1 /usr/local/lib/libgsl.so.25.0.0 ``` – Jeff Boker Mar 19 '21 at 21:04
  • OK, that's ugly. Your app is linking against a much older version of the library. You can try a bit of hackery, but if it doesn't work, there's little you can do. `cd /usr/local/lib` / `sudo ln -s libgls.so.25.0.0 libgls.so.0` – Tim Roberts Mar 19 '21 at 21:17
  • I ran those commands, and then tried to run my script again, but the error was still the same libgsl.so.0 cannot open shared object file. Is there no way of removing the older version of the library and reinstalling the new one? – Jeff Boker Mar 19 '21 at 21:44
  • I'll be honest, I don't know. There have been other people reporting this problem, but the resolution wasn't clear to me. – Tim Roberts Mar 19 '21 at 22:03