Skip to content

Fails to compile with icc #269

@certik

Description

@certik

I tried to build using Intel icc version 19.1.0.20191121 and the cmake succeeds to run:

$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/builds/certik/truchas/scratch/python-install ../python-cmake-buildsystem
-- The C compiler identification is Intel 19.1.0.20191121
-- The ASM compiler identification is Intel
-- Found assembler: /opt/intel/bin/icc
-- Check for working C compiler: /opt/intel/bin/icc
-- Check for working C compiler: /opt/intel/bin/icc -- works
-- Detecting C compiler ABI info
...
-- Configuring done
-- Generating done
-- Build files have been written to: /builds/certik/truchas/scratch/python-build

But when I run make, it fails:

$ make -j8
...
[ 31%] Building C object CMakeBuild/libpython/CMakeFiles/pgen.dir/builds/certik/truchas/scratch/Python-3.6.7/Parser/grammar.c.o
/builds/certik/truchas/scratch/Python-3.6.7/Parser/grammar.c(37): error: expected an expression
          for (int j = 0; j < g->g_dfa[i].d_nstates; j++)
               ^
/builds/certik/truchas/scratch/Python-3.6.7/Parser/grammar.c(37): error: identifier "j" is undefined
          for (int j = 0; j < g->g_dfa[i].d_nstates; j++)
                          ^
compilation aborted for /builds/certik/truchas/scratch/Python-3.6.7/Parser/grammar.c (code 2)
make[2]: *** [CMakeBuild/libpython/CMakeFiles/pgen.dir/builds/certik/truchas/scratch/Python-3.6.7/Parser/grammar.c.o] Error 2

It looks like the icc compiler does not allow to define variables inside the for loop.

I don't know if icc is supported, but if not, then I would expect cmake to error out sooner. It might also be possible to fix the failures with a patch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions