“分段故障"指的是“分段故障".在“导入简历"期间在Mac OS上 [英] "Segmentation fault" during "import cv" on Mac OS
问题描述
试图从源代码在Mac上编译opencv.
Trying to compile opencv on my Mac from source.
我有以下CMakeCache.txt: http://pastebin.com/KqPHjBx0
I have following CMakeCache.txt: http://pastebin.com/KqPHjBx0
我制作ccmake ..
,按c
,然后按g
.
比我做sudo make -j8
:
http://pastebin.com/cJyr1cEd
I make ccmake ..
, press c
, then g
.
Than I make sudo make -j8
:
http://pastebin.com/cJyr1cEd
比起sudo make install
:
http://pastebin.com/W77syYBj
然后我在python中制作import cv
并使用此stacktrace获取"Segmentation faul":
http://pastebin.com/gegYAK1u
And than I make import cv
in python and get "Segmentation faul" with this stacktrace:
http://pastebin.com/gegYAK1u
我不知道什么可以帮助我.问,我来.
I don't know what could be useful to help me, pls. ask, I'll get it.
推荐答案
我遇到了同样的情况,并解决了以下步骤.
I had a same situation and resolved the following steps.
在ccmake(ccmake -G "Unix Makefiles" .
)中,按t
键切换到高级模式.
In ccmake(ccmake -G "Unix Makefiles" .
), toggle to the advanced mode pressing t
.
将PYTHON_LIBRARY
的值更改为/opt/local/lib/libpython2.6.dylib
,将PYTHON_INCLUDE_DIR
的值更改为/opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
.
change PYTHON_LIBRARY
value to /opt/local/lib/libpython2.6.dylib
and PYTHON_INCLUDE_DIR
to /opt/local/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6
.
请注意,具体路径当然取决于您所使用的Python版本(2.6或2.7等).另外,如果您使用的是系统Python,而不是MacPorts(位于/opt中),那么您可能希望 PYTHON_LIBRARY 为/usr/lib/libpython2.6.dylib
Note that the specific path depends, of course, what version of Python you are using (2.6 or 2.7 etc.). Also, if you are using the system Python, instead of MacPorts (which is in /opt), then you probably want PYTHON_LIBRARY to be /usr/lib/libpython2.6.dylib
这篇关于“分段故障"指的是“分段故障".在“导入简历"期间在Mac OS上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!