ParaView requires Qt5, but Homebrew installs Qt6 by default, causing multiple compilation errors.
To avoid conflicts, Qt5 was manually installed with:
brew install qt@5However, this led to several issues:
- The installed version was not properly linked in
/opt/homebrew. - CMake and Ninja continued detecting Qt6 instead of Qt5.
- Running rcc failed due to incompatibilities in
libzstd.1.dylib.
Thus, the decision was made to compile Qt5 from source to ensure full compatibility.
Before compiling, all previous Qt installations were removed to prevent conflicts:
brew uninstall --ignore-dependencies qt qt@5
brew autoremove
brew cleanupThen, we verified that Qt6 was no longer present:
brew list | grep qtSome remnants were found in /usr/local/homebrew, which were manually removed:
rm -rf /usr/local/homebrew/Cellar/qt
rm -rf /usr/local/homebrew/Cellar/qt@5
rm -rf /usr/local/homebrew/opt/qt*
rm -rf /usr/local/homebrew/share/qt*Finally, Homebrew was updated:
brew update
brew upgradeTo compile Qt5 from source, follow these steps:
git clone --branch 5.15.16 --depth 1 https://code.qt.io/qt/qt5.git
cd qt5Initialize the required submodules:
./init-repository --module-subset=qtbase,qttools,qtsvg,qtxmlpatterns,qtdeclarativemkdir build
cd build
../configure \
-prefix /opt/qt5 \
-opensource -confirm-license \
-release \
-platform macx-clang \
-arch arm64 \
-nomake examples -nomake tests \
-skip qtwebengineSkipping qtwebengine avoids Chromium-related compatibility issues.
Start the compilation process:
make -j$(sysctl -n hw.ncpu)This process took several hours due to the number of modules being compiled.
If compilation failed, errors were analyzed with:
make -j1After a successful build, Qt5 was installed with:
sudo make installVerify that Qt5 was properly installed in /opt/qt5:
ls /opt/qt5/lib/cmake/Qt5After installation, environment variables were set so that CMake could detect Qt5:
export Qt5_DIR="/opt/qt5/lib/cmake/Qt5"
export CMAKE_PREFIX_PATH="/opt/qt5/lib/cmake:$CMAKE_PREFIX_PATH"To apply these settings permanently, they were added to ~/.zshrc:
echo 'export Qt5_DIR="/opt/qt5/lib/cmake/Qt5"' >> ~/.zshrc
echo 'export CMAKE_PREFIX_PATH="/opt/qt5/lib/cmake:$CMAKE_PREFIX_PATH"' >> ~/.zshrc
source ~/.zshrcVerify that CMake detected Qt5:
cmake --find-package -DNAME=Qt5 -DCOMPILER_ID=ClangIf CMake still did not detect Qt5, its path was manually set in CMakeLists.txt:
set(Qt5_DIR "/opt/qt5/lib/cmake/Qt5")
find_package(Qt5 REQUIRED COMPONENTS Widgets Core Gui)To ensure the installation worked correctly, we checked:
qmake --versionExpected output:
QMake version 3.1
Using Qt version 5.15.16 in /opt/qt5/lib
Then, we verified that ParaView detected it:
cmake ../paraview- Qt6 was completely removed to prevent conflicts during ParaView compilation.
- Qt5 was compiled from source, ensuring compatibility with macOS ARM64.
- Paths were manually configured to allow CMake to detect Qt5 in
/opt/qt5. - Installation was verified with
qmakeandcmake.
This setup allowed ParaView to compile without errors, avoiding broken Qt dependencies.