Ask Your Question
0

Build another OpenCV 3 library for a different Python interpreter in the same computer

asked 2016-09-08 16:24:51 -0600

Hilman gravatar image

I am using Mac and already installed a computer vision library, OpenCV 3 for my computer (system-wide) and it is compiled with support for Python 2 interpreter. I am now, want to build another OpenCV 3 library, reusing that same git clone of OpenCV, that will be compiled for the Python 3 interpreter. I want to build/install it locally. Before I do anything, I want to confirm if my step would be right since I want to prevent any file tanglation.

  1. It is said that I have to delete the CMakeCache.txt file inside the build folder of my previous build in order to build the new OpenCV. Is it true? I mean, my previous build folder (for Python 2) is inside the repo folder such that ~/opencv/build, but shouldn't it be just fine?
  2. I know I have to set up the flag CMAKE_INSTALL_PREFIX to somewhere else, but as long as I do not make install, it should be just fine, isn't? Since I believe that flag is just to set up the make install target.
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-09-08 23:31:27 -0600

berak gravatar image
    • you could simply use a new, build_2nd folder, and leave your original configuration intact.
    • for python, yes, you probably do not need to "install" it, but rather just take the cv2.so, and copy it to your desired location manually
edit flag offensive delete link more

Comments

1

if it's the correct one, - sure.

also please make sure, that you build with cmake -DBUILD_SHARED_LIBS=OFF, so the cv2.so is a standalone, does not need further(versioned) opencv so's

berak gravatar imageberak ( 2016-09-09 05:28:49 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-08 16:24:51 -0600

Seen: 261 times

Last updated: Sep 08 '16