32-bit OpenCV on OS X Lion? Possible?

后端 未结 4 426
广开言路
广开言路 2021-01-03 10:10

I\'ve been googling and trying for days now, trying to figure out how to get 32-bit OpenCV working on OS X Lion, but can just find 64-bit version.

So i have the foll

4条回答
  •  星月不相逢
    2021-01-03 11:02

    Solved the problem.

    Recap: it is possible to have 32-bit OpenCV libraries on 64-bit Mac OSX Lion.

    How?

    Step 1: Download OpenCV 2.4.0

    Step 2: Download and install CMake.

    Step 3: Untar the OpenCV package.

    Step 4: Make a separate directory inside the OpenCV package for building

    mkdir build
    cd build
    cmake -G "Unix Makefiles" -D CMAKE_OSX_ARCHITECTURES=i386 -D CMAKE_C_FLAGS=-m32 -D CMAKE_CXX_FLAGS=-m32 ..
    

    (this will force the 32-bit compile)

    make -j8
    sudo make install
    

    Step 5: Enjoy!

    For forther reference please visit Mac OS X OpenCV Port Page

    Thanks all for putting me on the right track:

    @karlphilip: I tried to do as you suggested, but without the make options the compile phase fails, because the architectures are incoherent.

    @hamstergene: MacPorts got stuck after the new installation, maybe I have some remains of the older install :( (strange, i followed the official instrusctions to remove it).

    @Adrien: That's what I've done, but i had to merge 2 approaches :)

提交回复
热议问题