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.

Hi,

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:

mpicxx -DTESTMACRO1="[BACKSLASH]"ABC[BACKSLASH]"" -DTESTMACRO2="[BACKSLASH]"CDE [BACKSLASH]"" -DTESTMACRO3="[BACKSLASH]"FG HI[BACKSLASH]"" -c macrotest.cpp

[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() {
return
"Macro 1 " TESTMACRO1 "\\n"
"Macro 2 " TESTMACRO2 "\\n"
"Macro 3 " TESTMACRO3
;
}

publicaciones de 3 / 0 nuevos
Último envío
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.

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.

Sincerely,
James Tullos
Technical Consulting Engineer
Intel Cluster Tools

Thanks, James. Much obliged.

Deje un comentario

Por favor inicie sesión para agregar un comentario. ¿No es socio? Únase ya