areaDetector / ADSpinnaker

An EPICS areaDetector driver for cameras from FLIR (formerly Point Grey) using their Spinnaker SDK.
https://areadetector.github.io/areaDetector/ADSpinnaker/ADSpinnaker.html
5 stars 6 forks source link

"Missing" libraries when running the IOC #13

Closed dungducphan closed 7 months ago

dungducphan commented 7 months ago

After building successfully, I tried to run the IOC (ADSpinnaker/iocs/spinnakerIOC/bin/linux-x86_64/spinnakerApp) but encounter the error of missing libGenApi_gcc11_v3_0.so. This lib file is in spinnakerSupport/os/linux-x86_64 but somehow there is no EPICS variable pointing to it. I ended up making a symlink from spinnakerSupport/os/linux-x86_64 to /usr/lib/ to run the IOC.

I think I missed something in the installation/configuration. What EPICS variable should point to the support libraries directory?

Thank you!

MarkRivers commented 7 months ago

What version of Linux are you running and what version of ADSpinnaker?

dungducphan commented 7 months ago

I'm using Ubuntu 22.04 LTS. ADSpinnaker tag version R3-4 (https://github.com/areaDetector/ADSpinnaker/releases/tag/R3-4).

MarkRivers commented 7 months ago

Here is how it is supposed to work, and it does work fine for me. I am testing R3-4 on CentOS 9 Stream. I have also tested on Ubuntu 22 and it works fine there too.

First do a clean install:

[epics@countach-c9 ADSpinnaker]$ pwd
/corvette/home/epics/devel/areaDetector/ADSpinnaker
[epics@countach-c9 ADSpinnaker]$ make -sj clean
[epics@countach-c9 ADSpinnaker]$ make -sj
/usr/bin/ld: /corvette/home/epics/devel/areaDetector-3-13/ADSupport/lib/linux-x86_64/libjp2.a(jas_stream.o): in function `jas_stream_tmpfile':
/home/epics/devel/areaDetector-3-12-1/ADSupport/supportApp/GraphicsMagickSrc/jp2/src/libjasper/O.linux-x86_64/../../../../../../supportApp/GraphicsMagickSrc/jp2/src/libjasper/base/jas_stream.c:368: warning: the use of `tmpnam' is dangerous, better use `mkstemp'

Next make sure LD_LIBRARY_PATH is not set to help find any libraries:

[epics@countach-c9 ADSpinnaker]$ echo $LD_LIBRARY_PATH

Now look in ADSpinnaker/lib/linux-x86_64 to make sure that the libraries from the Spinnaker SDK were correctly installed there from spinnakerSupport:

[epics@countach-c9 ADSpinnaker]$ ls -l lib/linux-x86_64/
total 134744
-r--r--r-- 1 epics domain users  2622888 Feb  2 08:35 FLIR_GenTL.cti
-r--r--r-- 1 epics domain users  1285332 Feb  2 08:35 libADSpinnaker.a
-r-xr-xr-x 1 epics domain users   652608 Feb  2 08:35 libADSpinnaker.so
-r--r--r-- 1 epics domain users   154008 Feb  2 08:35 libGCBase_gcc11_v3_0.so
-r--r--r-- 1 epics domain users  4553728 Feb  2 08:35 libGenApi_gcc11_v3_0.so
-r--r--r-- 1 epics domain users    55976 Feb  2 08:35 libLog_gcc11_v3_0.so
-r--r--r-- 1 epics domain users    57400 Feb  2 08:35 libMathParser_gcc11_v3_0.so
-r--r--r-- 1 epics domain users   137680 Feb  2 08:35 libNodeMapData_gcc11_v3_0.so
-r--r--r-- 1 epics domain users 42121872 Feb  2 08:35 libSpinnaker.so
-r--r--r-- 1 epics domain users 42121872 Feb  2 08:35 libSpinnaker.so.3
-r--r--r-- 1 epics domain users 42121872 Feb  2 08:35 libSpinnaker.so.3.1.0.79
-r--r--r-- 1 epics domain users  2071616 Feb  2 08:35 libXmlParser_gcc11_v3_0.so

Note that libGenApi_gcc11_v3_0.so is correctly installed there.

Now run ldd on spinnakerApp to make sure it finds libGenApi_gcc11_v3_0.so correctly, which it does.

[epics@countach-c9 ADSpinnaker]$ ldd iocs/spinnakerIOC/bin/linux-x86_64/spinnakerApp
        linux-vdso.so.1 (0x00007fff8f295000)
        libboost_system.so.1.75.0 => /lib64/libboost_system.so.1.75.0 (0x00007f9987acf000)
        libSpinnaker.so.3 => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libSpinnaker.so.3 (0x00007f9985297000)
        libGCBase_gcc11_v3_0.so => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libGCBase_gcc11_v3_0.so (0x00007f9985277000)
        libGenApi_gcc11_v3_0.so => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libGenApi_gcc11_v3_0.so (0x00007f9984ea2000)
        libNodeMapData_gcc11_v3_0.so => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libNodeMapData_gcc11_v3_0.so (0x00007f9984e85000)
        libMathParser_gcc11_v3_0.so => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libMathParser_gcc11_v3_0.so (0x00007f9984e78000)
        libXmlParser_gcc11_v3_0.so => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libXmlParser_gcc11_v3_0.so (0x00007f9984d02000)
        libLog_gcc11_v3_0.so => /corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/lib/linux-x86_64/libLog_gcc11_v3_0.so (0x00007f9984cf4000)
        libX11.so.6 => /lib64/libX11.so.6 (0x00007f9984bac000)
        libXext.so.6 => /lib64/libXext.so.6 (0x00007f9984b97000)
        libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f9984b3f000)
        libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f9984800000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f9984a64000)
        libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f9984a47000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f9984400000)
        libgomp.so.1 => /lib64/libgomp.so.1 (0x00007f99847b9000)
        libxcb.so.1 => /lib64/libxcb.so.1 (0x00007f998478e000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f998475e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f9987ae2000)
        libXau.so.6 => /lib64/libXau.so.6 (0x00007f9984a3f000)

Now run the IOC:

[epics@countach-c9 ADSpinnaker]$ cd iocs/spinnakerIOC/iocBoot/iocSpinnaker/
[epics@countach-c9 iocSpinnaker]$ ../../bin/linux-x86_64/spinnakerApp st.cmd.PGR_GS3_PGE_23S6C
< envPaths
epicsEnvSet("IOC","iocSpinnaker")
epicsEnvSet("TOP","/corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/iocs/spinnakerIOC")
epicsEnvSet("ADSPINNAKER","/corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/iocs/spinnakerIOC/../..")
epicsEnvSet("SUPPORT","/corvette/home/epics/devel")
epicsEnvSet("ASYN","/corvette/home/epics/devel/asyn-4-43")
epicsEnvSet("AREA_DETECTOR","/corvette/home/epics/devel/areaDetector-3-13")
epicsEnvSet("ADSUPPORT","/corvette/home/epics/devel/areaDetector-3-13/ADSupport")
epicsEnvSet("ADCORE","/corvette/home/epics/devel/areaDetector-3-13/ADCore")
epicsEnvSet("AUTOSAVE","/corvette/home/epics/devel/autosave-5-10-2")
epicsEnvSet("BUSY","/corvette/home/epics/devel/busy-1-7-3")
epicsEnvSet("CALC","/corvette/home/epics/devel/calc-3-7-4")
epicsEnvSet("SNCSEQ","/corvette/home/epics/devel/seq-2-2-5")
epicsEnvSet("SSCAN","/corvette/home/epics/devel/sscan-2-11-5")
epicsEnvSet("DEVIOCSTATS","/corvette/home/epics/devel/devIocStats-3-1-16")
epicsEnvSet("EPICS_BASE","/corvette/usr/local/epics-devel/base-7.0.7")
epicsEnvSet("ADGENICAM","/corvette/home/epics/devel/areaDetector-3-13/ADGenICam")
errlogInit(20000)
dbLoadDatabase("/corvette/home/epics/devel/areaDetector-3-13/ADSpinnaker/iocs/spinnakerIOC/dbd/spinnakerApp.dbd")
spinnakerApp_registerRecordDeviceDriver(pdbbase)

The IOC works fine, it finds libGCBase_gcc11_v3_0.so and all of the other libraries.

dungducphan commented 7 months ago

Hi Mark, thank you for digging into this problem.

I have the IOC working find now. What I did:

The build completed without problem. ldd iocs/spinnakerIOC/bin/linux-x86_64/spinnakerApp shows all the Spinnaker libraries. The IOC runs fine and allows me to control my FLIR cameras.

MarkRivers commented 7 months ago

@dungducphan good news.

One thing you might want to consider is rather than downloading the tarball, to use git clone instead:

git clone https://github.com/areaDetector/ADSpinnaker
cd ADSpinnaker
git checkout R3-4

That way if there are future bug fixes on the master branch you can simply do the following:

cd ADSpinnaker
git checkout master
git pull

Or if there is a new R3-5 release

cd ADSpinnaker
git pull
git checkout R3-5