Bugzilla – Bug 4240
compilation error when building globus_debug.c against MPICH2/gcc
Last modified: 2006-04-18 10:58:23
You need to log in before you can comment on or make changes to this bug.
On tg-login2.uc.teragrid.org, I encountered the following error when building GT4.0.1-r3b against an MPICH2 1.0.3 installation created using gcc. I also encounter the same error when building GT4.0.1 on smash.mcs.anl.gov, so the problem is not specific to the TeraGrid login node. /home/toonen/p/mpich2-gcc/bin/mpicc -DHAVE_CONFIG_H -I. -I/home/toonen/p/gt4.0.1-r3b-all-source-installer/source-trees-thr/common/so urce/library -I.. -I. -I/home/toonen/p/gt4.0.1-r3b-gcc-mpich2/include/mpicc64dbgpthr -I/home/toonen/p/gt4.0.1-r3b-gcc-mpich2/include -I/home/toonen/p/gt4.0.1-r3b-gcc-mpich2/include/mpicc64dbgpthr -g -Wall -c globus_debug.c -fPIC -DPIC -o .libs/globus_debug.o globus_debug.c:19: parse error before "__extension__" globus_debug.c:19: `__len' undeclared here (not in a function) globus_debug.c:19: initializer element is not constant globus_debug.c:19: parse error before "if" globus_debug.c:19: warning: type defaults to `int' in declaration of `__retval' globus_debug.c:19: conflicting types for `__retval' globus_debug.c:19: previous declaration of `__retval' globus_debug.c:19: warning: data definition has no type or storage class globus_debug.c:19: parse error before '}' token Commenting out line 19, which is a declaration for the strdup() function, fixes the problem. The problem is that /usr/include/bits/string2.h, which is included by /usr/include/string.h, defines strdup as a macro.
Committed a fix to globus_4_0_branch and trunk. I don't know what should be done as far as the r3 build is concerned.