Ask Your Question
1

Install problem, ubuntu with virtualbox on win7 64 pc

asked 2014-05-14 03:41:44 -0600

greenblood gravatar image

updated 2014-05-15 02:17:01 -0600

berak gravatar image

Hi peeps,

I am having a problem instaling opencv 2.4.9 on the above. I am getting as far as make instruction and am getting this error-

c++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
make[2]: *** 
[modules/gpu/CMakeFiles/opencv_perf_gpu.dir/perf/perf_imgproc.cpp.o] Error 4
make[1]: *** [modules/gpu/CMakeFiles/opencv_perf_gpu.dir/all] Error 2
make: *** [all] Error 2

Any sugestions? I have tried increasing thememory on the virtualbox.

Cheers

Steve

edit retag flag offensive close merge delete

Comments

1

clear all temps from previous attempts. even remove your build folder and restart cmake

berak gravatar imageberak ( 2014-05-15 02:35:59 -0600 )edit

Hi berak, many thanks for helping. Can you explain what you mean by clear all temps? do you mean tempory files or folders? where are they likely to be and what are they likely to be called? i have used ls to list all in the opencv-2.4.9 directory and it is not obvious to me, sorry i am such a numpty!

greenblood gravatar imagegreenblood ( 2014-05-15 03:00:04 -0600 )edit

before you started cmake, you created a (temporary) build dir, right ? that's the one i mean

you were told to cd into that and run cmake. right ?

it all sounds a bit like your previous run failed due to not enough mem/space (oh, and besides memory, you'll need a good 2gb disk space , too !) and now your compiler chokes on the (broken) leftovers of that attempt, so get rid of them.

berak gravatar imageberak ( 2014-05-15 03:23:53 -0600 )edit

ok, i have messed up here a tad. i made the dir called release then cd into it but i couldnt run the make command, so cd'd back into the opencv-2.4.9 folder and ran make there just in case, and it ran...but then stopped due to this error. i have just cd'd back into release and there is nothing at all in there. i must have made some mistake in following the instructions... i will re-read them and see what happened.

edit- ok i looked back in the history and found that i cd'd into release then ran this - cmake -D cmake_build_type=release -D cmake_install_prefix=/usr/local ./ how do i fix this command to find the makelists in opencv-2.4.9?

greenblood gravatar imagegreenblood ( 2014-05-15 03:30:19 -0600 )edit

aww, i see . common mistake to build in the src dir, guilty here, too ;)

so 'release' is a subfolder of your opencv tree ? then cd into that and:

cmake -D cmake_build_type=release -D cmake_install_prefix=/usr/local ..

see the 2 dots at the end ? means, that the opencv tree is 1 above the release dir, and the CmakeLists.txt should be found there.

berak gravatar imageberak ( 2014-05-15 03:58:02 -0600 )edit

ok thanks for that. i ran that and this time it worked! however, now i at the next step ie type make when in release and it is saying no targets specified and no makefile found? i think those instructions could do with a little padding out so numptys like me can understand without asking daft questions lol

greenblood gravatar imagegreenblood ( 2014-05-15 04:11:26 -0600 )edit

oh, btw, no space between -D and the args.

running cmake without any args should give you a list of generators, maybe it was lacking -G "Unix Makefiles"

ever thought of running cmake-gui ?

(honestly, i find wrangling with cmake much harder than any c++ coding, you're not alone in that struggle.)

berak gravatar imageberak ( 2014-05-15 04:31:20 -0600 )edit

this is a right pain! still not getting anywhere. I'd like to try the gui, but cant find it in the download....

greenblood gravatar imagegreenblood ( 2014-05-15 06:19:40 -0600 )edit

still stuck at the second 'make' command - i am cd'd into 'release' and ran the instruction cmake -D cmake_build_type=release -D cmake_install_prefix=/usr/local .. which worked fine, but there are no files still in 'release'. so when i run 'make' it is saying there is no make files found and no target specified. What am i doing wrong? I am following the instructions perfectly!

Cheers

Steve

greenblood gravatar imagegreenblood ( 2014-05-16 06:34:33 -0600 )edit

I was installing OpenCV 2.4.7 on a raspberry pi recently and faced that problem on the make command. What solved the problem was increasing the memory by adding a 3GB swap file using the following commands:

fallocate -l 3072m /var/spool/swap
mkswap /var/spool/swap
swapon /var/spool/swap

then running

make -j 4

Not sure how you can do that on Windows, but given my experience, it seems that available memory is the likely culprit in your case. Do you absolutely need to run virtualbox? I imagine that alone will consume a large chunk of available memory.

rmurr gravatar imagermurr ( 2014-05-20 10:39:47 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2014-05-20 10:49:42 -0600

rmurr gravatar image

I was installing OpenCV 2.4.7 on a raspberry pi recently and faced that problem on the make command. After a bit of research, I found this page. What solved the problem was increasing the memory by adding a 3GB swap (1GB wasn't enough) file using the following commands (idea taken from site linked above):

fallocate -l 3072m /var/spool/swap
mkswap /var/spool/swap
swapon /var/spool/swap

then running make.

Not sure how you can do that on Windows, but given my experience, it seems that available memory is the likely culprit in your case. Do you absolutely need to run virtualbox? I imagine that alone will consume a large chunk of available memory.

My recommendation (based on my experience) would be to start fresh by deleting all your opencv files except the compressed file it came in and decompress it again. Then go into the created dir and create a dir called 'build'. Try to free up available memory by not running any other programs. Here is how I got it to work after that:

Go into the 'build' dir and enter:

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D  BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_OPENGL=ON -D BUILD_JPEG=ON ..

then

make -j 4
sudo make install
sudo ldconfig
edit flag offensive delete link more

Question Tools

Stats

Asked: 2014-05-14 03:41:44 -0600

Seen: 1,609 times

Last updated: May 20 '14