Ask Your Question
1

Option: BUILD_opencv_python3 missing from cmake-gui

asked 2019-11-04 12:51:42 -0600

Martian gravatar image

I've downloaded versions of OpenCV 4.1.2 a few days apart. The earlier version has a cmake-gui option:

BUILD_opencv_python3:BOOL=ON

It is not present in today's version (2019 nov 04). It's not that it's switched off--the option does not appear at all. I'm not sure of its exact function (anyone?) but since it had defaulted to ON in the previous download, it sounded significant.

Another new flag is present in today's build:

OPENCV_ENABLE_MEMALIGN:BOOL=ON

I'm not as concerned about that, but it does indicate that some things have changed.

edit retag flag offensive close merge delete

Comments

did it build any python3 bindings for you ?

not for me (instantly), since i already had an older opencv code.base around.

i had to remove build/CMakeCache.txt and build/CMakeVars.txt, and start all over with cmake (the python detection cseems to have changed indeed !), to make it work

berak gravatar imageberak ( 2019-11-04 13:43:07 -0600 )edit
1

The build folder was completely clear at the start. Fresh install.

I just got as far as the 'configure' process, so I don't know if it would build python bindings. I didn't want to bother with building until I get the flags right.

Is there some detection criterion that would completely remove that python3 option from the cmake-gui menu?

Martian gravatar imageMartian ( 2019-11-04 14:33:51 -0600 )edit

PS: I wish there was some definitive doc on all the OpenCV cmake build flags. The most agonizing build process ever.

Martian gravatar imageMartian ( 2019-11-04 14:42:37 -0600 )edit

@berak: Is the exact purpose and function of that flag defined somwhere? Also, do you know if it would be affected by use of Anaconda Python rather than the stock python install?

Martian gravatar imageMartian ( 2019-11-05 00:24:36 -0600 )edit

@Martian, -- idk. i only stumbled over a related problem yesterday.

anaconda

i'm not a python person, but i tend to avoid anaconda like the dependancy cancer it is...

berak gravatar imageberak ( 2019-11-05 01:36:02 -0600 )edit

Ouch! I've been working in C++, but I've always liked Anaconda's python implementation, as it seems like they have a unified approach. As far as I know, it's basically the stock python release, with additional packages added. And Conda of course. I've seen it used quite a bit in research.

As far as dependencies... I thought that was one thing in its -plus- column, in that the packages were already version-coordinated to work together. And Conda seems to have a higher level notion of interdependencies than does pip.

In this case, the option vanished between two builds of OpenCV 4.1.2, just days apart. This is why I hate doing OpenCV builds.

Do you know of any description of the exact function of that 'BUILD_opencv_python3' flag?

Martian gravatar imageMartian ( 2019-11-05 05:59:20 -0600 )edit

actually, after a couple of cmake runs, i DO have a BUILD_opencv_python3 option, and it is ON

berak gravatar imageberak ( 2019-11-05 07:16:24 -0600 )edit

Oh geez, It's OpenCV's random installation generator at work again. I've seen that before too.

Can you tell what difference that flag made in the build process?

Martian gravatar imageMartian ( 2019-11-05 09:28:21 -0600 )edit

@berak: What did you do to get the BUILD_opencv_python3 option to reappear?

Martian gravatar imageMartian ( 2019-11-06 22:00:05 -0600 )edit

@berak: Did you ever figure out what caused the BUILD_opencv_python3 option to reappear? It never came back for me.

Martian gravatar imageMartian ( 2019-11-21 04:15:18 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-12-15 12:43:34 -0600

Martian gravatar image

A: I believe that this was caused by problems with CMake/CMake-Gui interaction with Anaconda python. I already had Anaconda installed during the first attempted builds of OpenCV 4.1.2, which did have the BUILD_opencv_python3 option. So I'm guessing that moving the Anaconda folder forward, toward the beginning of the path, was what caused the problem. (Note that this is probably not the case for Berak's build above)

Unfortunately, this is not the only place where Cmake has problems interpreting the Anaconda installation. It also resulted in several Anaconda folders 'shadowing' correct folders within Cmake options. Initially, I hunted for all of those and set the correct options by hand. But that's no fun on repeated builds. So I've had to remove Anaconda from the path, which inexplicably restored the BUILD_opencv_python3 option.

This is unfortunate, since Anaconda is preferred by many doing neural net research. I do hope that programmers on the Cmake and Anaconda teams can coordinate and get their code to cooperate in the future. But for now, it seems to be an inherent incompatibility.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-11-04 12:51:42 -0600

Seen: 2,024 times

Last updated: Dec 15 '19