Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade OpenCV binaries #6

Open
pizthewiz opened this issue Jan 11, 2014 · 6 comments
Open

Upgrade OpenCV binaries #6

pizthewiz opened this issue Jan 11, 2014 · 6 comments

Comments

@pizthewiz
Copy link
Contributor

In an effort to update OpenCV binaries, I thought we could document the recipe used to build OpenCV per platform and offload later updates to others via pull requests (the actual Cinder shim seems pretty thin and unlikely to require much modification version-to-version).

OS X

After installing CMake via Homebrew, I built for OS X via:

% cd opencv-2.4.8
% mkdir build && cd build
% cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/tmp/purgatorio -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DBUILD_SHARED_LIBS=OFF -DWITH_CUDA=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF
% make -j8
% make install

The includes, OS X binaries and samples are updated in my fork's opencv-2.4.8 branch. In a quick run of each sample, they all seem to run as expected.

iOS

It isn't entirely clear which settings need to be tweaked to compile targeting the iOS SDKs for arm7, arm7s, arm64 and i386 (for the simulator). Any ideas?

MSW

Not being particularly Windows-savvy, could someone contribute a build recipe and binaries for x64 and x86?

@gaborpapp
Copy link

Thanks for this initiative. I also rebuilt OpenCV on OSX for the Cinder dev branch, and I had to add other options to make it work. Especially the -stdlib=libc++ switch is important:

cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_opencv_java=OFF -DBUILD_opencv_ocl=OFF -DBUILD_opencv_superres=OFF -D"CMAKE_OSX_ARCHITECTURES=i386;x86_64" -DENABLE_FAST_MATH=ON -DCMAKE_CXX_FLAGS="-fvisibility-inlines-hidden -stdlib=libc++" -DWITH_1394=OFF -DWITH_CARBON=OFF -DWITH_FFMPEG=OFF -DWITH_IMAGEIO=OFF -DWITH_IPP=OFF -DWITH_OPENNI=OFF -DWITH_QT=OFF -DWITH_QUICKTIME=OFF -DWITH_V4L=OFF -DWITH_PVAPI=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo ..

@pizthewiz
Copy link
Contributor Author

Hey Gabor, thanks for the suggestions, I'll be sure to rebuild my fork's binaries with at least libc++.

Could I ask why you disabled the OpenCL and Super Res modules? Did you disable native and third-party video/image handling (1394, carbon, ffmpeg, imageio, ipp, openni, qt, quicktime, v4l) for consistency with Cinder's specific needs?

@gaborpapp
Copy link

I think they didn't build and/or they were not part of the original Cinder OpenCV libs, so I disabled them, to make it build faster.

@pizthewiz
Copy link
Contributor Author

Great, I ended up with the following to use libc++ as suggested but also built the OpenCL and Super Res modules, as they might be useful moving forward:

$ cmake -DCMAKE_INSTALL_PREFIX:PATH=/tmp/purgatorio -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_OSX_ARCHITECTURES="i386;x86_64" -DENABLE_FAST_MATH=ON -DCMAKE_CXX_FLAGS="-fvisibility-inlines-hidden -stdlib=libc++" -DBUILD_SHARED_LIBS=OFF -DWITH_CUDA=OFF -DWITH_FFMPEG=OFF -DBUILD_TESTS=OFF -DBUILD_PERF_TESTS=OFF ..

@heisters
Copy link

on Windows, I've found you need need to disable BUILD_SHARED_LIBS and BUILD_WITH_STATIC_CRT, then manually set the Runtime Library in Visual Studio to MT for release and MTd for debug. The Runtime Library needs to be set for all projects within the solution.

I wonder if there's any way to set the Runtime Library through CMake? I couldn't find one.

@pizthewiz
Copy link
Contributor Author

  • OS X v2.4.9 binaries and recipe in PR#8
  • Windows/VC12 v2.4.9 binaries and recipe in PR#7 (though it isn't loading for me)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants