idaholab / moose

Multiphysics Object Oriented Simulation Environment
https://www.mooseframework.org
GNU Lesser General Public License v2.1
1.67k stars 1.03k forks source link

MooseDocs clang handling fails with clang 5 #10622

Closed brianmoose closed 6 years ago

brianmoose commented 6 years ago

Rationale

Documentation fails to build

Description

python: /tmp/moose_package_build_temp/llvm/llvm/tools/clang/lib/AST/Decl.cpp:2279: bool clang::VarDecl::checkInitIsICE() const: Assertion `!Init->isValueDependent()' failed.
libclang: crash detected during parsing: {
  'source_filename' : '/opt/civet/build_0/moose/framework/src/kernels/Diffusion.C'
  'command_line_args' : ['clang', '-x', 'c++', '-std=c++11', '-I/opt/civet/build_0/moose/framework/build/header_symlinks', '-I/opt/civet/build_0/moose/framework/contrib/boost/include', '-I/opt/civet/build_0/moose/framework/contrib/jsoncpp/include', '-I/opt/civet/build_0/moose/framework/contrib/jsoncpp/include/json', '-I/opt/civet/build_0/moose/framework/contrib/mtwist/include', '-I/opt/civet/build_0/moose/framework/contrib/pcre/include', '-I/opt/civet/build_0/moose/framework/contrib/tinydir/include', '-I/opt/civet/build_0/moose/framework/contrib/gtest', '-I/opt/civet/build_0/moose/framework/contrib/hit', '-I/opt/civet/build_0/moose/scripts/../libmesh/installed/include', '-I/opt/moose/VTK-7.1.0/clang-5.0.0/include/vtk-7.1', '-I/opt/moose/tbb44_20150728/include', '-I/opt/moose/petsc-3.7.6/mpich-3.2_clang-5.0.0-opt/include', '-I/opt/moose/petsc-3.7.6/mpich-3.2_clang-5.0.0-opt//include', '-I/opt/moose/miniconda/include', '-I/opt/civet/build_0/moose/modules/chemical_reactions/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/contact/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/fluid_properties/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/rdg/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/heat_conduction/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/misc/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/navier_stokes/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/tensor_mechanics/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/phase_field/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/richards/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/solid_mechanics/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/stochastic_tools/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/water_steam_eos/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/xfem/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/porous_flow/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/level_set/build/header_symlinks', '-I/opt/civet/build_0/moose/modules/combined/build/header_symlinks', '-I/opt/civet/build_0/moose/scripts/../libmesh/installed/include', '-I/opt/moose/VTK-7.1.0/clang-5.0.0/include/vtk-7.1', '-I/opt/moose/tbb44_20150728/include', '-I/opt/moose/petsc-3.7.6/mpich-3.2_clang-5.0.0-opt/include', '-I/opt/moose/petsc-3.7.6/mpich-3.2_clang-5.0.0-opt//include', '-I/opt/moose/miniconda/include'],
  'unsaved_files' : [],
  'options' : 0,
}
python: /tmp/moose_package_build_temp/llvm/llvm/tools/clang/lib/Parse/Parser.cpp:432: virtual clang::Parser::~Parser(): Assertion `TemplateIds.empty() && "Still alive TemplateIdAnnotations around?"' failed.

Also causes one of the MooseDocs tests to fail.

Impact

Get documentation building again.

brianmoose commented 6 years ago

Seems to work on my mac, so this appears to be linux only

brianmoose commented 6 years ago

So I narrowed it down, the following code will cause the clang python bindings to generate the error:

#include <complex>
#include <mpi.h>
#include <iomanip>

This is with using -std=c++11. The error doesn't occur when that flag isn't present.

Not including any 1 of them will cause the clang python parser to work, or reordering them causes it to work.

This sequence of includes showed up in a sequence of libmesh headers. @permcody Do you want to roll back the new package?

brianmoose commented 6 years ago

Just to be able to check this in the future, writing the above 3 lines into a file bad.C. Then: python /opt/moose/llvm-5.0.0/bindings/python/examples/cindex/cindex-dump.py bad.C -std=c++11 produces the error.