Current midas does not compile under gcc 4.8.4

Issue #102 wontfix
Stefan Ritt created an issue

Compiling the develop branch under Scientific Linux 5.1 with gcc 4.8.4, I get the errors

src/system.c: In function 'ss_mutex_create':
src/system.c:2716:10: warning: implicit declaration of function 'pthread_mutexattr_settype' [-Wimplicit-function-declaration]
          status = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE);
          ^
src/system.c:2716:51: error: 'PTHREAD_MUTEX_RECURSIVE' undeclared (first use in this function)
          status = pthread_mutexattr_settype(attr, PTHREAD_MUTEX_RECURSIVE);
                                                   ^
src/system.c:2716:51: note: each undeclared identifier is reported only once for each function it appears in

Googling this error, I find under

https://stackoverflow.com/questions/18375527/why-is-gnu-source-macro-required-for-pthread-mutexattr-settype-while-it-is-in

that one needs to define

#define _POSIX_C_SOURCE 200112L

to use the advanced pthread features such as pthread_mutexattr_settype. If I define this variable, I get

/usr/include/sys/ipc.h:25:3: warning: #warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE" [-Wcpp]
 # warning "Files using this header must be compiled with _SVID_SOURCE or _XOPEN_SOURCE"
   ^

and tons of other errors.

So at the moment I cannot compile midas and have to revert to some older version. This is a show stopper for me.

Comments (9)

  1. Stefan Ritt reporter
    #!
    
    [meg@megon ~]$ cat /etc/redhat-release 
    Scientific Linux SL release 5.1 (Boron)
    

    You need any other information?

  2. dd1

    according to https://access.redhat.com/support/policy/updates/errata el5 is "end-of-life". It is also very old. I am not even sure if it has recursive mutexes implemented. Do we must support this? How many experiments you have running on el5? Why they cannot be upgraded to current linux distributions? What if we support just a subset of midas "to run a frontend" (no LOCAL_ROUTINES)? I will bring these questions to the midas forum, best discuss this problem there. K.O.

  3. dd1

    just looked around, I do not have any el5 computers remaining at triumf. I am not sure I can support midas on el5. There is no way you can move to a non-obsolete linux? I will look for an el5 machine some more... K.O.

  4. dd1

    gah!!! release 5.1, with no updates, security fixes, and with gcc 4.8.4 grafted into it? Even if I find an el5 machine, it will be el5.latest with stock gcc. If you want me to help with midas on such a non-standard linux, you will have to give me shell access. K.O.

  5. dd1

    message on the midas forum went out. if you do not mind, please explain why you still have sl5.1 (gah, not even 5.2!!!) and why you cannot move to an up-to-date linux. I understand that things have to be the way they have to be, but I am very curious about the "why" of it. K.O.

  6. dd1

    BTW, I do not like the idea of recursive locks, I now know how to restructure odb to remove the recursive locks (semaphore and mutex, both), but it is not a 5 minute project. If we want to do it, it will be more like January-ish. K.O.

  7. Stefan Ritt reporter

    Well, we are in the middle of a running experiment in data taking phase. I would like to update midas to test it in a production environment. Can pause for half an hour, but not a day for an OS reinstall. But don’t worry, can do that next year during the shutdown. Just miss s good testing occasion.

    Stefan

  8. Log in to comment