cxx compiler suggests "use quotes instead": compile option to not distinguish between quotes and angles?

93 Views Asked by At

I use an mpicc compiler from openmpi 4.1.5 to compile my source files on an ubuntu system.

My source code consists of a single line of code -- a header to a third-party library called deal.II:

//step-1.cc
#include <deal.II/grid/tria.h>

int main()
{
   return 0;
}

I use a very simple CMakeLists.txt to link my executable against deal.II. Everything works, but now I want to use the tool include-what-you-use include-what-you-use. I pass the include-what-you-use binaries to cmake as

cmake -DCMAKE_INCLUDE_WHAT_YOU_USE = /path_to_iwyu_executable ..

I can then compile my program by calling make. Then, I get the following error

Error running '/calculate/simon/software/iwyu/build/bin/include-what-you-use': warning: unknown warning option '-Wno-placement-new' [-Wunknown-warning-option]
warning: unknown warning option '-Wno-literal-suffix'; did you mean '-Wno-literal-range'? [-Wunknown-warning-option]
warning: unknown warning option '-Wno-class-memaccess'; did you mean '-Wno-class-varargs'? [-Wunknown-warning-option]
In file included from /calculate/dealii-9.4.0/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/dealii-9.4.0-kxrbkaijxclrdrwwu5bxlavjzueiierv/share/deal.II/examples/step-1/step-1.cc:4:
In file included from /calculate/dealii-9.4.0/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/dealii-9.4.0-kxrbkaijxclrdrwwu5bxlavjzueiierv/include/deal.II/grid/tria.h:20:
/calculate/dealii-9.4.0/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/dealii-9.4.0-kxrbkaijxclrdrwwu5bxlavjzueiierv/include/deal.II/base/config.h:540:12: error: 'mpi.h' file not found with <angled> include; use "quotes" instead
#  include <mpi.h>
           ^

However, the file <mpi.h> is in the same directory as

/calculate/dealii-9.4.0/opt/spack/linux-ubuntu22.04-skylake/gcc-12.3.0/dealii-9.4.0-kxrbkaijxclrdrwwu5bxlavjzueiierv/include/deal.II/base/config.h

which is obviously found by include-what-you-use. So it is clear to me why config.h is found and mpi.h not, although both are in the same directory.

0

There are 0 best solutions below