Find out the c preprocessor of the Compaq C compiler and try to obtain its output of parsed C source file.

On 11/15/2007 10:12 AM, [EMAIL PROTECTED] wrote:
I have had some success reproducing the event with a simple c program and the issue appears to be with the in-house mpicc wrapper script. The difference between gcc and mpicc appears limited to strings (-D=\"string\") and does not show up in numerical form (e.g. -D=4)

I'll post another update when the issue is resolved.

Chris.

In the following examples cc is the same as mpicc (they both point to a script called 'compile') but mpicc invokes slightly different linking options than cc

$ cat prog.c
#include <stdlib.h>
#include <stdio.h>

int main(int argn,char *args[]){
printf("The value of MYDEF is %s\n",MYDEF);
}

$ gcc prog.c -DMYDEF=\"aaa\" -o prog
$ prog
The value of MYDEF is aaa
$ cc prog.c -DMYDEF=\"aaa\" -o prog
cc: Error: prog.c, line 5: In this statement, "aaa" is not declared. (undeclared)
printf("The value of MYDEF is %s\n",MYDEF);
--------------------------------------^

###
However, when the defined value is a number, the problem dissapears:

$ cat prog_num.c
#include <stdlib.h>
#include <stdio.h>

int main(int argn,char *args[]){
printf("The value of MYDEF is %d\n",MYDEF);
}

$ gcc prog_num.c -DMYDEF=4 -o prog_num
$ prog_num
The value of MYDEF is 4
$ cc prog_num.c -DMYDEF=4 -o prog_num
$ prog_num
The value of MYDEF is 4

_______________________________________________
gmx-users mailing list    [email protected]
http://www.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at http://www.gromacs.org/search before posting! Please don't post (un)subscribe requests to the list. Use thewww interface or send it to [EMAIL PROTECTED]
Can't post? Read http://www.gromacs.org/mailing_lists/users.php



_______________________________________________
gmx-users mailing list    [email protected]
http://www.gromacs.org/mailman/listinfo/gmx-users
Please search the archive at http://www.gromacs.org/search before posting!
Please don't post (un)subscribe requests to the list. Use the www interface or send it to [EMAIL PROTECTED]
Can't post? Read http://www.gromacs.org/mailing_lists/users.php

Reply via email to