aiscm icon indicating copy to clipboard operation
aiscm copied to clipboard

aiscm 0.24.2 does not build with OpenCV 4.6.0

Open andy-tai opened this issue 2 years ago • 5 comments

Hi I was trying to update OpenCV in guix to 4.6.0 from 4.5.4.

The Guix QA build checker shows aiscm would fail to build with OpenCV 4.6.0, with error

https://bordeaux.guix.gnu.org/build/6d64c5dc-818b-470d-b55c-be5b4cccf643

libtool: link: ( cd ".libs" && rm -f "libguile-aiscm-tensorflow.la" && ln -s "../libguile-aiscm-tensorflow.la" "libguile-aiscm-tensorflow.la" ) libtool: link: ( cd ".libs" && rm -f "libguile-aiscm-core.la" && ln -s "../libguile-aiscm-core.la" "libguile-aiscm-core.la" ) opencv.cpp:364:16: error: no member named 'drawAxis' in namespace 'cv::aruco' cv::aruco::drawAxis(img, camera, distortion, rvec, tvec, scm_to_double(scm_len));

Looking at OpenCV sources from 4.5.4 and 4.6.0, it appears

cv::aruco::drawAxis()

was an API in opencv-contrib and was removed around OpenCV 4.6.0 or so. It is probably an API not guaranteed to be stable.

Probably a good idea not to reference such APIs.

andy-tai avatar Feb 12 '23 22:02 andy-tai

Ok, I have removed the OpenCV bindings. I am not maintaining aiscm at the moment. The FFmpeg bindings also don't work with FFmpeg beyond 4.4.3.

wedesoft avatar Feb 14 '23 22:02 wedesoft

Should the configure.ac checks for opencv be removed as well then? at https://github.com/wedesoft/aiscm/blob/master/configure.ac#L83. it causes this at configure time:

checking for OPENCV... no
configure: error: Package requirements (opencv4 >= 4.1.0) were not met:

No package 'opencv4' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

apteryks avatar Mar 22 '23 20:03 apteryks

Removing these lines in autoconf.ac fixes the configure stage:

         (add-after 'unpack 'do-not-check-for-opencv
           (lambda _
             (substitute* "configure.ac"
               (("PKG_CHECK_MODULES\\(OPENCV.*") "")
               (("AC_SUBST\\(OPENCV_CFLAGS)") "")
               (("AC_SUBST\\(OPENCV_LIBS)") ""))))

But it then fails at

.7/bin/guile -L .. ../tests/integration/mandelbrot.scm
Backtrace:
           8 (primitive-load "/tmp/guix-build-guile-aiscm-0.25.1.drv…")
In ice-9/eval.scm:
   721:20  7 (primitive-eval (use-modules (aiscm opencv) (aiscm #) #))
In ice-9/psyntax.scm:
  1230:36  6 (expand-top-sequence ((use-modules (aiscm opencv) # #)) …)
  1222:19  5 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)
   259:10  4 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) …)
In ice-9/boot-9.scm:
  3927:20  3 (process-use-modules _)
   222:17  2 (map1 (((aiscm opencv)) ((aiscm magick)) ((aiscm #))))
  3928:31  1 (_ ((aiscm opencv)))
   3329:6  0 (resolve-interface (aiscm opencv) #:select _ #:hide _ # …)

ice-9/boot-9.scm:3329:6: In procedure resolve-interface:
no code for module (aiscm opencv)

apteryks avatar Mar 22 '23 20:03 apteryks

Ok, I had some more OpenCV samples in there, sorry about that. I just released 0.25.2 with the OpenCV samples removed.

wedesoft avatar Mar 22 '23 22:03 wedesoft

Thanks, building 0.25.2 without opencv was successful :-).

apteryks avatar Mar 23 '23 01:03 apteryks