paulscherrerinstitute / StreamDevice

EPICS Driver for message based I/O
GNU General Public License v3.0
28 stars 42 forks source link

Fix cplusplus linkage error with extern C #84

Closed mrippa closed 1 year ago

mrippa commented 2 years ago

I added some details in #83.

I've never seen this kind of error. This post gave some insight, esp the static declaration inside an extern scope seemed suspicious. It looks like a valid fix. Maybe you have a better or simpler fix.

https://stackoverflow.com/questions/1041866/what-is-the-effect-of-extern-c-in-c

mdavidsaver commented 2 years ago

fyi. It looks like RTEMS >=4.9 (and maybe earlier) provides strncasecmp(). Also, Base >=3.14.5 has epicsStrCaseCmp().

mrippa commented 2 years ago

It occurred to me you may want to try our EPICS 7 / RTEMS 5 container. If it helps we can setup a project access token for read access to the container.

https://gitlab.com/nsf-noirlab/gemini/rtsw/epics-base/epics-base/-/wikis/QuickStart-Docker-Setup-for-EPICS-7-and-RTEMS5

dirk-zimoch commented 2 years ago

That is great. I had struggled a lot to set up an RTEMS environment and finally gave up. Do you have an RTEMS 4 container as well?

mrippa commented 2 years ago

We do have a repo with RTEMS4, but unfortunately that is built with EPICS 3.15.

On Fri, Apr 22, 2022 at 2:26 AM Dirk Zimoch @.***> wrote:

That is great. I had struggled a lot to set up an RTEMS environment and finally gave up. Do you have an RTEMS 4 container as well?

— Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/StreamDevice/pull/84#issuecomment-1106463704, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC45DD24ZTSOMHHEL6PNUADVGKLHDANCNFSM5SAYZJ4A . You are receiving this because you authored the thread.Message ID: @.***>

dirk-zimoch commented 2 years ago

After struggling yet another day trying to set up an RTEMS environment without much success, I am seriously considering to declare RTEMS "unsupported" in the StreamDevice documentation and stop caring. :-(

mrippa commented 2 years ago

Hi Dirk,

What parameters are you trying to build with? RTEMS 4 plus EPICS 7 including certain BSP's? Presumably with a certain set of BSP's? I can try to help if I know your specifics.

-Matt

On Wed, Apr 27, 2022 at 4:53 AM Dirk Zimoch @.***> wrote:

After struggling yet another day trying to set up an RTEMS environment without much success, I am seriously considering to declare RTEMS "unsupported" in the StreamDevice documentation and stop caring. :-(

— Reply to this email directly, view it on GitHub https://github.com/paulscherrerinstitute/StreamDevice/pull/84#issuecomment-1111101665, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC45DD5PFMUPMT6FCPWTOHTVHFIFFANCNFSM5SAYZJ4A . You are receiving this because you authored the thread.Message ID: @.***>

dirk-zimoch commented 2 years ago

I have now installed RTEMS 5.1, but I cannot even build asyn with it:

In file included from ../../asyn/vxi11/drvVxi11.c:41:0:
../../asyn/vxi11/drvVxi11.c: In function 'vxiConnectPort':
../../asyn/vxi11/osiRpc.h:25:21: error: implicit declaration of function 'rtems_rpc_task_init'; did you mean 'rtems_task_exit'? [-Werror=implicit-function-declaration]
 #define rpcTaskInit rtems_rpc_task_init
                     ^
../../asyn/vxi11/drvVxi11.c:908:12: note: in expansion of macro 'rpcTaskInit'
         if(rpcTaskInit() == -1) {
            ^~~~~~~~~~~
cc1: some warnings being treated as errors

Unfortunately it is not possible to have RTEMS 4 and 5 in the same EPICS installation because they overwrite each other's header files.

mrippa commented 2 years ago

I know rtems builds can be frustrating --no doubt. Community managed docker images could help in future.

If you're on RHEL, I've uploaded the RPM for our rtems-5.1-5 install. https://gitlab.com/nsf-noirlab/gemini/rtsw/epics-base/rtems/-/blob/5-testing/rtems-5.1-5.git.0.b06f2f9.el8.x86_64.rpm This should be fully open to the public.

Hope it helps even a little. -Matt

dirk-zimoch commented 1 year ago

Manually merged.