areaDetector / ADPICam

areaDetector driver for Princeton Instruments cameras using the PICam library
https://areadetector.github.io/areaDetector/ADPICam/PICamDoc.html
3 stars 4 forks source link

Add support for building ADPICam on Linux #16

Closed jwlodek closed 2 years ago

jwlodek commented 2 years ago

The PICam SDK is now supported on Linux, as mentioned in issue #8 and on the manufacturer's website:

PICam also requires a 64-bit operating system such as Windows 7/8/8.1/10 or Linux (only CentOS 7 distribution supported). In addition the computer used required a 2 GHz dual core processor, 4 GB of RAM and 1 GB of storage

These changes should allow ADPICam to build on 64 bit linux:

[jwlodek@dell-rhel8 ADPICam]$ uname -r
4.18.0-372.16.1.el8_6.x86_64
[jwlodek@dell-rhel8 ADPICam]$ make
make -C ./configure install
make[1]: Entering directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/configure'
perl -CSD /home/jwlodek/Workspace/epics/src/base/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64 ../..
perl -CSD /home/jwlodek/Workspace/epics/src/base/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64-debug ../..
mkdir -p O.Common
make -C O.linux-x86_64 -f ../Makefile TOP=../.. \
    T_A=linux-x86_64 install
make[2]: Entering directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/configure/O.linux-x86_64'
perl -CSD /home/jwlodek/Workspace/epics/src/base/bin/linux-x86_64/convertRelease.pl checkRelease
make[2]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/configure/O.linux-x86_64'
make -C O.linux-x86_64-debug -f ../Makefile TOP=../.. \
    T_A=linux-x86_64-debug install
make[2]: Entering directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/configure/O.linux-x86_64-debug'
perl -CSD /home/jwlodek/Workspace/epics/src/base/bin/linux-x86_64/convertRelease.pl checkRelease
make[2]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/configure/O.linux-x86_64-debug'
make[1]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/configure'
make -C ./PICamSupport install
make[1]: Entering directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/PICamSupport'
perl -CSD /home/jwlodek/Workspace/epics/src/base/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64 ..//..
perl -CSD /home/jwlodek/Workspace/epics/src/base/bin/linux-x86_64/makeMakefile.pl O.linux-x86_64-debug ..//..
mkdir -p O.Common
make -C O.linux-x86_64 -f ../Makefile TOP=..//.. \
    T_A=linux-x86_64 install
make[2]: Entering directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/PICamSupport/O.linux-x86_64'
Installing generic include file ..//../include/picam.h
mkdir ../../include
Installing generic include file ..//../include/picam_advanced.h
Installing generic include file ..//../include/picam_em_calibration.h
Installing generic include file ..//../include/picam_special.h
Installing generic include file ..//../include/pil_platform.h
Installing libpicam.so
mkdir ../../lib
mkdir ../../lib/linux-x86_64
Installing libpiac.so
Installing libpicc.so
Installing libpida.so
.
.
.
make -C ./iocPICam install
make[4]: Entering directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/iocs/PICamIOC/iocBoot/iocPICam'
make[4]: Nothing to be done for 'install'.
make[4]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/iocs/PICamIOC/iocBoot/iocPICam'
make[3]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/iocs/PICamIOC/iocBoot'
make[2]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/iocs/PICamIOC'
make[1]: Leaving directory '/home/jwlodek/Workspace/epics/src/support/areaDetector/ADPICam/iocs'
[jwlodek@dell-rhel8 ADPICam]$
[jwlodek@dell-rhel8 ADPICam]$
[jwlodek@dell-rhel8 ADPICam]$ ls -la iocs/PICamIOC/bin/linux-x86_64
total 181648
drwxrwxr-x. 2 jwlodek jwlodek        22 Aug 23 17:32 .
drwxrwxr-x. 4 jwlodek jwlodek        52 Aug 23 17:32 ..
-r-xr-xr-x. 1 jwlodek jwlodek 186006648 Aug 23 17:32 PICamApp
[jwlodek@dell-rhel8 ADPICam]$ ldd iocs/PICamIOC/bin/linux-x86_64/PICamApp 
    linux-vdso.so.1 (0x00007ffffa9af000)
    libpicam.so.0 => /usr/local/lib/libpicam.so.0 (0x00007f337ae23000)
    libpida.so.0 => /usr/local/lib/libpida.so.0 (0x00007f337abc0000)
    libpidi.so.0 => /usr/local/lib/libpidi.so.0 (0x00007f337a92d000)
    libpicc.so.0 => /usr/local/lib/libpicc.so.0 (0x00007f337a54d000)
    libpiac.so.0 => /usr/local/lib/libpiac.so.0 (0x00007f337a338000)
.
.
.

I have tested building/running ADPICam on both CentOS 7 and RHEL 8, both of which work (though on RHEL 8 there is some issue with process locking that I needed to resolve for the SDK to behave.)