Can't build paraview on linux

Hello, i’m installing paraview v 5.10-RC2 from source on scientific linux. Cmake is done, but when I make i have the following output:

In file included from /home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx:15:0:
/home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.h: In function «{anonymous}::HitCellInfo {anonymous}::ProcessLimitPoint(vtkVector3d, vtkVector3d, int, vtkDataSet*, vtkAbstractCellLocator*, double)»:
/home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.h:193:7: error: «int vtkProbeLineFilter::SamplingPattern» is protected
   int SamplingPattern;
       ^
/home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx:176:43: error: in this context
   else if (pattern == vtkProbeLineFilter::SamplingPattern::SAMPLE_LINE_AT_CELL_BOUNDARIES)
                                           ^
/home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx:176:43: error: «vtkProbeLineFilter::SamplingPattern» is not a class, namespace, or enumeration
/home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx: In the member function «vtkSmartPointer<vtkPolyData> vtkProbeLineFilter::SampleLineAtEachCell(const std::vector<vtkDataSet*>&, double) const»:
/home/lib/ParaView-v5.10.0-RC2/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx:535:112: error: «void prevEnd» has incomplete type
     auto prevEnd = intersections.insert(intersections.end(), distIntersections.begin(), distIntersections.end());
                                                                                                                ^
make[2]: *** [VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/vtkProbeLineFilter.cxx.o] error 1
make[1]: *** [VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/all] Ошибка 2
make: *** [all] error 2

What should I do? Thanks

@timothee.chabat @cory.quammen : looks like an actual issue, should be fixed asap.

Indeed there’s a name conflict that wasn’t catch by the CI, this error might depdns of the compiler version you use. If you compile ParaView yourself you can replace vtkProbeLineFilter::SamplingPattern::SAMPLE_LINE_AT_CELL_BOUNDARIES by vtkProbeLineFilter::SAMPLE_LINE_AT_CELL_BOUNDARIES and this should do the trick.

I will open an MR in the next hours.

I replaced in vtkProbeLineFilter.cx vtkProbeLineFilter::Sampling Pattern::SAMPLE_LINE_AT_ALL_BOUNDARIES by vtkProbeLineFilter::SAMPLE_LINE_AT_CELL_BOUNDARIES , but it didn’t help. I didn’t cmake again, should I? Output:

[ 20%] Building CXX object VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/vtkProbeLineFilter.cxx.o
/home/lib/ParaView-v5.10.0-RC1/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx: In function member «vtkSmartPointer<vtkPolyData> vtkProbeLineFilter::SampleLineAtEachCell(const std::vector<vtkDataSet*>&, double) const»:
/home/lib/ParaView-v5.10.0-RC1/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx:528:112: error: «void prevEnd» has incomplete type
     auto prevEnd = intersections.insert(intersections.end(), distIntersections.begin(), distIntersections.end());
                                                                                                                ^
make[2]: *** [VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/vtkProbeLineFilter.cxx.o] Error 1
make[1]: *** [VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/all] Ошибка 2
make: *** [all] error 2

Compiler and make versions: gcc (GCC) 4.8.5, GNU Make 3.82

looks like a different issue.

I think there were two problems:

else if (pattern == vtkProbeLineFilter::SamplingPattern::SAMPLE_LINE_AT_CELL_BOUNDARIES)

and problem with prevEnd. First is solved. Maybe I should use different compiler version?

Well a more recent compiler would definitely resolve the problem but if I remember correctly VTK is supposed to support gcc 4.8 + and so should ParaView.

intersections is of type std::vector<HitCellInfo>, and HitCellInfo is defined in an anonymous namespace on the upper part of the file. My quick guess would be to move HitCellInfo out of the anonymous namespace. You could also explicitely replace auto by std::vector<HitCellInfo>::iterator. Other than that I do not have any idea. Ifyou could try that would be great ! Otherwise I’ll install an old version of gcc and debug when I have some time.

I replaced auto by std::vector<HitCellInfo>::iterator, but it didn’t work:

[ 20%] Building CXX object VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/vtkProbeLineFilter.cxx.o
/home/lib/ParaView-v5.10.0-RC1/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx: In function member «vtkSmartPointer<vtkPolyData> vtkProbeLineFilter::SampleLineAtEachCell(const std::vector<vtkDataSet*>&, double) const»:
/home/lib/ParaView-v5.10.0-RC1/VTK/Filters/ParallelDIY2/vtkProbeLineFilter.cxx:527:142: error: conversion from "void" to non-scalar type requested «std::vector<{anonymous}::HitCellInfo>::iterator {aka __gnu_cxx::__normal_iterator<{anonymous}::HitCellInfo*, std::vector<{anonymous}::HitCellInfo> >}»
     std::vector<HitCellInfo>::iterator prevEnd = intersections.insert(intersections.end(), distIntersections.begin(), distIntersections.end());
                                                                                                                                              ^
make[2]: *** [VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/vtkProbeLineFilter.cxx.o] Error 1
make[1]: *** [VTK/Filters/ParallelDIY2/CMakeFiles/FiltersParallelDIY2.dir/all] Error 2
make: *** [all] Error 2

I didn’t understand how to move HitCellInfo out of the anonymous namespace. Could you please write how to do that?

Ok error is much clearer now. Anonymous namespace has nothing to do with it, I think it is because you do not compile using c++11. Here we can see it complains about not beeing able to convert void to iterator and std::vector::insert returns void until C++11 (see std::vector<T,Allocator>::insert - cppreference.com).

Try adding -std=c++11 to your CMAKE_CXX_FLAGS.

If it’s still not working I would suspect that your lib std has some issue and that you need to update your system (see gcc - list insert returns void for c++11, why? - Stack Overflow for a similar issue).

Adding -std=c++11 to CMAKE_CXX_FLAGS and updating compiler helped, thanks a lot!

1 Like