I’ve been trying to build Slicer on my Mac for months now, but still haven’t found a reliable way to do it without running into errors—even after following the documentation carefully.
One of the main blockers is the Qt requirement. The documentation points to a DMG here, but it doesn’t include Qt 5.15.2. Since that version is no longer maintained, I’m not sure where to get it, and I’m stuck.
Honestly, I just want to build Slicer on my Mac and get started without all the friction. It’s frustrating that there isn’t a simpler, more end-user-friendly way to do this.
Can anyone please guide me through a working setup or a less painful process?
I know this is cliche but you need to read this in and out:
I also spend hours trying to build slicer from sourceand it was very hard. My first recommendation is that if you can avoid installing in your mac, and instead in a new VM, it will make the build much easier.
For mac:
The most important thing it that you have to make sure you have a version qt 15 and a version of cmake that is not higher than 4x.
make sure you check those first and where they are in your path. Most people install them with brew so try
```
brew list --formula | grep make
brew list --formula | grep qt
i installed qt with brew and it worked, and if you have the wrong versions delete those too.
brew install qt@5
you can also check using which command
-Fix those first, and make sure they are in your path env and have xcode installed.
-Next just like the documentation says make sure you make a directory in the /opt : this will be very helpful
mkdir /opt/s/
cd /opt/s
cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=13.0 \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DQt5_DIR:PATH="PUT YOUR QT PATH"
I hear your frustration, and honestly i dont really have a solution. Since every computer and configuration feels different. I read alot of post here and it seems alot of people having build trouble with arm.
First try to get the QT path ahead of your slicer build path in your .bash or .zsh file first
-update xcode
my qt version is this Qt 5.15.16 from Homebrew so install this
which qt: to get bath and add it to your path variable,
export Qt5_DIR=/opt/homebrew/opt/qt@5/lib/cmake/Qt5
and then make sure you clean up your slicer and build from source:
my configuration:
based on my cache and path cmake used it looks like this (dont copy this but it can maybe help u diagnose)
“I confirm that the last Slicer version successfully compiles on apple m1 only with OpenSSL built outside of Slicer (configured for darwin x86_64) and SimpleITK disabled.
I think the issue is the configuration step of the default slicer openssl build, which allows various dependencies of OpenSSL to be compiled in 32 bit mode, which I believe is not supported in M1 chips.
In fact, OpenSSL on its own (1.1.1g in this example) builds very nicely with a very simple ./Configure darwin64-x86_64-cc shared"
I also just want to preface that although my build was successful, it didn’t pass all the tests, I also used a lot of ai to help me so I am not too savvy with cmake at all. I mainly build slicer so i could extract lsp and get a configuration.json file to get access to autocomplete.