Ask Your Question
0

Is it possible to build Opencv on one OS and install it on another?

asked 2018-06-27 02:30:53 -0600

opencv-newb gravatar image

updated 2018-06-27 02:31:13 -0600

Consider I have two OSes, both ubuntu linux. I cloned opencv and opencv_contrib and ran cmake .. and make.

These two steps create the necessary binaries in the folder build.

Now I copy this build folder on another OS and then run make install inside build folder. Will it be able to install these libraries?

I am doing this to get a non-bloated OS which happened when I built it on the first OS.

edit retag flag offensive close merge delete

Comments

Are these both Operating Systems exactly the same?

marcusbarnet gravatar imagemarcusbarnet ( 2018-06-27 02:58:04 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-06-29 05:31:30 -0600

kbarni gravatar image

As long as the architectures are the same (x86, amd64...) and you have the dependencies installed, you can simply recopy the opencv files from the installation folder (/usr/local/...) and run sudo ldconfig.

edit flag offensive delete link more

Comments

1

maybe it's a good idea to choose a custom install folder, like /home/me/ocv, so you can copy a whole folder to another machine, and don't have to collect the libs / headers / so's / data manually

berak gravatar imageberak ( 2018-06-29 07:33:27 -0600 )edit

Very good idea! I will use this approach for my cloud account.

holger gravatar imageholger ( 2018-06-29 08:06:54 -0600 )edit

cloud

before doing anything, find out, if you're root (on the target box) or not. if not so, you probably have to use a custom install location (you're not allowed to manipulate /usr/local) and since you also cannot run ldconfig (needs root priv., too!) you maybe have to build static libs

berak gravatar imageberak ( 2018-06-29 08:12:18 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-27 02:30:53 -0600

Seen: 191 times

Last updated: Jun 29 '18