Installation on Apple Silicon (M1/M2/M3)

The main difficulty is that the CPU architecture is ARM64, whereas Imagine++ is compiled for Intel/AMD x86_64. Fortunately, MacOS has a tool named “Rosetta” that is able to run x86_64 code.

Install homebrew (package manager)

Open a terminal application and copy-paste this:

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

It will ask your password. Nothing appears while you type, this is normal. Press key Enter when done.

Follow instructions to set the environment variable at the end.

Install Qt

arch -x86_64 brew install cmake
arch -x86_64 brew install qt@5
arch -x86_64 brew install --cask qt-creator

Install Imagine++

curl -O https://imagine.enpc.fr/~monasse/Imagine++/downloads/Imagine++-5.0.0-Darwin-x86_64.pkg
open Imagine++-5.0.0-Darwin-x86_64.pkg

Launching this installer may fail because of “unidentified developer”. Don’t panic: go to the Apple menu, System Settings, section Security&Privacy. It says that Imagine++.framework was blocked. Click button Open Anyway.

Test QtCreator

  1. Download the test program and set up environment variables (the last line may ask again your password):
curl -O --output-dir Documents https://imagine.enpc.fr/~monasse/Info/TPs/01/Tp1_Final.zip
cd Documents && unzip Tp1_Final.zip && cd
launchctl setenv QT_DIR /usr/local/opt/qt@5/lib/cmake
launchctl setenv Qt5_DIR /usr/local/opt/qt@5/lib/cmake
[ -d .config ] && sudo chown -R $(logname):staff .config
  1. Launch QtCreator, which should be accessible as all other applications.
  2. Go to Menu Qt Creator / Preferences…
  3. Go to Kits. There should be a kit named Desktop or Bureau, check that it is the default one (it should appear in italics). If not there is a button to set it the default.
  4. In the Welcome section on the top-left of QtCreator, choose Open Project and select the file Documents/Tp1_Final/CMakeLists.txt, look at tab General Messages to see the output of CMake, click on the hammer tool on the bottom left to build (check output of build in tab Compile Output); to run the test program, there is a green triangle on the left part. If a window with a bouncing ball appears, you are good!

See https://imagine.enpc.fr/~monasse/Imagine++/usage.html.

Troubleshooting: https://imagine.enpc.fr/~monasse/Imagine++/pdf/qtCreatorCheckMac.pdf

For the next session

QtCreator will not work directly when you restart your computer. The following line will ensure it continues to work next time you reboot:

curl -O --output-dir Library/LaunchAgents https://imagine.enpc.fr/~monasse/Imagine++/qt.plist