# Can't build paraview on linux

**URL:** https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565
**Category:** ParaView Support
**Created:** [December 4, 2021, 10:51pm UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565 "2021-12-04T22:51:33Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![Alexander](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexander/32/8119_2.png) [@Alexander](https://discourse.paraview.org/u/Alexander)
#### Post date: [December 4, 2021, 10:51pm UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/1 "2021-12-04T22:51:33Z")

</div>

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:

```auto
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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 7, 2021, 11:19am UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/2 "2021-12-07T11:19:04Z")

</div>

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

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [December 7, 2021, 11:29am UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/3 "2021-12-07T11:29:35Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Alexander](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexander/32/8119_2.png) [@Alexander](https://discourse.paraview.org/u/Alexander)
#### Post date: [December 7, 2021, 5:03pm UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/4 "2021-12-07T17:03:29Z")

</div>

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:

```auto
[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

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [December 7, 2021, 5:07pm UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/5 "2021-12-07T17:07:42Z")

</div>

looks like a different issue.

---

<div class="post-metadata">

### Author: ![Alexander](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexander/32/8119_2.png) [@Alexander](https://discourse.paraview.org/u/Alexander)
#### Post date: [December 7, 2021, 6:23pm UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/6 "2021-12-07T18:23:08Z")

</div>

I think there were two problems:

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

```

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

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [December 8, 2021, 8:26am UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/7 "2021-12-08T08:26:19Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Alexander](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexander/32/8119_2.png) [@Alexander](https://discourse.paraview.org/u/Alexander)
#### Post date: [December 8, 2021, 9:16am UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/8 "2021-12-08T09:16:02Z")

</div>

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

```auto
[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?

---

<div class="post-metadata">

### Author: ![timothee.chabat](https://discourse.paraview.org/user_avatar/discourse.paraview.org/timothee.chabat/32/5729_2.png) [@timothee.chabat](https://discourse.paraview.org/u/timothee.chabat)
#### Post date: [December 8, 2021, 9:47am UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/9 "2021-12-08T09:47:30Z")

</div>

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](https://en.cppreference.com/w/cpp/container/vector/insert)).

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](https://stackoverflow.com/questions/18583134/list-insert-returns-void-for-c11-why) for a similar issue).

---

<div class="post-metadata">

### Author: ![Alexander](https://discourse.paraview.org/user_avatar/discourse.paraview.org/alexander/32/8119_2.png) [@Alexander](https://discourse.paraview.org/u/Alexander)
#### Post date: [December 8, 2021, 10:45pm UTC](https://discourse.paraview.org/t/cant-build-paraview-on-linux/8565/10 "2021-12-08T22:45:42Z")

</div>

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