# Building on Mac 10.14 Mojave

**URL:** <https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554>\
**Category:** Development\
**Created:** [October 27, 2018, 10:12am UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554 "2018-10-27T10:12:42Z")\
**Posts on this page:** 14\
**Page:** 2

<div class="post-metadata">

**Author:** ![drouin-simon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/drouin-simon/32/258_2.png) [@drouin-simon](https://discourse.slicer.org/u/drouin-simon)\
**Post date:** [April 18, 2019, 8:49pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/21 "2019-04-18T20:49:50Z")

</div>

@pieper, @lassoan, @che85, @jcfr, does one of you have write access to the Slicer build instruction page [here](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions)? It would be nice to add a comment on the need to install the header package (`macOS_SDK_headers_for_macOS_10.14.pkg`) to build Slicer. `xcode-select --install` alone still doesn’t install the headers.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 18, 2019, 9:45pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/22 "2019-04-18T21:45:32Z")

</div>

Thanks for the reminder.

Here it is: [https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build\_Instructions#Mac\_OSX\_10.14\_.28Mojave.29](https://www.slicer.org/wiki/Documentation/Nightly/Developers/Build_Instructions#Mac_OSX_10.14_.28Mojave.29)

If you create a wiki account, I will make sure it is approved and you should be able to improve further.

---

<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:** [April 18, 2019, 9:58pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/23 "2019-04-18T21:58:54Z")

</div>

I ran into this the other day and [filed an issue](https://issues.slicer.org/view.php?id=4681) with a workaround to specify the SDK version. It turns out [Apple deprecated /usr/include](https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes#3035623). I updated the wiki with what I think it the preferred solution for now.

---

<div class="post-metadata">

**Author:** ![jcfr](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jcfr/32/17825_2.png) [@jcfr](https://discourse.slicer.org/u/jcfr)\
**Post date:** [April 18, 2019, 10:20pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/24 "2019-04-18T22:20:01Z")

</div>

Thanks Steve. I will submit a PR to update the build system, it should be quite straightforward.

---

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [June 9, 2019, 1:28pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/25 "2019-06-09T13:28:14Z")

</div>

Hi,

Has anybody tried to install gfortran in MacOS 10.14? I was able to build Slicer no problem thanks to this thread, but now I cant build [SALT](http://salt.slicer.org) in my new Macbook pro since Xcode 10 has no gfortran. [SPHARM](https://github.com/NIRALUser/SPHARM-PDM) still depends on this compiler.

This [tutorial](https://solarianprogrammer.com/2017/05/21/compiling-gcc-macos/) explains in great detail how to install gcc9 (includes gfortran), but I wanted to check in first with you guys in case somebody has tried other ones successfully…

Thanks!  
Bea

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hjmjohnson/32/173_2.png) [@hjmjohnson](https://discourse.slicer.org/u/hjmjohnson)\
**Post date:** [June 9, 2019, 2:50pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/26 "2019-06-09T14:50:59Z")

</div>

I have not used gfortran in a long time.

I’d recommend using homebrew. “brew install gcc”

If you meant “gfortran” specifically:

GNU Fortran is part of the GCC formula:

brew install gcc

Hans

---

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [June 10, 2019, 1:35pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/27 "2019-06-10T13:35:07Z")

</div>

Thanks @hjmjohnson  
Is gcc part of XCode or it got deprecated, favoring clang instead?

---

<div class="post-metadata">

**Author:** ![hjmjohnson](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/hjmjohnson/32/173_2.png) [@hjmjohnson](https://discourse.slicer.org/u/hjmjohnson)\
**Post date:** [June 10, 2019, 1:49pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/28 "2019-06-10T13:49:04Z")

</div>

Xcode is only Clang by default (and has been for many years now).

Gcc is not distributed with MacOSX directly. You need to install it using homebrew (or other approaches).

---

<div class="post-metadata">

**Author:** ![bpaniagua](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/bpaniagua/32/20_2.png) [@bpaniagua](https://discourse.slicer.org/u/bpaniagua)\
**Post date:** [June 10, 2019, 2:53pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/29 "2019-06-10T14:53:43Z")

</div>

Gotcha. Also, it worked like a charm.  
Thanks!

---

<div class="post-metadata">

**Author:** ![priya.vada4](https://avatars.discourse-cdn.com/v4/letter/p/d26b3c/32.png) [@priya.vada4](https://discourse.slicer.org/u/priya.vada4)\
**Post date:** [August 19, 2019, 6:18pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/30 "2019-08-19T18:18:36Z")

</div>

Hi

I seem to be running into a problem building Slicer on Mojave. Slicer builds without any errors but when I try to run it, I get the following error:

```
dyld: malformed mach-o: load commands size (34376) > 32768

2019-08-19 14:11:49.981 Slicer[92126:1188397] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.

error: [/Users/Priya/Project/Slicer-latest/Slicer-Superbuild-Debug/Slicer-build/bin/Slicer.app/Contents/MacOS/./Slicer] exit abnormally - Report the problem.

```

Is there any log file created to investigate the problem? Details of build as follows:

Qt version: Tried 5.11 and 5.13 - same problem exists  
Mac OS: 10.14.6

Priya

---

<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:** [August 19, 2019, 7:21pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/31 "2019-08-19T19:21:01Z")

</div>

There is a limit on total number and length of paths in a build project (reasons and limits vary on different operating systems and compilers). To avoid such issues we use short path for source and build directories.

---

<div class="post-metadata">

**Author:** ![Samuel\_Gerber](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/samuel_gerber/32/6410_2.png) [@Samuel\_Gerber](https://discourse.slicer.org/u/Samuel_Gerber)\
**Post date:** [May 19, 2020, 12:46pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/32 "2020-05-19T12:46:25Z")

</div>

Which version of QT should be used?

In the instructions there appear three:  
For building Slicer: download and execute [qt-unified-mac-x64-online.dmg](https://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg), install Qt 5.10

- Install Qt 5.11.2 using [Qt Online Installer for macOS](http://download.qt.io/official_releases/online_installers/qt-unified-mac-x64-online.dmg)
- Build qt from homebrew  
brew install qt ccmake -DCMAKE\_OSX\_DEPLOYMENT\_TARGET=10.14 -DQt5\_DIR=/usr/local//Cellar/qt/5.13.2/lib/cmake/Qt5 ~/slicer/latest/Slicer

---

<div class="post-metadata">

**Author:** ![jamesobutler](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/jamesobutler/32/7511_2.png) [@jamesobutler](https://discourse.slicer.org/u/jamesobutler)\
**Post date:** [May 19, 2020, 1:32pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/33 "2020-05-19T13:32:01Z")

</div>

You can find out if a specific version is working by getting the version of Qt used in the current Slicer nightly for macOS. Open Slicer and in the python interactor run

```python
qt.qVersion()

```

This is currently version 5.10.0 on macOS. Then generally anything on the same line of 5.10.x is likely to work while anything newer than 5.10 is something experimental and you will have to try on your own.

---

<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:** [May 19, 2020, 1:44pm UTC](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554/34 "2020-05-19T13:44:44Z")

</div>

I use 5.14.1 from homebrew on my mac builds and it’s fine.

[Previous page](https://discourse.slicer.org/t/building-on-mac-10-14-mojave/4554.md?page=1)
