You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "martinzink (via GitHub)" <gi...@apache.org> on 2023/10/27 14:20:33 UTC

[PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

martinzink opened a new pull request, #1694:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694

   Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced
        in the commit message?
   
   - [ ] Does your PR title start with MINIFICPP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically main)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   ### For code changes:
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   - [ ] If applicable, have you updated the LICENSE file?
   - [ ] If applicable, have you updated the NOTICE file?
   
   ### For documentation related changes:
   - [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI results for build issues and submit an update to your PR as soon as possible.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink commented on code in PR #1694:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694#discussion_r1375923433


##########
extensions/opencv/CMakeLists.txt:
##########
@@ -32,6 +32,10 @@ add_library(minifi-opencv SHARED ${SOURCES})
 
 target_link_libraries(minifi-opencv ${LIBMINIFI})
 target_link_libraries(minifi-opencv OPENCV::libopencv)
+if (APPLE)
+    target_link_libraries(minifi-opencv "-framework AVFoundation" "-framework CoreFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework Foundation" "-framework OpenCL")
+    target_link_libraries(minifi-opencv -llapack -lblas)

Review Comment:
   Good point, I've moved these into BundledOpenCV instead. https://github.com/apache/nifi-minifi-cpp/pull/1694/commits/56aa70c970d2c68ce02cac0688bd62bea4a43bd6
   
   For the requirement of blas and lapack, it does seem opencv requires them both
   But after reading through opencv macOS related issues it seems its recommended to use the Accelerate framework instead of manually linking these libs.
   https://github.com/apache/nifi-minifi-cpp/pull/1694/commits/834c5f438fed1804320b3c211681014c6f9499e8



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #1694:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694#discussion_r1375270870


##########
extensions/opencv/CMakeLists.txt:
##########
@@ -32,6 +32,10 @@ add_library(minifi-opencv SHARED ${SOURCES})
 
 target_link_libraries(minifi-opencv ${LIBMINIFI})
 target_link_libraries(minifi-opencv OPENCV::libopencv)
+if (APPLE)
+    target_link_libraries(minifi-opencv "-framework AVFoundation" "-framework CoreFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework Foundation" "-framework OpenCL")
+    target_link_libraries(minifi-opencv -llapack -lblas)

Review Comment:
   Are these the dependencies of OpenCV itself? If so, it should be handled on the OpenCV lib target. Ideally the OpenCV project itself would link these to itself, or advertise them as required.
   
   Also, why are two linear algebra libraries needed? As far as I understand, they are similar and serve the same purpose, like yacc and bison.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

Posted by "martinzink (via GitHub)" <gi...@apache.org>.
martinzink commented on code in PR #1694:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694#discussion_r1380397301


##########
cmake/BundledOpenCV.cmake:
##########
@@ -210,5 +210,7 @@ function(use_bundled_opencv SOURCE_DIR BINARY_DIR)
 
     add_library(OPENCV::libopencv INTERFACE IMPORTED)
     target_link_libraries(OPENCV::libopencv INTERFACE OPENCV::libopencv-flann OPENCV::libopencv-dnn OPENCV::libopencv-objdetect OPENCV::libopencv-core OPENCV::libopencv-gapi OPENCV::libopencv-imgcodecs OPENCV::libopencv-calib3d OPENCV::libopencv-imgproc OPENCV::libopencv-photo OPENCV::libopencv-videoio OPENCV::libopencv-video OPENCV::libopencv-stitching OPENCV::libopencv-features2d)
-
+    if (APPLE)
+        target_link_libraries(OPENCV::libopencv INTERFACE "-framework AVFoundation" "-framework CoreFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework Foundation" "-framework OpenCL" "-framework Accelerate")

Review Comment:
   Afaik OpenCV handles this, I think we need this manual work due to our convoluted way of integrating opencv, I think we should be able to switch to fetchcontent but it wasnt trivial. 
   I'll create a new Jira and investigate how painful that would be.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

Posted by "fgerlits (via GitHub)" <gi...@apache.org>.
fgerlits closed pull request #1694: MINIFICPP-2260 Fix OpenCV extension build failure on macOS
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #1694:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694#discussion_r1375270870


##########
extensions/opencv/CMakeLists.txt:
##########
@@ -32,6 +32,10 @@ add_library(minifi-opencv SHARED ${SOURCES})
 
 target_link_libraries(minifi-opencv ${LIBMINIFI})
 target_link_libraries(minifi-opencv OPENCV::libopencv)
+if (APPLE)
+    target_link_libraries(minifi-opencv "-framework AVFoundation" "-framework CoreFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework Foundation" "-framework OpenCL")
+    target_link_libraries(minifi-opencv -llapack -lblas)

Review Comment:
   Are these the dependencies of OpenCV itself? If so, it should be handled on the OpenCV lib target. Ideally the OpenCV project itself would link these to itself, or advertise them as required.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] MINIFICPP-2260 Fix OpenCV extension build failure on macOS [nifi-minifi-cpp]

Posted by "szaszm (via GitHub)" <gi...@apache.org>.
szaszm commented on code in PR #1694:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1694#discussion_r1376573782


##########
cmake/BundledOpenCV.cmake:
##########
@@ -210,5 +210,7 @@ function(use_bundled_opencv SOURCE_DIR BINARY_DIR)
 
     add_library(OPENCV::libopencv INTERFACE IMPORTED)
     target_link_libraries(OPENCV::libopencv INTERFACE OPENCV::libopencv-flann OPENCV::libopencv-dnn OPENCV::libopencv-objdetect OPENCV::libopencv-core OPENCV::libopencv-gapi OPENCV::libopencv-imgcodecs OPENCV::libopencv-calib3d OPENCV::libopencv-imgproc OPENCV::libopencv-photo OPENCV::libopencv-videoio OPENCV::libopencv-video OPENCV::libopencv-stitching OPENCV::libopencv-features2d)
-
+    if (APPLE)
+        target_link_libraries(OPENCV::libopencv INTERFACE "-framework AVFoundation" "-framework CoreFoundation" "-framework CoreGraphics" "-framework CoreMedia" "-framework CoreVideo" "-framework Foundation" "-framework OpenCL" "-framework Accelerate")

Review Comment:
   What's the docs reference that suggests this list of frameworks to be llnked? I wonder why it's not handled in the opencv cmake scripts.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org