Page 1 of 1

redpitaya-epics compilation error

Posted: Mon Nov 20, 2023 4:02 pm
by njoshi
Hi,
I am trying to install redpitaya-epics (https://github.com/AustralianSynchrotro ... taya-epics), but getting compilation error of not able to find some functions.

I am using redpitaya 14 B, with OS-2 stable version.
I have successfully compiled the examples and custom code to control GPIO pins, so the C API seems to run fine.

Following the redpitaya-epics installation instructions I have built,
epics-base-7.0.7 ( https://epics-controls.org/resources-and-support/base/ ) and
asyn module ( https://github.com/epics-modules/asyn/tree/master )

I have also pointed the redpitaya-epics to EPICS-base and asyn by defining in ./configure/RELEASE.

When I hit make it gives me following errors.

/usr/bin/g++ -o RedPitayaTest -L/usr/local/epics/redpitaya-epics-master/lib/linux-arm -L/usr/local/epics/base/lib/linux-arm -L/usr/local/epics/support/asyn/4-45/lib/linux-arm -Wl,-rpath,/usr/local/epics/redpitaya-epics-master/lib/linux-arm -Wl,-rpath,/usr/local/epics/base/lib/linux-arm -Wl,-rpath,/usr/local/epics/support/asyn/4-45/lib/linux-arm -rdynamic RedPitayaTest_registerRecordDeviceDriver.o RedPitayaTestMain.o -lasyn -ldrvRedPitaya -ldbRecStd -ldbCore -lca -lCom
/usr/bin/ld: /usr/local/epics/redpitaya-epics-master/lib/linux-arm/libdrvRedPitaya.so: undefined reference to `rp_AcqGetSamplingRate'
/usr/bin/ld: /usr/local/epics/redpitaya-epics-master/lib/linux-arm/libdrvRedPitaya.so: undefined reference to `rp_GenTrigger'
/usr/bin/ld: /usr/local/epics/redpitaya-epics-master/lib/linux-arm/libdrvRedPitaya.so: undefined reference to `rp_AcqSetSamplingRate'
collect2: error: ld returned 1 exit status
make[3]: *** [/usr/local/epics/base/configure/RULES_BUILD:231: RedPitayaTest] Error 1
make[3]: Leaving directory '/usr/local/epics/redpitaya-epics-master/RedPitayaTestApp/src/O.linux-arm'
make[2]: *** [/usr/local/epics/base/configure/RULES_ARCHS:58: install.linux-arm] Error 2
make[2]: Leaving directory '/usr/local/epics/redpitaya-epics-master/RedPitayaTestApp/src'
make[1]: *** [/usr/local/epics/base/configure/RULES_DIRS:85: src.install] Error 2
make[1]: Leaving directory '/usr/local/epics/redpitaya-epics-master/RedPitayaTestApp'
make: *** [/usr/local/epics/base/configure/RULES_DIRS:85: RedPitayaTestApp.install] Error 2

Re: redpitaya-epics compilation error

Posted: Wed Nov 22, 2023 12:18 pm
by redpitaya
Hello njoshi,

Thank you for posting on the forum.

Which Red Pitaya OS version exactly are you using?

From what I can surmise from GitHub, the driver was developed for Red Pitaya OS version 0.98, so there might be some C API command compatibility issues. From the compiler reports it seems that it is looking for the wrong functions (the names have changed since OS 0.98).

I believe the problem can be fixed by editing the code to include the proper function calls. You can find the full list here (or look in the rp_api directory for all other functions):
https://github.com/RedPitaya/RedPitaya/ ... i/src/rp.c

Another useful link:
https://redpitaya.readthedocs.io/en/lat ... plications

Re: redpitaya-epics compilation error

Posted: Wed Nov 22, 2023 2:36 pm
by njoshi
Hi,

Thank you for your response. They must have their version of rp.h, otherwise this should have been function declaration level error. I will compare with current version you mentioned and see the difference.
I was hoping anyone maintaining the epics IOC would pickup this up and update the repository.
If that doesn't happen soon than I will strip the IOC to my requirements and make that work.

Regards,
Nirav