Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  14 Jan 2020, Peter Kunz, Forum, EPICS frontend does not compile under midas-2019-09-i epics_compile_errors.txt
    Reply  15 Jan 2020, Konstantin Olchanski, Forum, EPICS frontend does not compile under midas-2019-09-i 
       Reply  15 Jan 2020, Konstantin Olchanski, Forum, EPICS frontend does not compile under midas-2019-09-i 
          Reply  15 Jan 2020, Peter Kunz, Forum, EPICS frontend does not compile under midas-2019-09-i 
             Reply  15 Jan 2020, Konstantin Olchanski, Forum, EPICS frontend does not compile under midas-2019-09-i 
                Reply  15 Jan 2020, Konstantin Olchanski, Forum, EPICS frontend does not compile under midas-2019-09-i 
Message ID: 1777     Entry time: 14 Jan 2020     Reply to this: 1778
Author: Peter Kunz 
Topic: Forum 
Subject: EPICS frontend does not compile under midas-2019-09-i 
I'm still trying to upgrade my MIDAS system to midas-2019-09-i. Most frontends work fine with the modifications already discussed.
However, I ran into some trouble with the epics frontend. Even with the modifications it throws a lot of warnings and errors (see attached log file). I can reduce the errors with -fpermissive, but the following two errors are persistent:

/home/ays/packages/midas/drivers/device/epics_ca.cxx:167:38: error: ‘ca_create_channel’ was not declared in this scope
            , &(info->caid[i].chan_id))

/home/ays/packages/midas/drivers/device/epics_ca.cxx:178:37: error: ‘ca_create_subscription’ was not declared in this scope
            , &(info->caid[i].evt_id))

This is strange because the functions seem to be declared in base/include/cadef.h along with similar functions that don't throw an error.
I don't know what's going on. The frontend which is almost identical to the example in the midas distribution compiles without warnings or errors under the Midas2017 version. 
Attachment 1: epics_compile_errors.txt  8 kB  | Hide | Hide all
[ays@isys05 epics]$ make
g++ -g  -D_POSIX_C_SOURCE=199506L -D_POSIX_THREADS -D_XOPEN_SOURCE=500 -DOSITHREAD_USE_DEFAULT_STACK -D_X86_ -DUNIX -D_BSD_SOURCE -Dlinux -I. -I/home/ays/packages/midas/include -I/home/ays/packages/midas/drivers -I/home/ays/packages/base/include -I/home/ays/packages/base/include/os/Linux/ -DOS_LINUX -c /home/ays/packages/midas/drivers/device/epics_ca.cxx -o epics_ca.o
In file included from /home/ays/packages/midas/drivers/device/epics_ca.cxx:29:0:
/home/ays/packages/midas/include/midas.h:1316:21: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    DWORD event_id = 0;
                     ^
/home/ays/packages/midas/include/midas.h:1318:18: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    DWORD n_tag = 0;
                  ^
/home/ays/packages/midas/include/midas.h:1323:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    int hist_fh  = 0;
                   ^
/home/ays/packages/midas/include/midas.h:1324:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    int index_fh = 0;
                   ^
/home/ays/packages/midas/include/midas.h:1325:19: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    int def_fh   = 0;
                   ^
/home/ays/packages/midas/include/midas.h:1326:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    DWORD base_time  = 0;
                       ^
/home/ays/packages/midas/include/midas.h:1327:23: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11 [enabled by default]
    DWORD def_offset = 0;
                       ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx: In function ‘void exceptionCallback(exception_handler_args)’:
/home/ays/packages/midas/drivers/device/epics_ca.cxx:64:25: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   static char *noname = "unknown";
                         ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:69:50: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   if(chid) printChidInfo(chid,"exceptionCallback");
                                                  ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx: In function ‘void connectionCallback(connection_handler_args)’:
/home/ays/packages/midas/drivers/device/epics_ca.cxx:78:42: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   printChidInfo(chid,"connectionCallback");
                                          ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx: In function ‘void accessRightsCallback(access_rights_handler_args)’:
/home/ays/packages/midas/drivers/device/epics_ca.cxx:85:44: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
   printChidInfo(chid,"accessRightsCallback");
                                            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx: In function ‘INT epics_ca_init(HNDLE, void**, INT)’:
/home/ays/packages/midas/drivers/device/epics_ca.cxx:133:35: error: invalid conversion from ‘void*’ to ‘CA_INFO*’ [-fpermissive]
   info = calloc(1, sizeof(CA_INFO));
                                   ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:139:57: error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
   info->channel_names = calloc(channels, CHN_NAME_LENGTH);
                                                         ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:153:47: error: invalid conversion from ‘void*’ to ‘float*’ [-fpermissive]
   info->array = calloc(channels, sizeof(float));
                                               ^
In file included from /home/ays/packages/midas/drivers/device/epics_ca.cxx:19:0:
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:160:3: note: in expansion of macro ‘SEVCHK’
   SEVCHK(ca_add_exception_event(exceptionCallback,NULL), "ca_add_exception_event");
   ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:160:3: note: in expansion of macro ‘SEVCHK’
   SEVCHK(ca_add_exception_event(exceptionCallback,NULL), "ca_add_exception_event");
   ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:167:38: error: ‘ca_create_channel’ was not declared in this scope
            , &(info->caid[i].chan_id))
                                      ^
./cadef.h:756:32: note: in definition of macro ‘SEVCHK’
  int ca_unique_status_name  = (CA_ERROR_CODE); \
                                ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:163:5: note: in expansion of macro ‘SEVCHK’
     SEVCHK(ca_create_channel(info->channel_names + CHN_NAME_LENGTH * i
     ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:163:5: note: in expansion of macro ‘SEVCHK’
     SEVCHK(ca_create_channel(info->channel_names + CHN_NAME_LENGTH * i
     ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:169:5: note: in expansion of macro ‘SEVCHK’
     SEVCHK(ca_replace_access_rights_event(info->caid[i].chan_id
     ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:169:5: note: in expansion of macro ‘SEVCHK’
     SEVCHK(ca_replace_access_rights_event(info->caid[i].chan_id
     ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:178:37: error: ‘ca_create_subscription’ was not declared in this scope
            , &(info->caid[i].evt_id))
                                     ^
./cadef.h:756:32: note: in definition of macro ‘SEVCHK’
  int ca_unique_status_name  = (CA_ERROR_CODE); \
                                ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:172:5: note: in expansion of macro ‘SEVCHK’
     SEVCHK(ca_create_subscription (DBR_FLOAT
     ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:172:5: note: in expansion of macro ‘SEVCHK’
     SEVCHK(ca_create_subscription (DBR_FLOAT
     ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:186:3: note: in expansion of macro ‘SEVCHK’
   SEVCHK(ca_pend_event(5.0), "ca_ped_event");
   ^
./cadef.h:762:12: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
    __LINE__); \
            ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:186:3: note: in expansion of macro ‘SEVCHK’
   SEVCHK(ca_pend_event(5.0), "ca_ped_event");
   ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx: In function ‘INT epics_ca(INT, ...)’:
/home/ays/packages/midas/drivers/device/epics_ca.cxx:308:50: error: invalid conversion from ‘void*’ to ‘void**’ [-fpermissive]
       status = epics_ca_init(hKey, pinfo, channel);
                                                  ^
/home/ays/packages/midas/drivers/device/epics_ca.cxx:126:5: error:   initializing argument 2 of ‘INT epics_ca_init(HNDLE, void**, INT)’ [-fpermissive]
 INT epics_ca_init(HNDLE hKey, void **pinfo, INT channels)
     ^
In file included from ./cadef.h:95:0,
                 from /home/ays/packages/midas/drivers/device/epics_ca.cxx:19:
/home/ays/packages/midas/drivers/device/epics_ca.cxx:312:29: error: invalid conversion from ‘void*’ to ‘CA_INFO*’ [-fpermissive]
       info = va_arg(argptr, void *);
                             ^
make: *** [epics_ca.o] Error 1
[ays@isys05 epics]$ 
ELOG V3.1.4-2e1708b5