Closed stephane-archer closed 1 year ago
@JakubOchnik do you think disabling OPENEXR would cause a problem?
Hi, @stephane-archer. OpenEXR is not necessary (unless you use EXR images). Actually, I only use OpenCV for loading and saving the image, so I left only the required libraries: opencv_core
and opencv_imgcodecs
. That should make the process much easier for you and probably remove the need for OpenCL.
@JakubOchnik
I was able to build the last version of the project by reusing the previous version I had of OpenCV 4.8.0
then modifying src/CMakeLists.txt
the following way:
modified: src/CMakeLists.txt
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
@ src/CMakeLists.txt:17 @ message(STATUS "Boost include dir: ${Boost_INCLUDE_DIRS}")
find_package (Eigen3 3.3 REQUIRED NO_MODULE)
+ find_package(OpenCL REQUIRED)
# Detect include directories for the external libraries
if (BUILD_CUDA)
message(STATUS "CUDA include dir: ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}")
@ src/CMakeLists.txt:31 @ endif()
add_library(${MAIN_LIB_NAME} STATIC)
target_include_directories(${MAIN_LIB_NAME} PUBLIC ${INCLUDE_DIRS})
- target_link_libraries(${MAIN_LIB_NAME} PUBLIC ${LIBRARIES_TO_LINK})
+ target_link_libraries(${MAIN_LIB_NAME} PUBLIC
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/ippicv/ippicv_mac/icv/lib/intel64/libippicv.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/libippiw.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/libittnotify.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/liblibjpeg-turbo.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/liblibopenjp2.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/liblibpng.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/liblibtiff.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/liblibwebp.a
+ /Users/fractale/opencv-4.8.0/build_opencv/3rdparty/lib/libzlib.a
+ /Users/fractale/opencv-4.8.0/build_opencv/lib/libopencv_core.a
+ /Users/fractale/opencv-4.8.0/build_opencv/lib/libopencv_imgcodecs.a
+ /Users/fractale/opencv-4.8.0/build_opencv/lib/libopencv_imgproc.a
OpenCL::OpenCL
Boost::program_options
Eigen3::Eigen
)
add_subdirectory(${SOURCE_DIR}/ImageProcessing)
add_subdirectory(${SOURCE_DIR}/TaskDispatcher)
$ otool -L build/src/lut_loader
/System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1500.65.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
As you can see OpenCL is still a dependency but it didn't cause me any issue for now
I struggled to build the project with OpenCV as a static library. Here is how I was able to do it. I downloaded OpenCV 4.8.0 source files. I build it with
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DWITH_OPENEXR=OFF ../
(OpenExr was causing linking issues) Then I added all the.a
files from OpenCV tosrc/CMakeLists.txt
like this:I had to add OpenCL as a dependency too at the end here are the libs that are still dynamically loaded:
(which is fine, I wanted to remove OpenCV but I don't know yet if dynamically linking to OpenCL would cause any issues)