macOS build is broken
@gasparschott
Build for Mojave is fixed. Need verification for Sequoia: macos_build branch.
Qt5:
- Configure:
export CMAKE_PREFIX_PATH=\
/Users/user/Lib/boost-1.87.0:\
/Users/user/Lib/eigen-3.4.0:\
/Users/user/Lib/libjpeg-turbo-3.1.0:\
/Users/user/Lib/libtiff-4.7.0:\
/Users/user/Lib/Qt-5.12.12
cmake\
-S ./src\
-B ./build\
-G Ninja\
-D OpenCL_INCLUDE_DIR=/Users/user/Lib/OpenCL-2024.10.24/include\
-D OpenCL_LIBRARY=/Users/user/Lib/OpenCL-2024.10.24/lib/libOpenCL.dylib\
-D ENABLE_OPENCL=ON\
-D ENABLE_OPENGL=ON\
-D ST_USE_QT6=OFF\
-D ST_NO_TESTS=OFF
- Build
cmake\
--build ./build\
--parallel
- Install
cmake\
--install ./build\
--prefix=$(pwd)/install
- Pack
cpack\
-B ./pkg\
--config ./build/CPackConfig.cmake
Qt6:
- Configure:
/Users/user/Lib/boost-1.87.0:\
/Users/user/Lib/eigen-3.4.0:\
/Users/user/Lib/libjpeg-turbo-3.1.0:\
/Users/user/Lib/libtiff-4.7.0:\
/Users/user/Lib/Qt-6.3.2
cmake\
-S ./src\
-B ./build\
-G Ninja\
-D OpenCL_INCLUDE_DIR=/Users/user/Lib/OpenCL-2024.10.24/include\
-D OpenCL_LIBRARY=/Users/user/Lib/OpenCL-2024.10.24/lib/libOpenCL.dylib\
-D ENABLE_OPENCL=ON\
-D ENABLE_OPENGL=ON\
-D ST_USE_QT6=ON\
-D ST_NO_TESTS=OFF
- Build
cmake\
--build ./build\
--parallel
- Install
cmake\
--install ./build\
--prefix=$(pwd)/install
- Pack
cpack\
-B ./pkg\
--config ./build/CPackConfig.cmake
I can't check on a virtual machine if OpenCL works:
I'll try to get to this in the next couple of days. Thanks.
Sent with Proton Mail secure email.
On Tuesday, March 25th, 2025 at 6:43 PM, noobie-iv @.***> wrote:
@.***(https://github.com/gasparschott)
Build for Mojave is fixed. Need verification for Sequoia: macos_build branch.
Qt5:
- Configure:
export CMAKE_PREFIX_PATH
=
\
/
Users
/
user
/
Lib
/
boost
87.0
:\
/
Users
/
user
/
Lib
/
eigen
4.0
:\
/
Users
/
user
/
Lib
/
libjpeg
turbo
1.0
:\
/
Users
/
user
/
Lib
/
libtiff
7.0
:\
/
Users
/
user
/
Lib
/
Qt
12.12
cmake\
S .
/
src\
B .
/
build\
G Ninja\
D OpenCL_INCLUDE_DIR
=/
Users
/
user
/
Lib
/
OpenCL
10.24
/
include\
D OpenCL_LIBRARY
=/
Users
/
user
/
Lib
/
OpenCL
10.24
/
lib
/
libOpenCL
.dylib
\
D ENABLE_OPENCL
=
ON\
D ENABLE_OPENGL
=
ON\
D ST_USE_QT6
=
OFF\
D ST_NO_TESTS
=
OFF
- Build
cmake\
--build
.
/
build\
--parallel
- Install
cmake\
--install
.
/
build\
--prefix
=
$(pwd)
/
install
- Pack
cpack\
B .
/
pkg\
--config
.
/
build
/
CPackConfig
.cmake
Qt6:
- Configure:
/Users/user/Lib/boost-1.87.0:
/Users/user/Lib/eigen-3.4.0:
/Users/user/Lib/libjpeg-turbo-3.1.0:
/Users/user/Lib/libtiff-4.7.0:
/Users/user/Lib/Qt-6.3.2cmake
-S ./src
-B ./build
-G Ninja
-D OpenCL_INCLUDE_DIR=/Users/user/Lib/OpenCL-2024.10.24/include
-D OpenCL_LIBRARY=/Users/user/Lib/OpenCL-2024.10.24/lib/libOpenCL.dylib
-D ENABLE_OPENCL=ON
-D ENABLE_OPENGL=ON
-D ST_USE_QT6=ON
-D ST_NO_TESTS=OFF
- Build
cmake\
--build
.
/
build\
--parallel
- Install
cmake\
--install
.
/
build\
--prefix
=
$(pwd)
/
install
- Pack
cpack\
B .
/
pkg\
--config
.
/
build
/
CPackConfig
.cmake
I can't check on a virtual machine if OpenCL works:
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
[noobie-iv]noobie-iv created an issue (ImageProcessing-ElectronicPublications/scantailor-experimental#60)
@.***(https://github.com/gasparschott)
Build for Mojave is fixed. Need verification for Sequoia: macos_build branch.
Qt5:
- Configure:
export CMAKE_PREFIX_PATH
=
\
/
Users
/
user
/
Lib
/
boost
87.0
:\
/
Users
/
user
/
Lib
/
eigen
4.0
:\
/
Users
/
user
/
Lib
/
libjpeg
turbo
1.0
:\
/
Users
/
user
/
Lib
/
libtiff
7.0
:\
/
Users
/
user
/
Lib
/
Qt
12.12
cmake\
S .
/
src\
B .
/
build\
G Ninja\
D OpenCL_INCLUDE_DIR
=/
Users
/
user
/
Lib
/
OpenCL
10.24
/
include\
D OpenCL_LIBRARY
=/
Users
/
user
/
Lib
/
OpenCL
10.24
/
lib
/
libOpenCL
.dylib
\
D ENABLE_OPENCL
=
ON\
D ENABLE_OPENGL
=
ON\
D ST_USE_QT6
=
OFF\
D ST_NO_TESTS
=
OFF
- Build
cmake\
--build
.
/
build\
--parallel
- Install
cmake\
--install
.
/
build\
--prefix
=
$(pwd)
/
install
- Pack
cpack\
B .
/
pkg\
--config
.
/
build
/
CPackConfig
.cmake
Qt6:
- Configure:
/Users/user/Lib/boost-1.87.0:
/Users/user/Lib/eigen-3.4.0:
/Users/user/Lib/libjpeg-turbo-3.1.0:
/Users/user/Lib/libtiff-4.7.0:
/Users/user/Lib/Qt-6.3.2cmake
-S ./src
-B ./build
-G Ninja
-D OpenCL_INCLUDE_DIR=/Users/user/Lib/OpenCL-2024.10.24/include
-D OpenCL_LIBRARY=/Users/user/Lib/OpenCL-2024.10.24/lib/libOpenCL.dylib
-D ENABLE_OPENCL=ON
-D ENABLE_OPENGL=ON
-D ST_USE_QT6=ON
-D ST_NO_TESTS=OFF
- Build
cmake\
--build
.
/
build\
--parallel
- Install
cmake\
--install
.
/
build\
--prefix
=
$(pwd)
/
install
- Pack
cpack\
B .
/
pkg\
--config
.
/
build
/
CPackConfig
.cmake
I can't check on a virtual machine if OpenCL works:
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
How can I build the latest version for MacOS? I'm running Sequoia 15.3.2. Are there build instructions for building the main branch?
After installing the required dependencies, I ran the following commands in the macos_build branch:
export CMAKE_PREFIX_PATH="$(brew --prefix qt)/lib/cmake:$(brew --prefix boost):…"
cmake -S . -B build -G Ninja \
-D ST_USE_QT6=ON -D ENABLE_OPENCL=ON -D ENABLE_OPENGL=ON
And then
cmake --build build --parallel
cmake --install build --prefix $(pwd)/install
cpack -B pkg --config build/CPackConfig.cmake
But got the following error during the build phase:
Build failure log
/f/scantailor-experimental (macos_build)> cmake --build build --parallel
cmake --install build --prefix $(pwd)/install
cpack -B pkg --config build/CPackConfig.cmake
[357/492] Building CXX object src/acceleration/opencl/CMakeFiles/opencl.dir/Transpose.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/Transpose.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/Transpose.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/Transpose.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/Transpose.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/Transpose.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/Transpose.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/Transpose.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[359/492] Building CXX object src/acceleratio...eFiles/opencl.dir/OpenCLAffineTransform.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLAffineTransform.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLAffineTransform.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLAffineTransform.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLAffineTransform.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLAffineTransform.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLAffineTransform.cpp:19:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLAffineTransform.h:28:10: fatal error: 'CL/cl.h' file not found
28 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[360/492] Building CXX object src/acceleratio...l/CMakeFiles/opencl.dir/OpenCLGaussBlur.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLGaussBlur.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLGaussBlur.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLGaussBlur.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLGaussBlur.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGaussBlur.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGaussBlur.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGaussBlur.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[361/492] Building CXX object src/acceleratio...keFiles/opencl.dir/OpenCLTextFilterBank.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLTextFilterBank.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLTextFilterBank.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLTextFilterBank.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLTextFilterBank.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLTextFilterBank.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLTextFilterBank.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLTextFilterBank.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[362/492] Building CXX object src/acceleratio...MakeFiles/opencl.dir/OpenCLSavGolFilter.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLSavGolFilter.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLSavGolFilter.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLSavGolFilter.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLSavGolFilter.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLSavGolFilter.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLSavGolFilter.cpp:19:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLSavGolFilter.h:23:10: fatal error: 'CL/cl.h' file not found
23 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[363/492] Building CXX object src/acceleration/opencl/CMakeFiles/opencl.dir/Copy.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/Copy.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/Copy.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/Copy.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/Copy.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/Copy.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/Copy.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/Copy.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[364/492] Building CXX object src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLDewarp.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLDewarp.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLDewarp.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLDewarp.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/OpenCLDewarp.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLDewarp.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLDewarp.cpp:19:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLDewarp.h:28:10: fatal error: 'CL/cl.h' file not found
28 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[365/492] Building CXX object src/acceleratio.../CMakeFiles/opencl.dir/HitMissTransform.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/HitMissTransform.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/HitMissTransform.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/HitMissTransform.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/HitMissTransform.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/HitMissTransform.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/HitMissTransform.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/HitMissTransform.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[366/492] Building CXX object src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryFill.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryFill.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryFill.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryFill.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryFill.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/BinaryFill.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/BinaryFill.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/BinaryFill.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[367/492] Building CXX object src/acceleratio...cl/CMakeFiles/opencl.dir/BinaryRasterOp.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryRasterOp.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryRasterOp.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryRasterOp.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/BinaryRasterOp.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/BinaryRasterOp.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/BinaryRasterOp.cpp:19:
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/BinaryRasterOp.h:22:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/OpenCLGrid.h:25:10: fatal error: 'CL/cl.h' file not found
25 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
[368/492] Building CXX object src/acceleratio...iles/opencl.dir/RenderPolynomialSurface.cpp.o
FAILED: src/acceleration/opencl/CMakeFiles/opencl.dir/RenderPolynomialSurface.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DCL_HPP_ENABLE_EXCEPTIONS -DCL_HPP_MINIMUM_OPENCL_VERSION=110 -DCL_HPP_TARGET_OPENCL_VERSION=110 -DCL_TARGET_OPENCL_VERSION=120 -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_XML_LIB -I/Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/opencl_autogen/include -I/Users/komron/fun/scantailor-experimental/src -I/Users/komron/fun/scantailor-experimental/src/foundation -I/Users/komron/fun/scantailor-experimental/src/math -I/Users/komron/fun/scantailor-experimental/src/interaction -I/Users/komron/fun/scantailor-experimental/src/zones -I/Users/komron/fun/scantailor-experimental/build -I/Users/komron/fun/scantailor-experimental/build/src -I/Users/komron/fun/scantailor-experimental/build/src/ui -I/Users/komron/fun/scantailor-experimental/src/acceleration/. -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/Cellar/boost/1.88.0/include -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -isystem /opt/homebrew/opt/qt/lib/QtGui.framework/Headers -iframework /opt/homebrew/opt/qt/lib -isystem /opt/homebrew/opt/qt/lib/QtCore.framework/Headers -isystem /opt/homebrew/opt/qt/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/opt/qt/include -isystem /opt/homebrew/opt/qt/lib/QtXml.framework/Headers -isystem /opt/homebrew/opt/qt/lib/QtWidgets.framework/Headers -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/acceleration/opencl/CMakeFiles/opencl.dir/RenderPolynomialSurface.cpp.o -MF src/acceleration/opencl/CMakeFiles/opencl.dir/RenderPolynomialSurface.cpp.o.d -o src/acceleration/opencl/CMakeFiles/opencl.dir/RenderPolynomialSurface.cpp.o -c /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/RenderPolynomialSurface.cpp
In file included from /Users/komron/fun/scantailor-experimental/src/acceleration/opencl/RenderPolynomialSurface.cpp:19:
/Users/komron/fun/scantailor-experimental/src/acceleration/opencl/RenderPolynomialSurface.h:24:10: fatal error: 'CL/cl.h' file not found
24 | #include <CL/cl.h>
| ^~~~~~~~~
1 error generated.
ninja: build stopped: subcommand failed.
-- Install configuration: "Release"
CMake Error at build/src/acceleration/opencl/cmake_install.cmake:41 (file):
file INSTALL cannot find
"/Users/komron/fun/scantailor-experimental/build/libopencl_plugin.so": No
such file or directory.
Call Stack (most recent call first):
build/src/acceleration/cmake_install.cmake:42 (include)
build/src/cmake_install.cmake:82 (include)
build/cmake_install.cmake:42 (include)
CPack: Create package using DragNDrop
CPack: Install projects
CPack: - Install project: Scan Tailor Experimental []
CMake Error at /Users/komron/fun/scantailor-experimental/build/src/acceleration/opencl/cmake_install.cmake:41 (file):
file INSTALL cannot find
"/Users/komron/fun/scantailor-experimental/build/libopencl_plugin.so": No
such file or directory.
Call Stack (most recent call first):
/Users/komron/fun/scantailor-experimental/build/src/acceleration/cmake_install.cmake:42 (include)
/Users/komron/fun/scantailor-experimental/build/src/cmake_install.cmake:82 (include)
/Users/komron/fun/scantailor-experimental/build/cmake_install.cmake:42 (include)
CMake Error at /Users/komron/fun/scantailor-experimental/build/cmake_install.cmake:56 (file):
file INSTALL cannot find
"/Users/komron/fun/scantailor-experimental/build/scantailor-experimental-cli":
No such file or directory.
CMake Error at /Users/komron/fun/scantailor-experimental/build/cmake_install.cmake:69 (file):
file INSTALL cannot find
"/Users/komron/fun/scantailor-experimental/build/scantailor-experimental_bg.qm":
No such file or directory.
CMake Error at /Users/komron/fun/scantailor-experimental/build/cmake_install.cmake:98 (file):
file Failed to run otool on:
/Users/komron/fun/scantailor-experimental/build/scantailor-experimental.app/Contents/MacOS/scantailor-experimental
CPack Error: Error when generating package: scantailor-experimental
@karipov
Try to add the path to OpenCL at configuration stage explicitly:
cmake -S . -B build\
-D OpenCL_INCLUDE_DIR=/????????????/OpenCL-2024.10.24/include\
-D OpenCL_LIBRARY=/????????????/OpenCL-2024.10.24/lib/libOpenCL.dylib\
...
Xcode contains its own OpenCL framework, but outdated and incomplete. But for some reason cmake finds and uses it, if you don’t specify other paths during configuration. I don't know where homebrew keeps it, because only old macOS versions run on a virtual computer, and nomebrew does not support them. I compiled all the libraries manually, so replace the question marks with the correct path.
Okay @noobie-iv (maybe @gasparschott for the future). Here are all the steps I took to get the installation to work with Qt 6. I'm using fish as my shell and running an M2 Pro machine on Sequoia 15.3.2 (24D81). I also use homebrew.
0. Install prerequisites (one-time)
brew install cmake ninja boost eigen libjpeg-turbo libtiff qt \
opencl-headers opencl-clhpp-headers opencl-icd-loader
1. Get the macOS-fixes branch
git clone --branch macos_build \
https://github.com/ImageProcessing-ElectronicPublications/scantailor-experimental.git
cd scantailor-experimental
2. Configure the build
rm -rf build # clean slate
set BREW /opt/homebrew/opt
cmake -S . -B build -G Ninja \
-D ST_USE_QT6=ON \
-D ENABLE_OPENCL=ON -D ENABLE_OPENGL=ON \
-D OpenCL_LIBRARY="$BREW/opencl-icd-loader/lib/libOpenCL.dylib" \
-D CMAKE_PREFIX_PATH="$BREW/qt;$BREW/boost;$BREW/eigen;$BREW/libjpeg-turbo;$BREW/libtiff" \
-D CMAKE_CXX_FLAGS="-isystem $BREW/opencl-headers/include -isystem $BREW/opencl-clhpp-headers/include" \
-D CMAKE_C_FLAGS="-isystem $BREW/opencl-headers/include"
This adds both keg-only OpenCL header directories so every source sees <CL/cl.h> and <CL/opencl.hpp>.
3. Compile
cmake --build build --parallel
4. Fix Homebrew’s Qt plugin layout (one-time)
set QT_PREFIX (brew --prefix qt) # /opt/homebrew/opt/qt
rm -rf $QT_PREFIX/plugins # remove any partial attempts
ln -sfn $QT_PREFIX/share/qt/plugins $QT_PREFIX/plugins
For some reason I kept getting the following error, and the above lines fixed it:
CMake Error at build/cmake_install.cmake:138 (file):
file INSTALL cannot find
"/opt/homebrew/opt/qt/plugins/styles/libqmacstyle.dylib": No such file or
directory.
5. Add Linux-style alias for the OpenCL plugin
Not sure if you need this, but saw it somewhere as to be included
ln -sfn build/src/acceleration/opencl/libopencl_plugin.dylib \
build/src/acceleration/opencl/libopencl_plugin.so
6. And last, stage the app bundle:
cmake --install build --prefix (pwd)/install
The resulting file is in install/scantailor-experimental.app
After all this, unfortunately, I don't see OpenCL-capable devices:
Maybe my configuration was incorrect, in which case I would appreciate any tips! I'm not 100% sure how to compile each of the libraries from source but I can give it a go as well and see if that changes things. Would that be helpful?
Also, in general, I think this project deserves a lot more attention. If you cleaned up the README, and advertised it on something like diybookscanner.org/forum, there would be a lot of interest.
Maybe the plugin libopencl_plugin.so can't load the libOpenCL.dylib library. We should try to copy it to scantailor-experimental.app/Contents/Frameworks. In my system the link from the plugin looks like this: @rpath/libOpenCL.1.dylib, so the path must be: scantailor-experimental.app/Contents/Frameworks/libOpenCL.1.dylib
@noobie-iv
Hm, okay so I copied it over to the app like so:
set APP install/scantailor-experimental.app
cp (brew --prefix opencl-icd-loader)/lib/libOpenCL.* $APP/Contents/Frameworks/
Doing a quick test, I see that everything is there:
ls -l $APP/Contents/Frameworks/libOpenCL*
> -r--r--r--@ 1 komron staff 101520 Apr 30 00:57 scantailor-experimental.app/Contents/Frameworks/libOpenCL.1.0.0.dylib
> -r--r--r--@ 1 komron staff 101520 Apr 30 00:57 scantailor-experimental.app/Contents/Frameworks/libOpenCL.1.dylib
> -r--r--r--@ 1 komron staff 101520 Apr 30 00:57 scantailor-experimental.app/Contents/Frameworks/libOpenCL.dylib
Relaunching the app, unfortunately the acceleration is still greyed-out. I think it would be worth trying to build all the libraries manually and redo the compilation, but that will take a second. Still, I'm super grateful you're taking the time to make macOS builds even possible.
Have you by any chance looked at Github-hosted runners? It seems like they provide apple-silicon macos machines for which you can write actions to compile binaries.
If I launch ST from terminal and go to settings, an error message appears in the terminal:
OpenCL error: clGetPlatformIDs
But if the OpenCL library is not available (not copied to Frameworks folder, and the original folder /Users/user/Lib/OpenCL-2024.10.24/lib/ is renamed, so that the library is definitely not detected), then the error message changes:
OpenCL plugin failed to load: Library not loaded: @rpath/libOpenCL.1.dylib
This means that the plugin finds the library in the Frameworks folder. But I can't fix broken OpenCL from under a virtual machine. Apparently, only a macOS programmer can fix it. All I can do is merge the branch to build the program without OpenCL.
@noobie-iv , объединяй. Близится релиз 1.2025.05.05. Не стоит тянуть как с предыдущим.
PS: Обрати внимание на порог N.I.C.K. Его реализация практически идентична Niblack, только зазор между "средним" и "пороговой картой" определяется не стандартным отклонением, а круговой составляющей из стандартного отклонения и среднего (double const circle = sqrt(variance + mean * mean); double threshold = mean - k * circle;). Оттого и коэффициент (масштаб зазора) в разы меньше чем у Niblack (0.05 против 0.20), а результат значительно чище. При этом характер порога похож на Niblack. Возможно в STD тебе зайдёт (ваять особо ничего не надо (копи-паста binarizeNiblackMap), а результат по соотношению чистота/контуры вполне).
PS2: Либо можешь вообще в binarizeNiblackMap опциональный коэффициент scale добавить (по умолчанию == 0.0). Тогда вообще круть получишь: double const stddev = sqrt(fabs(variance + scale * mean * mean)); (а виджет и опции скопи-пастить с Gatos).
Date: Wed Apr 30 21:44:02 2025 +1000: https://github.com/ImageProcessing-ElectronicPublications/scantailor-experimental/commit/84d80e22cd42e1e419b01d155d57af4a50b9a8bd by @noobie-iv .
PS: А +10 - это Владивосток? Круто. 👍
@zvezdochiot @noobie-iv as I understand you've merged this branch. I am happy to keep testing what needs to be tested, and in the meantime try to create some sort of build system for macOS. I already have a .dmg of this branch's .app file, but can also make one happen for the next release, even if without OpenCL acceleration.
Once again, thank you guys for the amazing work on this project so far!
@noobie-iv I was able to fix the issue!
Looks like the root issue is that the pure Khronos loader is just a stub with no real drivers, so clGetPlatformIDs finds no platforms. Apple’s OpenCL.framework bundles both the loader and the Metal-backed ICD needed for GPU acceleration on macOS. Linking with -framework OpenCL pulls in that system framework correctly instead of treating it as a missing build target. So, we have to use Apple's OpenCL even if it's outdated...
The current cmakelists treats OpenCL as a regular .dylib, but we must instead link to Apple's framework with -framework flag. Here's a quick and dirty way I got it working:
set BREW /opt/homebrew/opt
cmake -S . -B build -G Ninja \
-D ST_USE_QT6=ON \
-D ENABLE_OPENCL=ON \
-D ENABLE_OPENGL=ON \
-D CMAKE_C_FLAGS="-I/System/Library/Frameworks/OpenCL.framework/Headers -isystem $BREW/opencl-headers/include" \
-D CMAKE_CXX_FLAGS="-I/System/Library/Frameworks/OpenCL.framework/Headers -isystem $BREW/opencl-headers/include -isystem $BREW/opencl-clhpp-headers/include" \
-D CMAKE_EXE_LINKER_FLAGS="-framework OpenCL" \
-D CMAKE_SHARED_LINKER_FLAGS="-framework OpenCL" \
-D CMAKE_PREFIX_PATH="$BREW/qt;$BREW/boost;$BREW/eigen;$BREW/libjpeg-turbo;$BREW/libtiff"
But ideally, we hook it into CMakeLists. I'm not super familar with cpp or cmakelists, but I think something like this might work:
if(ENABLE_OPENCL AND APPLE)
# force linking the framework instead of a raw library path
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/System/Library/Frameworks/OpenCL.framework/Headers")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I/System/Library/Frameworks/OpenCL.framework/Headers")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework OpenCL")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework OpenCL")
endif()
@karipov:
CMAKE_CXX_FLAGS
I feel like this is wrong, but I can't prove it 😄. It's strange that you need to connect some headers and use others. Also cmake sees that it linked with the framework, it is strange to add this to the command line parameters manually. It seems that in macos the headers are simply not installed, but everything else is. So, it is enough to specify the path to the headers (OpenCL_INCLUDE_DIR):
export CMAKE_PREFIX_PATH=\
/Users/user/Lib/boost-1.87.0:\
/Users/user/Lib/eigen-3.4.0:\
/Users/user/Lib/libjpeg-turbo-3.1.0:\
/Users/user/Lib/libtiff-4.7.0:\
/Users/user/Lib/Qt-5.12.12
# Configure
cmake\
-S ./src\
-B ./build\
-G Ninja\
-D CPACK_GENETATOR=DragNDrop\
-D OpenCL_INCLUDE_DIR:PATH=/Users/user/Lib/OpenCL-2024.10.24/include\
-D ST_USE_QT6=ON\
-D ENABLE_OPENCL:BOOL=ON\
-D ENABLE_OPENGL:BOOL=ON\
-D ST_USE_QT6:BOOL=OFF\
-D ST_NO_TESTS=OFF
# Build
cmake\
--build ./build\
--parallel
# Install
cmake\
--install ./build\
--prefix=$(pwd)/install
# Pack
cpack\
-B ./pkg\
--config ./build/CPackConfig.cmake
VitrtualBox OpenCL:
Super Quick Exit with OpenCL 😄:
@noobie-iv is there anything else left to do from my end? дай знать если я могу с чем нибудь помочь
@karipov
If OpenCL works, all that's left is to build the release (on the virtual machine OpenCL crashes and I can't test if it works on real hardware).
Ideally, the installer still needs to be cleaned. Now it includes extra headers:
scantailor-experimental.app/Contents/Frameworks/QtCore.framework/Headers/*.h
scantailor-experimental.app/Contents/Frameworks/QtGui.framework/Headers/*.h
...
It's because of the line (in CMakeLists.txt):
INSTALL(RUNTIME_DEPENDENCY_SET runtime ...
Because of this, the installer is overweight. We need to leave dylib's only and delete headers. But without this line, you will have to search and copy all the files manually (this is how the Windows build is currently designed). I'm not a macos programmer and I have no idea how to fix this. For example, I don't know where the original files might be located when copying manually. It was just the first solution I found on Google.
P.S. Maybe we'll set up auto-build and not ask anyone else to help. But @zvezdochiot is a Linux user, and I am a Windows user. We cannot test the functionality of the build.
I built the latest commit e40bf1d1c2ba03a3b29cf19dab8fbb9e5691c02d. OpenCL is finicky on macOS because it's been deprecated, so I decided to run unit tests on my M1 and compare it to another machine on Linux. Somehow an additional test failed on macOS. I don't know why that's the case. OpenCL is beyond my expertise.
Linux $ ./opencl_tests
Running 16 test cases...
scantailor-experimental/src/acceleration/opencl/tests/TestGaussBlur.cpp(170): error: in "GaussBlurTestSuite/test_axis_aligned_gauss_blur": check correct has failed
scantailor-experimental/src/acceleration/opencl/tests/TestDewarp.cpp(177): error: in "DewarpTestSuite/test_argb": check max_err <= 11 has failed [14 > 11]
*** 2 failures are detected in the test module "Master Test Suite"
macOS $ ./opencl_tests
Running 16 test cases...
scantailor-experimental/src/acceleration/opencl/tests/TestGaussBlur.cpp:170: error: in "GaussBlurTestSuite/test_axis_aligned_gauss_blur": check correct has failed
scantailor-experimental/src/acceleration/opencl/tests/TestDewarp.cpp:177: error: in "DewarpTestSuite/test_argb": check max_err <= 11 has failed [14 > 11]
scantailor-experimental/src/acceleration/opencl/tests/TestAffineTransform.cpp:172: error: in "AffineTransformTestSuite/test_argb": check max_err <= 15 has failed [16 > 15]
*** 3 failures are detected in the test module "Master Test Suite"
Also, @noobie-iv, it seems like you're using CPack to build the app bundle. CPack doesn't work well on macOS, which is why you're getting all the unnecessary headers files. Qt has its own macdeployqt tool to create a self-contained app bundle:
# copy the opencl plugin
cp libopencl_plugin.so scantailor-experimental.app/Contents/MacOS/
# macdeployqt will pick up the main executable from Info.plist, but non-listed executables/libraries have to be specified
macdeployqt scantailor-experimental.app -executable=scantailor-experimental.app/Contents/MacOS/libopencl_plugin.so
# re-sign the app bundle
codesign --sign - --force --deep scantailor-experimental.app
I'm happy to help with packaging if you want to use CI one day.
@eatyourbaby
test failed on macOS
They are broken under windows/linux too. And our team doesn't have any programmers at all, not just OpenCL ones, to fix them.
you're using CPack
This is because it compiles the project with the same commands for all systems. This reduces the amount of work required to maintain the build. I expect that in the next versions of cmake they will add flags to avoid copying unnecessary things. Now it's easier to add a command to recursively remove headers after installation - stupid, but it works.
DEVELOPER_DIR=/Library/Developer/CommandLineTools
SDK_PATH="$DEVELOPER_DIR/SDKs/MacOSX.sdk"
CXX_HEADERS="$SDK_PATH/usr/include/c++/v1"
rm -rf ./build
DEVELOPER_DIR=/Library/Developer/CommandLineTools cmake \
-S . \
-B ./build \
-G Ninja \
-D CPACK_GENERATOR=DragNDrop \
-D ST_USE_QT6=ON \
-D ENABLE_OPENCL:BOOL=OFF \
-D ENABLE_OPENGL:BOOL=ON \
-D ST_NO_TESTS=OFF \
-D CMAKE_CXX_STANDARD=17 \
-D CMAKE_CXX_STANDARD_REQUIRED=ON \
-D CMAKE_OSX_SYSROOT="/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" \
-D CMAKE_CXX_FLAGS="-stdlib=libc++ -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1" \
-D CMAKE_EXE_LINKER_FLAGS="-stdlib=libc++" \
-Wno-dev
DEVELOPER_DIR=/Library/Developer/CommandLineTools cmake --build ./build --parallel
# Install to create the app bundle structure
DEVELOPER_DIR=/Library/Developer/CommandLineTools cmake --install ./build --prefix=$(pwd)/install
# Create the final package (DMG file)
DEVELOPER_DIR=/Library/Developer/CommandLineTools cpack -B ./pkg --config ./build/CPackConfig.cmake
ls -la ./install/
# Look for the app bundle
find ./install -name "*.app" -type d
# After install but before cpack, remove headers
find ./install -name "*.app" -exec sh -c '
find "$0/Contents/Frameworks" -name "Headers" -type d -exec rm -rf {} + 2>/dev/null || true
' {} \;
cp /opt/homebrew/Cellar/qt/6.9.1/share/qt/plugins/imageformats/libqgif.dylib \
./install/scantailor-experimental.app/Contents/PlugIns/imageformats/
cp /opt/homebrew/Cellar/qt/6.9.1/share/qt/plugins/imageformats/libqwebp.dylib \
./install/scantailor-experimental.app/Contents/PlugIns/imageformats/
cp /opt/homebrew/Cellar/qt/6.9.1/share/qt/plugins/styles/libqmacstyle.dylib \
./install/scantailor-experimental.app/Contents/PlugIns/styles/
# Remove headers to reduce bundle size
du -sh ./install/scantailor-experimental.app/
find ./install -name "Headers" -type d -exec rm -rf {} + 2>/dev/null || true
du -sh ./install/scantailor-experimental.app/
ls -la ./install/
mkdir -p ./dmg-temp
cp -R ./install/scantailor-experimental.app ./dmg-temp/
ln -s /Applications ./dmg-temp/Applications
hdiutil create -volname "ScanTailor Experimental" \
-srcfolder ./dmg-temp \
-ov \
-format UDZO \
./scantailor-experimental.dmg
rm -rf ./dmg-temp
ls -la ./scantailor-experimental.dmg
Not sure how I can upload 32MB dmg file...just to a fileupload service I guess. App works fine with latest build. Built without openCL but don't think that's a huge deal. 75MB file size cuz took out headers which would've been 92MB.
scantailor-experimental-1.2025.07.07.dmg 32MB
https://files.fm/u/2ruyswpmj3 expires 08-11
https://limewire.com/d/5jYNV#Jd2AWIrmyS expires 08-13
Tested and works fine.
mkdir -p dump ; nice pdftoppm -tiff -tiffcompression adeflate -scale-to 3508 *.pdf dump/img
use scantailor experimental then after outputting
mkdir final ; nice img2pdf -S A4 dump/out/*.tif | ocrmypdf -O 2 --jbig2-lossy - final/output_ocr.pdf && rm -r dump/*
I meant "add commands to cmake project". Something like this:
file(REMOVE_RECURSE "INSTALLED_PKG_DIRECTORY/*.h")
Mr. cpack installs, mr. cmake removes, everyone is happy. And the user must compile the installer in one or two commands. One day I will have free time and I will do it. It's not hard, it's just stupid and it needs to be done.
@zvezdochiot
Есть смысл сборку под маки с нерабочим OpenCL закинуть в релизы?
Да.---------------- Кому: ImageProcessing-ElectronicPublications/scantailor-experimental @.); Копия: Mention @.); Тема: [ImageProcessing-ElectronicPublications/scantailor-experimental] macOS build is broken (Issue #60); 30.07.2025, 04:54, "noobie-iv" @.***>: noobie-iv left a comment (ImageProcessing-ElectronicPublications/scantailor-experimental#60) @zvezdochiot Есть смысл сборку под маки с нерабочим OpenCL закинуть в релизы?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>
-- звездочёт
After the upgrade I got some disk space to experiment. I installed sequioa on a virtual machines with intel and amd processors. The program compiles and opencl works.
The only mac feature is that you need to specify the paths to the OpenCL headers (homebrew writes about this during installation). But opencl-icd-loader stub, on the contrary, does not need to be installed.
My commands for building on a clean system:
- Install xcode command line tools
xcode-select --install
- Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Install libraries (not opencl-icd-loader):
brew install cmake ninja boost eigen libjpeg-turbo libtiff qt opencl-headers opencl-clhpp-headers
- Download scantailor:
git clone https://github.com/ImageProcessing-ElectronicPublications/scantailor-experimental/
- Configure:
cmake\
-S scantailor-experimental\
-B build\
-G Ninja\
-D ST_USE_QT6=ON\
-D ENABLE_OPENCL=ON\
-D ENABLE_OPENGL=ON\
-D CMAKE_C_FLAGS="-I /usr/local/opt/opencl-headers/include"\
-D CMAKE_CXX_FLAGS="-I /usr/local/opt/opencl-headers/include -I /usr/local/opt/opencl-clhpp-headers/include"
- Build dmg installer: (build/_CPack_Packages/Darwin/DragNDrop/scantailor-experimental-2025.07.07-Darwin.dmg)
cmake --build build --target package --parallel
All that remains is to clean the installer from unnecessary headers.
@karipov, @eatyourbaby, @mrfragger, @gasparschott
Can you test the build on your systems? If the build works, it can be added to the release. I can only add the intel version.
cmake\
-S scantailor-experimental\
-B build\
-G Ninja\
-D ST_USE_QT6=ON\
-D ENABLE_OPENCL=ON\
-D ENABLE_OPENGL=ON\
-D CMAKE_C_FLAGS="-I /usr/local/opt/opencl-headers/include"\
-D CMAKE_CXX_FLAGS="-I /usr/local/opt/opencl-headers/include -I /usr/local/opt/opencl-clhpp-headers/include"
-- The C compiler identification is AppleClang 16.0.0.16000026
-- The CXX compiler identification is AppleClang 16.0.0.16000026
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenGL: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenGL.framework
-- Looking for CL_VERSION_3_0
-- Looking for CL_VERSION_3_0 - not found
-- Looking for CL_VERSION_2_2
-- Looking for CL_VERSION_2_2 - not found
-- Looking for CL_VERSION_2_1
-- Looking for CL_VERSION_2_1 - not found
-- Looking for CL_VERSION_2_0
-- Looking for CL_VERSION_2_0 - not found
-- Looking for CL_VERSION_1_2
-- Looking for CL_VERSION_1_2 - not found
-- Looking for CL_VERSION_1_1
-- Looking for CL_VERSION_1_1 - not found
-- Looking for CL_VERSION_1_0
-- Looking for CL_VERSION_1_0 - not found
-- Found OpenCL: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenCL.framework
-- Found Eigen3: /opt/homebrew/include/eigen3 (Required is at least version "2.91.0")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Failed
-- Performing Test HAVE_STDATOMIC_WITH_LIB
-- Performing Test HAVE_STDATOMIC_WITH_LIB - Failed
-- Found WrapAtomic: TRUE
-- Found WrapOpenGL: TRUE
-- Found WrapVulkanHeaders: /opt/homebrew/include
-- Found Cups: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libcups.tbd (found version "2.3.4")
-- Found ZLIB: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libz.tbd (found version "1.2.12")
-- Found TIFF: /opt/homebrew/lib/libtiff.dylib (found version "4.7.0")
-- Found JPEG: /opt/homebrew/lib/libjpeg.dylib (found version "80")
-- Configuring done (2.0s)
-- Generating done (0.2s)
-- Build files have been written to: /Users/me/Downloads/build
m1:Downloads me$ cmake --build build --target package --parallel
[17/494] Building CXX object src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o
FAILED: [code=1] src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_XML_LIB -I/Users/me/Downloads/build/src/foundation/foundation_autogen/include -I/Users/me/Downloads/scantailor-experimental/src -I/Users/me/Downloads/scantailor-experimental/src/foundation -I/Users/me/Downloads/scantailor-experimental/src/math -I/Users/me/Downloads/scantailor-experimental/src/interaction -I/Users/me/Downloads/scantailor-experimental/src/zones -I/Users/me/Downloads/build -I/Users/me/Downloads/build/src -I/Users/me/Downloads/build/src/ui -I/Users/me/Downloads/build/src/foundation -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/lib/QtGui.framework/Headers -iframework /opt/homebrew/lib -isystem /opt/homebrew/lib/QtCore.framework/Headers -isystem /opt/homebrew/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/lib/QtXml.framework/Headers -I /usr/local/opt/opencl-headers/include -I /usr/local/opt/opencl-clhpp-headers/include -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o -MF src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o.d -o src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o -c /Users/me/Downloads/scantailor-experimental/src/foundation/AutoRemovingFile.cpp
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/AutoRemovingFile.cpp:19:
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/AutoRemovingFile.h:22:
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/foundation_config.h:4:
In file included from /opt/homebrew/lib/QtCore.framework/Headers/QtGlobal:1:
/opt/homebrew/lib/QtCore.framework/Headers/qglobal.h:13:12: fatal error: 'type_traits' file not found
13 | # include <type_traits>
| ^~~~~~~~~~~~~
1 error generated.
[19/494] Building CXX object src/foundation/CMakeFiles/foundation.dir/ObjectSwapperFactory.cpp.o
FAILED: [code=1] src/foundation/CMakeFiles/foundation.dir/ObjectSwapperFactory.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_XML_LIB -I/Users/me/Downloads/build/src/foundation/foundation_autogen/include -I/Users/me/Downloads/scantailor-experimental/src -I/Users/me/Downloads/scantailor-experimental/src/foundation -I/Users/me/Downloads/scantailor-experimental/src/math -I/Users/me/Downloads/scantailor-experimental/src/interaction -I/Users/me/Downloads/scantailor-experimental/src/zones -I/Users/me/Downloads/build -I/Users/me/Downloads/build/src -I/Users/me/Downloads/build/src/ui -I/Users/me/Downloads/build/src/foundation -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/lib/QtGui.framework/Headers -iframework /opt/homebrew/lib -isystem /opt/homebrew/lib/QtCore.framework/Headers -isystem /opt/homebrew/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/lib/QtXml.framework/Headers -I /usr/local/opt/opencl-headers/include -I /usr/local/opt/opencl-clhpp-headers/include -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/foundation/CMakeFiles/foundation.dir/ObjectSwapperFactory.cpp.o -MF src/foundation/CMakeFiles/foundation.dir/ObjectSwapperFactory.cpp.o.d -o src/foundation/CMakeFiles/foundation.dir/ObjectSwapperFactory.cpp.o -c /Users/me/Downloads/scantailor-experimental/src/foundation/ObjectSwapperFactory.cpp
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/ObjectSwapperFactory.cpp:19:
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/ObjectSwapperFactory.h:22:
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/foundation_config.h:4:
In file included from /opt/homebrew/lib/QtCore.framework/Headers/QtGlobal:1:
/opt/homebrew/lib/QtCore.framework/Headers/qglobal.h:13:12: fatal error: 'type_traits' file not found
13 | # include <type_traits>
| ^~~~~~~~~~~~~
1 error generated.
[20/494] Building CXX object src/foundation/CMakeFiles/foundation.dir/ObjectSwapperImplQImage.cpp.o
FAILED: [code=1] src/foundation/CMakeFiles/foundation.dir/ObjectSwapperImplQImage.cpp.o
/usr/bin/c++ -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_XML_LIB -I/Users/me/Downloads/build/src/foundation/foundation_autogen/include -I/Users/me/Downloads/scantailor-experimental/src -I/Users/me/Downloads/scantailor-experimental/src/foundation -I/Users/me/Downloads/scantailor-experimental/src/math -I/Users/me/Downloads/scantailor-experimental/src/interaction -I/Users/me/Downloads/scantailor-experimental/src/zones -I/Users/me/Downloads/build -I/Users/me/Downloads/build/src -I/Users/me/Downloads/build/src/ui -I/Users/me/Downloads/build/src/foundation -isystem /opt/homebrew/include/eigen3 -isystem /opt/homebrew/include -isystem /opt/homebrew/lib/QtGui.framework/Headers -iframework /opt/homebrew/lib -isystem /opt/homebrew/lib/QtCore.framework/Headers -isystem /opt/homebrew/share/qt/mkspecs/macx-clang -isystem /opt/homebrew/lib/QtXml.framework/Headers -I /usr/local/opt/opencl-headers/include -I /usr/local/opt/opencl-clhpp-headers/include -O3 -DNDEBUG -std=gnu++17 -arch arm64 -DEIGEN_MPL2_ONLY -MD -MT src/foundation/CMakeFiles/foundation.dir/ObjectSwapperImplQImage.cpp.o -MF src/foundation/CMakeFiles/foundation.dir/ObjectSwapperImplQImage.cpp.o.d -o src/foundation/CMakeFiles/foundation.dir/ObjectSwapperImplQImage.cpp.o -c /Users/me/Downloads/scantailor-experimental/src/foundation/ObjectSwapperImplQImage.cpp
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/ObjectSwapperImplQImage.cpp:19:
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/ObjectSwapperImplQImage.h:22:
In file included from /Users/me/Downloads/scantailor-experimental/src/foundation/foundation_config.h:4:
In file included from /opt/homebrew/lib/QtCore.framework/Headers/QtGlobal:1:
/opt/homebrew/lib/QtCore.framework/Headers/qglobal.h:13:12: fatal error: 'type_traits' file not found
13 | # include <type_traits>
| ^~~~~~~~~~~~~
1 error generated.
[26/494] Automatic MOC for target output
ninja: build stopped: subcommand failed.
It's very strange error. Missing standard c++ header. How is this possible? This looks like a damaged xcode/homebrew/qt installation. Maybe it's dark magic?
-
Idea №1
Here is the simple test program:
test.cpp
#include <type_traits> int main(){}Does it compile?
clang++ test.cpp -
Idea №2
Maybe the command line for building the file was somehow incorrect.
Open file /build/build.ninja and search "AutoRemovingFile.cpp" build string. Mine looks like this:
build src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o: CXX_COMPILER__foundation_unscanned_Release /Users/user/Programming/scantailor-experimental/src/foundation/AutoRemovingFile.cpp || cmake_object_order_depends_target_foundation CONFIG = Release DEFINES = -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION -DBOOST_TEST_DYN_LINK -DEIGEN_DONT_ALIGN_STATICALLY -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_XML_LIB DEP_FILE = src/foundation/CMakeFiles/foundation.dir/AutoRemovingFile.cpp.o.d FLAGS = -I /usr/local/opt/opencl-headers/include -I /usr/local/opt/opencl-clhpp-headers/include -O3 -DNDEBUG -std=gnu++17 -DEIGEN_MPL2_ONLY -fPIC INCLUDES = -I/Users/user/Programming/build/src/foundation/foundation_autogen/include -I/Users/user/Programming/scantailor-experimental/src -I/Users/user/Programming/scantailor-experimental/src/foundation -I/Users/user/Programming/scantailor-experimental/src/math -I/Users/user/Programming/scantailor-experimental/src/interaction -I/Users/user/Programming/scantailor-experimental/src/zones -I/Users/user/Programming/build -I/Users/user/Programming/build/src -I/Users/user/Programming/build/src/ui -I/Users/user/Programming/build/src/foundation -isystem /usr/local/include/eigen3 -isystem /usr/local/lib/QtGui.framework/Headers -iframework /usr/local/lib -isystem /usr/local/lib/QtCore.framework/Headers -isystem /usr/local/share/qt/mkspecs/macx-clang -isystem /usr/local/lib/QtXml.framework/Headers OBJECT_DIR = src/foundation/CMakeFiles/foundation.dir OBJECT_FILE_DIR = src/foundation/CMakeFiles/foundation.dir TARGET_COMPILE_PDB = src/foundation/CMakeFiles/foundation.dir/foundation.pdb TARGET_PDB = src/foundation/libfoundation.pdbWhat does yours look like?
-
Idea №3
We also have slightly different paths (my /opt directory is completely empty):
-- Found Eigen3: /usr/local/include/eigen3 (Required is at least version "2.91.0") vs -- Found Eigen3: /opt/homebrew/include/eigen3 (Required is at least version "2.91.0")What version of operating system and xcode do you have? I can install the same on the virtual machine.
yea I give up...it works fine on Mac OS 15 and seems fast without OpenCL the build I posted above...I do remember using either MacOS 13 or 14 and it did seem to make a 10% speed up with thumbnails being generated. So for Mac versions older an OpenCL would be beneficial a little.
OpenCL is Deprecated on macOS: Apple wants developers to use its Metal framework instead.
For backward compatibility, the OpenCL library (OpenCL.framework) still exists,
but the header files (cl.h, cl.hpp, etc.) are missing.
Homebrew to the Rescue: You can install the missing headers using Homebrew.
opencl-headers: Provides the C headers (<OpenCL/cl.h>).
opencl-clhpp-headers: Provides the official C++ wrapper headers (<CL/cl.hpp>).
Path Differences:
On Intel Macs, Homebrew is at /usr/local.
On Apple Silicon Macs, Homebrew is at /opt/homebrew.
The Solution: Smarter CMake
Instead of passing -D CMAKE_..._FLAGS manually, we will teach CMake where
to look for Homebrew packages. The standard way to do this is by setting CMAKE_PREFIX_PATH.
Here is the modified CMakeLists.txt code. You should place this block before your INCLUDE(FindOpenCL) line.
Updated CMakeLists.txt
cmake_minimum_required(VERSION 3.15)
project(YourProjectName)
# =========================================================================
# NEW SECTION: Help CMake find OpenCL headers on macOS via Homebrew
# Place this at the top of your CMakeLists.txt, before FindOpenCL
# =========================================================================
IF(APPLE)
# Hint to CMake where to find packages installed by Homebrew.
# This list covers both Apple Silicon (/opt/homebrew) and Intel (/usr/local).
# CMake will automatically check inside these paths for includes, libs, etc.
LIST(APPEND CMAKE_PREFIX_PATH "/opt/homebrew" "/usr/local")
ENDIF()
# =========================================================================
INCLUDE(FindOpenCL)
CMAKE_DEPENDENT_OPTION(
ENABLE_OPENCL "OpenCL may be used for acceleration of image processing" ON
"OpenCL_FOUND" OFF
)
IF(ENABLE_OPENCL)
# This tells FindOpenCL to find the C++ headers (cl.hpp) as well.
SET(OpenCL_USE_CPP_BINDINGS ON)
SET(OPENCL_VERSION 120 CACHE STRING "OpenCL version. Default is 120")
MARK_AS_ADVANCED(OPENCL_VERSION)
ENDIF()
# FindOpenCL on Apple needs a little more help to link correctly
IF(OpenCL_FOUND AND APPLE)
# The OpenCL library is part of the system OpenCL.framework
find_library(OpenCL_LIBRARY OpenCL)
SET(OpenCL_LIBRARIES ${OpenCL_LIBRARY})
ENDIF()
# --- All your other CMake code follows ---
SET(CMAKE_AUTOMOC ON)
IF(ST_USE_QT6 STREQUAL "ON")
SET(qt_min_version 6.2.2)
FIND_PACKAGE(Qt6Core ${qt_min_version} REQUIRED)
FIND_PACKAGE(Qt6Gui ${qt_min_version} REQUIRED)
# ... (rest of your Qt configuration)
ELSE()
SET(qt_min_version 5.3)
FIND_PACKAGE(Qt5Core ${qt_min_version} REQUIRED)
FIND_PACKAGE(Qt5Gui ${qt_min_version} REQUIRED)
# ... (rest of your Qt configuration)
ENDIF()
# --- Example of how to link against OpenCL ---
# add_executable(my_app main.cpp)
#
# IF(OpenCL_FOUND)
# target_include_directories(my_app PUBLIC ${OpenCL_INCLUDE_DIRS})
# target_link_libraries(my_app PRIVATE ${OpenCL_LIBRARIES})
# ENDIF()
Is this chatgpt code?
What is OpenCL_USE_CPP_BINDINGS? There is nothing like this in either the opencl headers or the cmake folders. So this doesn't work for me: "fatal error: 'CL/cl.h' file not found".
The problem with opencl in macos is that its headers are incomplete. But cmake finds these incomplete headers and stops searching further. Therefore, the headers installed by homebrew are not included in the project.
message("********** OpenCL_LIBRARY = ${OpenCL_LIBRARY} **********")
message("********** OpenCL_INCLUDE_DIRS = ${OpenCL_INCLUDE_DIRS} **********")
********** OpenCL_LIBRARY = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenCL.framework **********
********** OpenCL_INCLUDE_DIRS = /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenCL.framework **********
If there really was an OpenCL_USE_CPP_BINDINGS parameter that would force the search to continue, it would help. But it looks like the AI just made it up.
scantailor-experimental-1.2025.07.07 doesn't launch on Monterey 12.7.6:
But there is no such limitations into the Info.plist:
Qt 6 limitations? Pls, note this in the comments to the release. But maybe this will help?
@yozhic
The problem is probably in the processor, not the progrqm version. Here is the build for the Intel processor - does it work?