Compilation errors related to PEGTL / Proj

Hi all,

I’ve nearly got VTK compiling with most of the ThirdParty packages turned off. There’s a few errors that are keeping me from 100%, and I’m open to ideas on how to move past them.

The first is encountered in the IOMotionFX code. ThirdParty/pegtl/vtk_pegtl.h claims it can’t find ThirdParty/pegtl/vtk_pegtl.h. PEGTL is correctly found earlier in the process, and the include/library is set in the cache, so I’m sure it’s there, and available.

ThirdParty/pegtl/vtk_pegtl.h:22:23: fatal error: tao/pegtl/contrib/tracer.hpp: No such file or directory

22 | # define VTK_PEGTL(x) <tao/x>

The other error stems from the external libproj module. A similar error -

ThirdParty/libproj/vtk_libproj.h:38:11: fatal error: proj_api.h: No such file or directory

38 | # include <proj_api.h>
| ^~~~~~~~~~~~

Again, the proj include/lib is set in the cache, and this one seems internal to the libproj directory itself.

Before I start digging into the CMake myself I thought I’d see if this had popped up before.



I’m narrowing the errors down to what I suspect are a few misplaced properties on targets. In the IOMotionFX.dir directory I can edit the link.txt file to add the path

-IThirdParty/pegtl/vtkpegtl/include to the CXX_FLAGS inside the flags.txt and the IOMotionFX module builds fine.

Hmm. We do test one CI run with external packages (including pegtl and proj) and they work fine. Are you using master or 9.0.1?

I’m using the 9.0.1 from the release page on github. I can try master to see fi that resolves anything. Has there been a lot of time between that tag and HEAD?

It’ll be one year in 20 days.

I’ve got master checkout and and building now. I’ll report back in a bit.

Thanks for all the help so far.


Master seemed to build fine, save for that one include. I’m building it as an external package, and here was the failure in the build-err.log

In file included from /home/bentleykw/src/SupportPackages/build/vtk/src/vtk/IO/MotionFX/vtkMotionFXCFGGrammar.h:22,
             from /home/bentleykw/src/SupportPackages/build/vtk/src/vtk/IO/MotionFX/vtkMotionFXCFGReader.cxx:40:
/home/bentleykw/src/SupportPackages/build/vtk/src/vtk-build/ThirdParty/pegtl/vtk_pegtl.h:22:23: fatal error: tao/pegtl/contrib/tracer.hpp: No such file or directory
 # define VTK_PEGTL(x) <tao/x>

the solution I found was to add


to the end of /home/bentleykw/src/SupportPackages/build/vtk/src/vtk-build/IO/MotionFX/CMakeFiles/IOMotionFX.dir/flags.make, which I believe translates to


I’m building with the cmake flags


I still think there’s probably a target or include directory that’s missing or misplaced in the IO/MotionFX dir somewhere, but that gets me going. All other dependencies are local.



Just to add a little bit more, in the ThirdParty/vtkpegtl CMakeListst.txt, the comment below raises a little suspicion as to why it’s not finding the headers.

# features used by the PEGTL

# Not installing headers explicitly. This is not meant to be part of the VTK API.

It only answers it if the code trying to use it is outside of VTK. If that’s the case, yes, pegtl is not a public third party dependency of VTK. If it is code inside of VTK that is failing, something else is going wrong (though it works just fine in our CI with an external pegtl).