# Building SLicer 4.10.0 from source on Ubuntu 18.04

**URL:** <https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521>\
**Category:** Support\
**Created:** [October 24, 2018, 9:57pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521 "2018-10-24T21:57:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 24, 2018, 9:57pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/1 "2018-10-24T21:57:39Z")

</div>

Slicer 4.10.0 with Qt4.8 and VTK 7 is built from source successfully on Ubuntu 18.04 but I had to add this line to the main CMakeList.txt file due to some error related to c11 support.

```
 set (CMAKE_CXX_STANDARD 11)

```

after these two lines

```
 set(_msg "Setting C++ standard")
 message(STATUS "${_msg}")
```

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 28, 2018, 12:59pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/2 "2018-10-28T12:59:28Z")

</div>

One more thing:

I am not CMake expert but there should be some restriction about building priorities. When I use

```
       make -j 8

```

The build stop with error. It would be nice to arrange this so one can benefit from parallel build.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [October 28, 2018, 2:16pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/3 "2018-10-28T14:16:23Z")

</div>

> [@brhoom](#):
>
> The build stop with error

What is the error? Parallel build should work (it is not managed by setting priorities but setting correct dependencies between build targets).

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [October 28, 2018, 3:21pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/4 "2018-10-28T15:21:50Z")

</div>

> [@brhoom](#):
>
> so one can benefit from parallel build

Parallel build does work. I usually build with -j12 on Arch (nproc x 2, good or bad).

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 28, 2018, 3:29pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/5 "2018-10-28T15:29:04Z")

</div>

I am doing a new parallel build now i.e. -j 8. I am using Qt5 and VTK 8, as soon as I get an error, I will report it here.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 28, 2018, 3:34pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/6 "2018-10-28T15:34:34Z")

</div>

Yes, parallel builds work fine, but often the actual build error is hard to see because other build output causes it to scroll offscreen. In this case I often use a command like `make -j20; make` so the actual error shows up efficiently.

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [October 28, 2018, 3:59pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/7 "2018-10-28T15:59:39Z")

</div>

> [@pieper](#):
>
> a command like `make -j20; make` so the actual error shows up efficiently.

I usually redirect stderr to a timestamped log file :

> nice -n19 make Slicer -j12 2\> ~/tmp/slicer\_build\_err\_$(date +%F\_%H%M%S).log

Build errors are easily tracked this way.

Just a suggestion.

---

<div class="post-metadata">

**Author:** ![brhoom](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/brhoom/32/1228_2.png) [@brhoom](https://discourse.slicer.org/u/brhoom)\
**Post date:** [October 28, 2018, 7:07pm UTC](https://discourse.slicer.org/t/building-slicer-4-10-0-from-source-on-ubuntu-18-04/4521/8 "2018-10-28T19:07:11Z")

</div>

Thanks for the tips. The build just completed without error. It seems the previous one had some strange problem. Next step, test building on Windows 10.
