Problem building mpiexec on Mac

William Gropp wgropp at uiuc.edu
Tue Mar 25 14:22:04 EDT 2008


Hi Pete,

For these old Macs, they need

#include <stdint.h>

instead of <sys/types.h>

That probably requires a configure check for stdint.h .

For localtime, that fix works, and looking at localtime, I believe  
that is the correct (for all systems) code (time_t and the type of  
tv_sec may be different).

Thanks!

Bill

On Mar 25, 2008, at 10:54 AM, Pete Wyckoff wrote:

> wgropp at uiuc.edu wrote on Tue, 25 Mar 2008 07:47 -0500:
>> I'm trying to use mpiexec on the Turing cluster at Illinois
>> (turing.cse.uiuc.edu), and the make failed with
>>
>> gcc -g -O2 -Wall -W -Wpointer-arith -Wwrite-strings -Wcast-align
>> -Wcast-qual -Wbad-function-cast -Wundef -Wmissing-prototypes
>> -Wmissing-declarations -Wnested-externs -I/usr/local/torque-2.1.7/ 
>> include
>> -c start_tasks.c
>> start_tasks.c: In function `portals_build_nidpid_maps':
>> start_tasks.c:259: error: `uint32_t' undeclared (first use in this
>> function)
>> start_tasks.c:259: error: (Each undeclared identifier is reported  
>> only once
>> start_tasks.c:259: error: for each function it appears in.)
>> start_tasks.c:259: error: parse error before "addr"
>> start_tasks.c:273: error: `addr' undeclared (first use in this  
>> function)
>> make: *** [start_tasks.o] Error 1
>>
>> (The line number may be one off because I added a define to work  
>> around
>> this; for this output, I commented that define out)
>>
>> There was also this warning
>>
>> gcc -g -O2 -Wall -W -Wpointer-arith -Wwrite-strings -Wcast-align
>> -Wcast-qual -Wbad-function-cast -Wundef -Wmissing-prototypes
>> -Wmissing-declarations -Wnested-externs -I/usr/local/torque-2.1.7/ 
>> include
>> -c util.c
>> util.c: In function `debug':
>> util.c:106: warning: passing arg 1 of `localtime' from  
>> incompatible pointer
>> type
>>
>> Here's uname on the system:
>> [turing-2:~/mpiexec-0.83] wgropp% uname -a
>> Darwin turing-2.turing.uiuc.edu 7.9.0 Darwin Kernel Version 7.9.0:  
>> Wed Mar
>> 30 20:11:17 PST 2005; root:xnu/xnu-517.12.7.obj~1/RELEASE_PPC  Power
>> Macintosh powerpc
>>
>> With my temporary fix, mpiexec worked great!  Thanks.
>
> Thanks for the nice bug report.  Here are the fixes I'm thinking
> about applying.  The uint32_t one should be pretty straightforward,
> but I still don't understand mac time_t, as can be observed from an
> earlier comment in there.  The util.c warning fix thus may not
> actually fix the warning; not like that code ever gets called anyway.
>
> If you feel like giving this your stamp of approval, that would
> help.  They removed the last remaining macs from my site.  Otherwise
> I'll check it in eventually, guessing it won't make things worse at
> least.
>
> 		-- Pete
>
> Index: start_tasks.c
> ===================================================================
> --- start_tasks.c	(revision 418)
> +++ start_tasks.c	(working copy)
> @@ -17,6 +17,7 @@
>  #include <fcntl.h>
>  #include <errno.h>
>  #include <pwd.h>
> +#include <sys/types.h>  /* uint32_t */
>  #include <sys/time.h>
>  #include <signal.h>
>  #include <netdb.h>  /* gethostbyname for portals */
> Index: util.c
> ===================================================================
> --- util.c	(revision 418)
> +++ util.c	(working copy)
> @@ -102,8 +102,11 @@ debug(int level, const char *fmt, ...)
>  	    /* add a timestamp to debug messages */
>  	    struct timeval tv;
>  	    char buf[20];
> +	    time_t timet;
> +
>  	    gettimeofday(&tv, NULL);
> -	    strftime(buf, 10, "[%H:%M:%S", localtime(&tv.tv_sec));
> +	    timet = tv.tv_sec;  /* mac time_t different from __time_t */
> +	    strftime(buf, 10, "[%H:%M:%S", localtime(&timet));
>  	    sprintf(buf+9, ".%06ld] ", (long) tv.tv_usec);  /* cast for  
> mac */
>  	    fputs(buf, stderr);
>  	}
>

William Gropp
Paul and Cynthia Saylor Professor of Computer Science
University of Illinois Urbana-Champaign



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://email.osc.edu/pipermail/mpiexec/attachments/20080325/e4d6f46f/attachment.htm


More information about the mpiexec mailing list