抛出异常:
OpenCV-2.4.3/modules/features2d/src/freak.cpp:437: error: unable to find a register to spill in class 'GENERAL_REGS'
/cs/research/crest/projects1/ucacbbl/OpenCV-2.4.3/modules/features2d/src/freak.cpp:437: error: unable to find a register to spill in class GENERAL_REGS
/cs/research/crest/projects1/ucacbbl/OpenCV-2.4.3/modules/features2d/src/freak.cpp:437: error: this is the insn:
(insn:HI 1685 1684 1686 131 (parallel [
(set (subreg:DI (reg:V16QI 21 xmm0 [848]) 0)
(ior:DI (reg:DI 1 dx [832])
(reg:DI 4 si [839])))
(clobber (reg:CC 17 flags))
]) 315 {*iordi_1_rex64} (insn_list:REG_DEP_TRUE 1660 (insn_list:REG_DEP_TRUE 1659 (nil)))
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_DEAD (reg:DI 4 si [839])
(expr_list:REG_DEAD (reg:DI 1 dx [832])
(nil))))))
下文给出了解决方案:
http://www0.cs.ucl.ac.uk/staff/ucacbbl/opencv-2.4.3/
————————————————————————
This bug has been reported in stackoverflow.com.
Being unable to find a register to spillappears to be a problem with some versions of gcc(bugzilla 35135).
http://stackoverflow.com/questions/13580485/error-in-making-opencv
的说明:
YOUR_BUILD_DIR/modules/features2d/CMakeFiles/opencv_features2d.dir/build.make
Search for freak.cpp. You find three blocks: Building CXX..., Preprocessing CXX..., and Compiling CX.... I just needed to change the Building part. The last line of that block looks like this:
.... YOUR_COMPILER $(CXX_DEFINES) $(CXX_FLAGS) ...
and if you check you find out that CXX_FLAGS has a -O3 in it. If you add -O0 after CXX_FLAGS it suppresses the O3. So your lines should look like this.
.... YOUR_COMPILER $(CXX_DEFINES) $(CXX_FLAGS) -O0 ...