Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
9 Views

Intel MPI compiler wrapper wrongly strips off quotation marks

This bug pertains to the Intel MPI compiler wrapper (mpiifort, perhaps
also mpiicc) incorrectly stripping off already-quoted quote
characters.

Background:
I recently found that Intel MPI compiler wrapper (compiler suite
version 17.4.196) fails to compile nwchem 5.1.1 properly due to a bug
in the "mpiifort" wrapper. This also affects "mpiicc" for an obvious
reason.

Here is a test case that simulates that problem--no need to get nwchem
version 5.1.1 (file: helloworld.F90)

    program helloworld
      character(*), parameter :: msg = MESSAGE
      write(*,*) "hello, world"
      write(*,*) "My message is: ", msg
    end program helloworld

This program takes as it argument a macro called "MESSAGE", which must
include the Fortran-recognizable quotation marks
(The same case was found somewhere in nwchem source code.)

Here's the compile session:

** GFORTRAN **

    [wpurwant@coreV4-21-019 cmdline-error]$ gfortran -DMESSAGE="'greetings'" helloworld.F90  -o helloworld.gfortran
    [wpurwant@coreV4-21-019 cmdline-error]$ ./helloworld.gfortran
     hello, world
     My message is: greetings


** IFORT **

    [wpurwant@coreV4-21-019 cmdline-error]$ which ifort
    /cm/shared/applications/icc/17.2/compilers_and_libraries_2017.2.174/linux/bin/intel64/iort

    [wpurwant@coreV4-21-019 cmdline-error]$ ifort -DMESSAGE="'greetings'" helloworld.F90  -o helloworld.ifort
    [wpurwant@coreV4-21-019 cmdline-error]$ ./helloworld.ifort
     hello, world
     My message is: greetings


** MPIIFORT **

    [wpurwant@coreV4-21-019 cmdline-error]$ mpiifort -DMESSAGE="'greetings'" helloworld.F90  -o helloworld.mpiifort
    helloworld.F90(2): error #6592: This symbol must be a defined parameter, an enumerator, or an argument of an inquiry function that evaluates to a compile-time constant.   [GREETINGS]
      character(*), parameter :: msg = greetings
    -----------------------------------^
    compilation aborted for helloworld.F90 (code 1)


    Newest version of ifort still shows the same problem.

    [wpurwant@coreV4-21-019 cmdline-error]$ module unload intel; module load intel/17.4
    [wpurwant@coreV4-21-019 cmdline-error]$ which ifort
    /cm/shared/applications/icc/17.4/compilers_and_libraries_2017.4.196/linux/bin/intel64/ifort
    [wpurwant@coreV4-21-019 cmdline-error]$ mpiifort -DMESSAGE="'greetings'" helloworld.F90  -o helloworld.mpiifort
    helloworld.F90(2): error #6592: This symbol must be a defined parameter, an enumerator, or an argument of an inquiry function that evaluates to a compile-time constant.   [GREETINGS]
      character(*), parameter :: msg = greetings
    -----------------------------------^
    compilation aborted for helloworld.F90 (code 1)


Version info:

    [wpurwant@coreV4-21-019 cmdline-error]$ mpirun  -version
    Intel(R) MPI Library for Linux* OS, Version 2017 Update 3 Build 20170405 (id: 17193)
    Copyright (C) 2003-2017, Intel Corporation. All rights reserved.

    [wpurwant@coreV4-21-019 cmdline-error]$ mpiifort -V
    Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.4.196 Build 20170411
    Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.

    [wpurwant@coreV4-21-019 cmdline-error]$ ifort -V
    Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.4.196 Build 20170411
    Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.


Calling the compiler drivers (gfortran and ifort) directly for the
compilation is fine.
But mpiifort compilation failed because the inner quote characters get
peeled off where they should not have been.
This is a simple problem for the mpiifort/mpiicc wrapper scripts--they
should be fixed to correctly account for quoted quotation marks.

 

0 Kudos