[Cin] CinGG + OpenCV build fails with old gphoto includes

Good Guy good1.2guy at gmail.com
Fri Nov 1 16:28:12 CET 2019


Hi,
Well your a brave soul to try to make opencv build.

As it turns out, I am going to try (yet again) to get opencv to build at
the current level in their repo (4.1.2)
To build it, you need opencv  and opencv_contrib.  The only version which
consistently has built is 3.4.1
which also still contains surf and sift.  These two functions were deleted
over a patent and are used in
findobj.  They are currently ifdef'd out to avoid any dispute.  A few years
ago I sent in a bug report to opencv
to point out a segv in code that is downloaded as a binary library (ipp)
where they do not release source.
The bug title was " 'almost' open cv ", but it should be " mostly closed cv
".  They changed the bug title.
They actually removed source which we were using.  Definitely not open.

Anyway...  I digress.

The build for opencv is invoked from the *obj plugin makefiles via the
"include $(TOPDIR)/opencv_build"
It will build opencv when the demand occurs, since the default is to not
build opencv plugins.  They are
expensive and complicated to build.  The newer versions require an include
path change in opencv_build
which is currently commented out.  beware that the build uses the network
to download the "binary" closed
source components for the build, and a few other tools that are just not
included.  If you use:
  -DWITH_IPP=OFF
the huge hidden library is factored out, but it runs much more slowly.  The
ipp library is "intel proprietary poop".
Once the build has operated, you can see the downloaded files in a hidden
directory ./.cache

Sooo... ( I did a test build and this did work on my devel system this
morning)
To get the build we used this month,
  ./configure --with-single-user --enable-static-build \
    --with-opencv=sta,tar=
https://www.cinelerra-gg.org/download/opencv/opencv-20180401.tgz

to get the 4.x.x version to work, you need to uncomment the:
#CFLAGS += -I$(opencv_prefix)/include/opencv4
lines (two of them) in the opencv_build file before you run the build.
Before you this, you will first need to create a tarball
with both opencv and opencv_contrib in the build.

By chance, I was actually getting set to try again on opencv 4.x.x since it
now is early in the month,
and I have a while to get it to build and to test it.  If you are
interested in this build, I will post the new
tarball in the download area if I can get usable results.   It may take a
few hours, but I will let you know
once I have updated and reworked the build.

gg
PS.
I am not sure about the compiler options (or clang).
It is hard enough just to get it to build in the first place.



On Fri, Nov 1, 2019 at 7:55 AM Andrew Randrianasulu <randrianasulu at gmail.com>
wrote:

> Hello!
>
> I tried to rebuild CinGG with OpenCV plugins, yet build failed like this:
>
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:
> В функции-члене «void cv::gphoto2::DigitalCameraCapture::initContext()»:
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:323:66:
> ошибка: некорректное преобразование из «void (*)(GPContext*, const char*,
> void*) {aka void (*)(_GPContext*, const char*, void*)}» в
> «GPContextErrorFunc {aka void (*)(_GPContext*, const char*, char*, void*)}»
> [-fpermissive]
>      gp_context_set_error_func(context, ctxErrorFunc, (void*) this);
>                                                                   ^
> In file included from /usr/include/gphoto2/gphoto2-abilities-list.h:28:0,
>                  from /usr/include/gphoto2/gphoto2-library.h:28,
>                  from /usr/include/gphoto2/gphoto2.h:49,
>                  from
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:32:
> /usr/include/gphoto2/gphoto2-context.h:113:6: замечание:   при
> инициализации 2 -го аргумента «void gp_context_set_error_func(GPContext*,
> GPContextErrorFunc, void*)»
>  void gp_context_set_error_func     (GPContext *context,
>       ^
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:324:68:
> ошибка: некорректное преобразование из «void (*)(GPContext*, const char*,
> void*) {aka void (*)(_GPContext*, const char*, void*)}» в
> «GPContextStatusFunc {aka void (*)(_GPContext*, const char*, char*,
> void*)}» [-fpermissive]
>      gp_context_set_status_func(context, ctxStatusFunc, (void*) this);
>                                                                     ^
> In file included from /usr/include/gphoto2/gphoto2-abilities-list.h:28:0,
>                  from /usr/include/gphoto2/gphoto2-library.h:28,
>                  from /usr/include/gphoto2/gphoto2.h:49,
>                  from
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:32:
> /usr/include/gphoto2/gphoto2-context.h:115:6: замечание:   при
> инициализации 2 -го аргумента «void gp_context_set_status_func(GPContext*,
> GPContextStatusFunc, void*)»
>  void gp_context_set_status_func    (GPContext *context,
>       ^
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:325:70:
> ошибка: некорректное преобразование из «void (*)(GPContext*, const char*,
> void*) {aka void (*)(_GPContext*, const char*, void*)}» в
> «GPContextMessageFunc {aka void (*)(_GPContext*, const char*, char*,
> void*)}» [-fpermissive]
>      gp_context_set_message_func(context, ctxMessageFunc, (void*) this);
>                                                                       ^
> In file included from /usr/include/gphoto2/gphoto2-abilities-list.h:28:0,
>                  from /usr/include/gphoto2/gphoto2-library.h:28,
>                  from /usr/include/gphoto2/gphoto2.h:49,
>                  from
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:32:
> /usr/include/gphoto2/gphoto2-context.h:121:6: замечание:   при
> инициализации 2 -го аргумента «void gp_context_set_message_func(GPContext*,
> GPContextMessageFunc, void*)»
>  void gp_context_set_message_func   (GPContext *context,
>       ^
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:339:52:
> ошибка: нет декларации «gp_camera_autodetect» в этой области видимости
>          CR(gp_camera_autodetect(allDevices, context));
>                                                     ^
> /dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/modules/videoio/src/cap_gphoto2.cpp:248:27:
> замечание: in definition of macro «CR»
>      if ((r_0629c47b758 = (GPHOTO2_FUN)) < GP_OK) {\
>                            ^
> make[5]: ***
> [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_gphoto2.cpp.o]
> Ошибка 1
> make[5]: Выход из каталога
> `/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/build'
> make[4]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Ошибка 2
> make[4]: Выход из каталога
> `/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/build'
> make[3]: *** [all] Ошибка 2
> make[3]: Выход из каталога
> `/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv/build'
> make[2]: ***
> [/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/thirdparty/opencv.sta]
> Ошибка 2
> make[2]: Выход из каталога
> `/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1/plugins'
> make[1]: *** [all-recursive] Ошибка 1
> make[1]: Выход из каталога
> `/dev/shm/tmp/cinelerra-goodguy-20191101/cinelerra-5.1'
> make: *** [all] Ошибка 2
>
>
> I don't think gphoto2 actually needed for CinGG needs ?
>
> Will try to switch it off ....
>
> Also, question:
>
> can anyone build CinGG with gcc and  -fsanitize=address ?
>
> For me such build (if I added this switch to both CFLAGS and LDFLAGS)
> failed on gcc 5.5.0 ...
>
> Should I try with clang (llvm 8.0.1)?
>
> --
> Cin mailing list
> Cin at lists.cinelerra-gg.org
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20191101/0032fdba/attachment-0001.html>


More information about the Cin mailing list