mllg / checkmate

Fast and versatile argument checks
https://mllg.github.io/checkmate/
Other
261 stars 30 forks source link

The installation of checkmake package failed due to conflicting "msg_t" #189

Closed bergen288 closed 4 years ago

bergen288 commented 4 years ago

I am trying to install R packages on AIX7.2 server. The installation of checkmake package failed with following error:

R CMD INSTALL -l /software/R/site-library checkmate_2.0.0.tar.gz
* installing *source* package 'checkmate' ...
** package 'checkmate' successfully unpacked and MD5 sums checked
** using staged installation
** libs
make[1]: Entering directory '/tmp/RtmpL78aia/R.INSTALL84022c20da752b/checkmate/src'
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c all_missing.c -o all_missing.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c any_infinite.c -o any_infinite.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c any_missing.c -o any_missing.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c any_nan.c -o any_nan.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c checks.c -o checks.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c find_min_nchar.c -o find_min_nchar.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c guess_type.c -o guess_type.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c helper.c -o helper.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c init.c -o init.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c integerish.c -o integerish.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c is_sorted.c -o is_sorted.o
gcc -maix64 -I"/opt/freeware/lib64/R/include" -DNDEBUG   -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM -mminimal-toc    -O2 -I/opt/freeware/include -I/usr/include -D_GETDELIM  -c qassert.c -o qassert.o
qassert.c:44:3: error: conflicting types for 'msg_t'
 } msg_t;
   ^~~~~
In file included from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/sys/localedef.h:60,
                 from /opt/freeware/lib/gcc/powerpc-ibm-aix7.2.0.0/8.3.0/include-fixed/stdlib.h:653,
                 from /opt/freeware/lib64/R/include/R.h:55,
                 from qassert.h:4,
                 from qassert.c:1:
/usr/include/sys/localedef31.h:133:3: note: previous declaration of 'msg_t' was here
 } msg_t;
   ^~~~~
make[1]: *** [/opt/freeware/lib64/R/etc/Makeconf:172: qassert.o] Error 1
make[1]: Leaving directory '/tmp/RtmpL78aia/R.INSTALL84022c20da752b/checkmate/src'
ERROR: compilation failed for package 'checkmate'
* removing '/software/R/site-library/checkmate'
make: *** [makefile:6: all] Error 1

src/qassert.c has the following "msg_t":

typedef struct {
    Rboolean ok;
    char msg[255];
} msg_t;

And /usr/include/sys/localedef31.h has the following different "msg_t":

typedef struct lc_messages_table {
        short   lc_version;
        short   lc_length;              /* length of this table */
        char    *lc_locale_name;        /* pointer to locale name */
        char    *messages;              /* Message Catalog name */
        char    *yes_string;            /* Response string for affirmation */
        char    *no_string;             /* Response string for negation */
} msg_t;

What's the best way to address it?

Thanks

mllg commented 4 years ago

I've prefixed the typedefs which should solve this conflict. Thanks for reporting.

bergen288 commented 4 years ago

My installation of checkmate-master has been finished successfully.

Thanks.