# Failed to build in Ubuntu 20.04 (Qt-5.12.8)

**URL:** <https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811>\
**Category:** Development\
**Created:** [September 22, 2021, 4:53pm UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811 "2021-09-22T16:53:58Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [September 22, 2021, 4:53pm UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/1 "2021-09-22T16:53:59Z")

</div>

Dear concern,

While trying to build Slicer in Ubuntu 20.04 following the instructions mentioned, (13 hours later) I got the following error message (make: Target ‘default\_target’ not remade because of errors. Please find attached the error.  
Note: I am using Qt 5.12.8 not 5.15.1.  
Can anyone kindly assist me solving this issue?

 ![terminal_error](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/d/bdc626f3f305a2cc10029300b2772acec5eca555.png)

Thanks in advance.

---

<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:** [September 22, 2021, 9:20pm UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/2 "2021-09-22T21:20:05Z")

</div>

Did you make any code changes or changes to the cmake options or did you build with the defaults? I have built with 20.04 from scratch many times, most recently about a month ago with no problems.

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [September 23, 2021, 7:34am UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/3 "2021-09-23T07:34:42Z")

</div>

I didn’t make any changes in the code. I was just following the instructions to build for the first time.

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [September 23, 2021, 2:52pm UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/4 "2021-09-23T14:52:08Z")

</div>

I have just built Slicer (master branch) successfully on a fresh Ubuntu 20.04 (VirtualBox). The only issue I experienced was the one mentioned [here](https://github.com/Slicer/Slicer/issues/5498#issuecomment-795860350), which can be solved installing `python3-dev`; but this does not look to be the problem here.

Sometimes I have experienced unexplainable linking errors in two situations: (1) hardware is very (very) old; and (2) if I try to continue building Slicer **after a previous abnormal and abrupt interruption of the building process** (e.g., losing power, hard resetting the machine, etc). In case (2) you can clean with `make clean` or even delete your build directory and re-build again from scratch.

I hope this helps.

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [September 24, 2021, 3:47pm UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/5 "2021-09-24T15:47:07Z")

</div>

Dear Rafael Palomar,  
Thank you very much for responding. Yes, you’re right. Previously there was an interruption while building it and later it threw the mentioned error.  
Now, I have rebuilt it from scratch and everything is fine.  
(Although it took a long time to build even after using ‘make -j5 -k’ (about 26 hours). I once wished If I could pause the process for a while. :-))

---

<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:** [September 26, 2021, 4:32am UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/6 "2021-09-26T04:32:12Z")

</div>

> [@ZakiaKhatun](#):
>
> it took a long time to build even after using ‘make -j5 -k’ (about 26 hours)

For reference, we recently got a new desktop computer with an above average but not extreme configuration (Intel Core i9-10900X CPU, 64GB RAM, NVMe SSD; running Ubuntu 20.04) and the **entire Slicer build is completed in 30 minutes** (completely from scratch, including building VTK and all its dependencies, using `make -j20`).

Windows builds take longer. On a 3-year old desktop the build takes about 3-4 hours, on a laptop it takes about a half day to a day.

---

<div class="post-metadata">

**Author:** ![RafaelPalomar](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/rafaelpalomar/32/1436_2.png) [@RafaelPalomar](https://discourse.slicer.org/u/RafaelPalomar)\
**Post date:** [September 27, 2021, 6:24am UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/7 "2021-09-27T06:24:10Z")

</div>

@ZakiaKhatun, as @lassoan points out 3D Slicer does not take that long to build. Your elevated build times indicate that you may be getting out of RAM memory (how much do you have?). The more jobs you spawn to build Slicer (e.g, -j5) the more RAM you need to keep the build process; after using all your RAM your OS will try to use swap memory which is allocated in your SDD/HDD. In that case, just the memory transfers will contribute to such long building times. This behaviour is easy to observe because it makes your computer looking completely unresponsive.

If that is your case, lower your -j parameter to 1 or 2, which should bring your building times down to the range @lassoan points out.

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [September 28, 2021, 10:01am UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/8 "2021-09-28T10:01:54Z")

</div>

My laptop’s configuration is Intel Core i5-4200M (4th Gen), 2.5GHz, 12GB RAM (8 years old). I am using Ubuntu 20.04 in dual boot with windows.

---

<div class="post-metadata">

**Author:** ![ZakiaKhatun](https://avatars.discourse-cdn.com/v4/letter/z/df705f/32.png) [@ZakiaKhatun](https://discourse.slicer.org/u/ZakiaKhatun)\
**Post date:** [September 28, 2021, 10:12am UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/9 "2021-09-28T10:12:38Z")

</div>

Also, even though the build was successful, some of the tests fail (ctest -j4). Any idea why they fail?

Please find attached a screenshot of the failure.

 ![Test_error](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/d/dd2722c358cb4b890900abd9c7496d9fca6d7687.png)

After running --rerun-failed --output-on-failure command, it didn’t solve the problem.

 ![rerun_fails](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/6/b630e716ee2858dcac2e8c9af4c1276a65f10ae1.png)

---

<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:** [September 28, 2021, 1:31pm UTC](https://discourse.slicer.org/t/failed-to-build-in-ubuntu-20-04-qt-5-12-8/19811/10 "2021-09-28T13:31:15Z")

</div>

> [@ZakiaKhatun](#):
>
> My laptop’s configuration is Intel Core i5-4200M (4th Gen), 2.5GHz, 12GB RAM (8 years old). I am using Ubuntu 20.04 in dual boot with windows.

It is a wonder that Slicer can be built and runs on this computer at all. We only aim for compatibility with hardware that was released in the past 5 years.

> [@ZakiaKhatun](#):
>
> even though the build was successful, some of the tests fail (ctest -j4). Any idea why they fail?

You can find the status of tests on official builds on the [dashboard](https://slicer.cdash.org/index.php?project=SlicerPreview). If you don’t have any additional test failures than the tests listed there then you don’t need to do anything about it. Those tests did not reveal any critical errors and we are already working on making them pass again.
