Passing macro definitions (strings) to mpicc/mpicxx seems broken

Passing macro definitions (strings) to mpicc/mpicxx seems broken

UPDATE: I have been hasty. I do not have a fix. Leaving the mpicc and mpicxx scripts alone but using mpiicc and mpiicpc seems to work. Apologies for going off half-cocked.


I just had a report from a user about passing macro definitions via the -D commandline argument to mpicxx. The test source file included at the end of this message. I can confirm his findings.

The product being used is Intel Cluster Studio XE 2012: icc (ICC) 12.1.0 20110811

The compile line is:


[NB - the text input here strips backslashes, so I've used [BACKSLASH] to indicate the single character backslash ]

which gives this error:

icpc: error #10236: File not found: '"'
icpc: error #10236: File not found: 'HI"'
macrotest.cpp(5): error: missing closing quote
"Macro 2 " TESTMACRO2 "\\n"

macrotest.cpp(6): error: missing closing quote
"Macro 3 " TESTMACRO3

compilation aborted for macrotest.cpp (code 2)
make: *** [macrotest.o] Error 1

The exact same source file and commandline arguments work with other MPI implementations including openmpi-1.5.3-3 on RHEL6. The problem seems to stem from the way the mpicc and mpicxx scripts handle the arguments.

Thanks for your attention,
Dave Chin

============= macrotest.cpp =====================

const char* macrotest() {
"Macro 1 " TESTMACRO1 "\\n"
"Macro 2 " TESTMACRO2 "\\n"
"Macro 3 " TESTMACRO3

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Dave,

Thank you for the defect report. I have submitted this internally. As far as the fix you had posted, I will remove that from the defect report when it is available.

James Tullos
Technical Consulting Engineer
Intel Cluster Tools

Thanks, James. Much obliged.

Leave a Comment

Please sign in to add a comment. Not a member? Join today