Opened 4 years ago

Closed 4 years ago

#62462 closed defect (fixed)

opencv4 upgrade fails

Reported by: dershow Owned by: stromnov (Andrey Stromnov)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: mascguy (Christopher Nielsen), cjones051073 (Chris Jones)
Port: opencv4

Description

I have 4.5.0_5 installed and just tried to upgrade to 4.5.1_0. But, it fails with a bunch of implicit conversion errors. Log is attached.

Attachments (1)

main.log (1.3 MB) - added by dershow 4 years ago.

Download all attachments as: .zip

Change History (11)

Changed 4 years ago by dershow

Attachment: main.log added

comment:1 Changed 4 years ago by mf2k (Frank Schima)

Cc: mascguy added; stromnov removed
Owner: set to stromnov
Status: newassigned

comment:2 Changed 4 years ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:3 Changed 4 years ago by mascguy (Christopher Nielsen)

Based on what I'm seeing in the build log, it looks like opencv4 is referencing headers provided by opencv. This only occurs when opencv4 is built from source, AND opencv is already installed.

To fix the issue, do the following:

  • Forcibly deactivate opencv (via sudo port -f deactivate opencv);
  • Upgrade opencv4 (via sudo port upgrade opencv4);
  • Reactivate opencv (via sudo port activate opencv).

Let us know if that fixes the problem.

comment:4 Changed 4 years ago by mascguy (Christopher Nielsen)

Maintainers: This problem will be eliminated once all dependent ports have been migrated from opencv to opencv3. The latter is fully isolated, to avoid possible clashes like this.

But if we want to fix this ASAP, it might be possible to do so via one or more CMake arguments. Haven't looked yet, but my guess is that it might be possible...

comment:5 Changed 4 years ago by cjones051073 (Chris Jones)

Note that the builds are also failing in the buildbots for mac OS 10.12 and older

https://build.macports.org/builders/ports-10.12_x86_64-builder/builds/140821/steps/install-port/logs/stdio

Maybe for different reasons

comment:6 Changed 4 years ago by mascguy (Christopher Nielsen)

We may want to revert back to 4.5.0 for now, as 4.5.1 also breaks the contrib variant.

The contrib-related issue is mentioned in the following ticket:

issue:61908

comment:7 Changed 4 years ago by mascguy (Christopher Nielsen)

The compilation error on the 10.12 buildbot is as follows:

In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/imgcodecs/src/macosx_conversions.mm:6:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/imgcodecs/src/apple_conversions.h:8:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core.hpp:54:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/base.hpp:58:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvstd.hpp:81:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvstd_wrapper.hpp:45:160: error: too many arguments provided to function-like macro invocation
    static CV_CONSTEXPR std::true_type check(typename std::is_same<typename std::decay<decltype(std::declval<T>().operator()(std::declval<Args>()...))>::type, Ret>::type*);
                                                                                                                                                               ^
/usr/include/AssertMacros.h:1291:10: note: macro 'check' defined here
        #define check(assertion)  __Check(assertion)
                ^
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/imgcodecs/src/macosx_conversions.mm:6:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/imgcodecs/src/apple_conversions.h:8:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core.hpp:54:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/base.hpp:58:
In file included from /opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvstd.hpp:81:
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvstd_wrapper.hpp:45:40: warning: variable templates are a C++14 extension [-Wc++14-extensions]
    static CV_CONSTEXPR std::true_type check(typename std::is_same<typename std::decay<decltype(std::declval<T>().operator()(std::declval<Args>()...))>::type, Ret>::type*);
                                       ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvstd_wrapper.hpp:45:40: error: declaration of constexpr static data member 'check' requires an initializer
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvstd_wrapper.hpp:47:31: error: constexpr can only be used in variable and function declarations
    template<typename> static CV_CONSTEXPR std::false_type check(...);
                              ^
/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/cvdef.h:757:26: note: expanded from macro 'CV_CONSTEXPR'
#    define CV_CONSTEXPR constexpr
                         ^

With the following potential hint:

/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_graphics_opencv4/opencv4/work/opencv-4.5.1/modules/core/include/opencv2/core/utility.hpp:53:4: warning: Detected Apple 'check' macro definition, it can cause build conflicts. Please, include this header before any Apple headers. [-W#warnings]
#  warning Detected Apple 'check' macro definition, it can cause build conflicts. Please, include this header before any Apple headers.
   ^

Not yet sure whether the errors are caused by header file include order (per the hint), the C++ standard declaration, Xcode Clang 9.0, or...

Need to do more digging...

comment:8 Changed 4 years ago by mascguy (Christopher Nielsen)

@cjones051073, it looks like a patch was committed for the build errors on 3/20? I'm also seeing a published binary for 10.12 with that date.

Can you confirm that we're all good...?

comment:9 Changed 4 years ago by mascguy (Christopher Nielsen)

Folks, I believe this defect can be closed, as binaries are being successfully built across-the-board.

comment:10 Changed 4 years ago by Christopher Nielsen <mascguy@…>

Resolution: fixed
Status: assignedclosed

In 4925e5bcf01f19c67cb27015829db9a2c8f6d488/macports-ports (master):

opencv3: update to 3.4.14; fix paths in pkgconfig
Fixes: #62462
Fixes: #61908

Note: See TracTickets for help on using tickets.