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.

Thanks,

Kyle

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.

Ben,

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

-I/home/bentleykw/src/SupportPackages/build/vtk/src/vtk/ThirdParty/pegtl/vtkpegtl/include

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

${CMAKE_CURRENT_BINARY_DIR}/ThirdParty/pegtl/vtkpegtl/include

I’m building with the cmake flags

 -DCMAKE_PREFIX_PATH=<INSTALL_DIR>
	    -DCMAKE_MODULE_PATH=${CMAKE_SOURCE_DIR}/cmake
	    -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR>	
	    -DCMAKE_INSTALL_LIBDIR=lib		
	    -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
	    -DBUILD_STATIC_LIBS=FALSE
	        -DBUILD_SHARED_LIBS=TRUE	
		-DVTK_BUILD_DOCUMENTATION=FALSE
		-DVTK_USE_EXTERNAL=ON
		-DVTK_FORBID_DOWNLOADS=TRUE
		-DVTK_MODULE_USE_EXTERNAL_VTK_libharu=FALSE
		-DVTK_MODULE_USE_EXTERNAL_VTK_gl2ps=FALSE

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.

Thanks,

Kyle

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
target_compile_features(pegtl
  INTERFACE
cxx_std_11)

# 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).