| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
Thank you so much for this!
Hey! Great howto.. any idea with this error?
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../lib/libIlmImf.a(IlmThreadSemaphorePosixCompat.cpp.o) has no symbols
[ 22%] Built target IlmImf
[ 23%] Building NVCC (Device) object modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o
clang: error: unsupported option '-dumpspecs'
clang: error: no input files
CMake Error at cuda_compile_generated_matrix_operations.cu.o.cmake:206 (message):
Error generating
/Users/scollis/src/opencv-2.4.5/release/modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o
make[2]: *** [modules/core/CMakeFiles/cuda_compile.dir/src/cuda/./cuda_compile_generated_matrix_operations.cu.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_core.dir/all] Error 2
make: *** [all] Error 2
On point 6:
I ran into the same issue with a different project and, asking on the Anaconda mailing list, got the impression that "fixing" the paths with install_name_tool is the recommended approach. As I understand it, Anaconda using relative-path install names (which seems to be very unusal on OS X) is the price you pay for it's flexible environments system.
conda build does some magic to get the libraries' paths right and at least for my project it was pretty straightforward to put together a conda recipe. There seems to be a recipe for opencv in the conda-recipes repository which you might be able to adapt (haven't used it, though).
Still I feel like Anaconda should somehow warn about this linking issue. It's very non-obvious to figure out (a seg fault --- where do you go from there), especially if you are not doing linking gymnastics on OS X every day.
If anyone is having @scollis is having try adding
-DWITH_CUDA=OFF
To your cmake command. It turns off CUDA support which is causing the problem.
Thank you for this, I'm sure it was a huge timesaver!
I was also able to get this working on Mavericks with Anaconda 1.9.1 without changing any of your instructions.
Thanks! It worked.
Thanks very much! Works quite well under opencv-2.4.8-macosx-10.9.2-anaconda-1.9.0
Thanks for this code. I tried to install opencv with a corrupt 2.4.3 version this afternoon with which I got stuck at step 4 all the time... after trying with 2.4.8, step 4 worked fine
I finally got to point 5 - I had my anaconda folder at the source - copy it to my user folder. now I do not have a cv2.so in there. I have another cv2.so from the first try with 2.4.3 - copy that and seems to work so far - now I can go to step 6.
in the end when trying to import cv2, ipython tells me No module named cv2
ok, I started iPython from the site-packages folder and now I get
In [1]: import cv2
Segmentation fault: 11
however, I have everything in the cv2.so except the /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL (compatibility version 1.0.0, current version 1.0.0)
I copied this in the site-packages folder
and
I have older versions of
/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 56.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0)
I'm using ipython 1.1.0
This is the place where I get stuck...
[ 35%] Building CXX object modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o
/Applications/OpenCV/opencv-2.4.5/modules/core/perf/perf_main.cpp:3:1: error:
multiple unsequenced modifications to 'argc' [-Werror,-Wunsequenced]
CV_PERF_TEST_MAIN(core)
^~~~~~~~~~~~~~~~~~~~~~~
/Applications/OpenCV/opencv-2.4.5/modules/ts/include/opencv2/ts/ts_perf.hpp:481:12: note:
expanded from macro 'CV_PERF_TEST_MAIN'
while (++argc >= (--argc,-1)) {VA_ARGS; break;} /this ugly cons...
^ ~~
1 error generated.
make[2]: ** [modules/core/CMakeFiles/opencv_perf_core.dir/perf/perf_main.cpp.o] Error 1
make[1]: *** [modules/core/CMakeFiles/opencv_perf_core.dir/all] Error 2
make: *** [all] Error 2
Hello Myazdani, I had the same problem as you at a point with this error
I found out that it is due to a problem with that OpenCV version 2.4.5
download another version of OpenCV and this step will work
for my part, I finally decided to uninstall all OpenCV and Anaconda instances and to install it with brew
and finally after 7hrs yesterday and 2 hrs today, I managed to install OpenCV with brew
but cannot open it with brew, either :-( - back to the start
@rogerg, indeed upgrading to the latest version of OpenCV ( found here: ) fixed everything for me. Sorry about your troubles though.
I suggest to the author of the tutorial to point readers to this link for getting OpenCV:
http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/
I installed opencv with this(with anaconda). it was very useful to me :D thank you very much
Thanks a lot!!! This really works!!!
So good.
Hands down the only solution I've found to building SimpleITK with Anaconda on the whole bloody net!!! You are my hero! :D
Thanks for a detailed post. I am stuck in step 6 now. I followed the exact same commands as mentioned above -and the cv2.so ended up in the folder: /Users/rouseguy/Documents/Python/OpenCV/opencv-2.4.7.1/release/lib. I am not confident with Terminal commands and am unable to figure out how to modify the command in step 6.
Could you suggest me how I should proceed next? (No issues in installation. Everything fine. Just unable to import cv2 in python -because the file is not present in site-packages)
EDIT: Figured out. Did two things. Copied cv2.so to anaconda's site-package folder. And ran the command in line 6. And cv2 works.
Great article !