Getting stuck on ROS for Raspbian Jessie
I am following this tutorial on installing ROS Kinetic on Raspbian Jessie and I got stuck Building the Catkin Workspace.
/etc/dphys-swapfile has been configure to
CONF_SWAPFILE=/mnt/sda2/swap.file
CONF_SWAPSIZE=1024
/sda2 is a 1TB external Hard Disk. It does not have a file "swap.file" though. How should I create it?
free -h
now gives me
total used free shared buffers cached
Mem: 859M 778M 81M 48M 84M 381M
-/+ buffers/cache: 312M 547M
Swap: 1.0G 0B 1.0G
Running
sudo ./src/catkin/bin/catkin_make_isolated --install -DCMAKE_BUILD_TYPE=Release --install-space /opt/ros/kinetic -j2
causes me to get stuck and terminal shows
[100%] Building CXX object modules/python3/CMakeFiles/opencv_python3.dir/__/src2/cv2.cpp.o
[100%] Building CXX object modules/python2/CMakeFiles/opencv_python2.dir/__/src2/cv2.cpp.o
It can take hours to compile OpenCV and PCL. I recommend that you just let it run. Eventually it will finish or run out of memory and crash.
Hey! Thanks for the prompt reply! Did I do the swap correctly? I did not explicitly create a "swap.file" in sda2. What happens if memory runs out?
I'm not sure how dphys-swapfile is supposed to work, but your output from
free -h
clearly shows 1GB of available swap space, so it's probably working.@Alsing: if you have the opportunity, I would really look into cross-compilation combined with distributed compilation. For the latter you could look into
distcc
. If you have any hosts available, building things like OpenCV and PCL will be much faster than just using the rpi alone.@gvdhoorn Thanks for that suggestion! I might spend the same time figuring out the configuration. @ahendrix gives a very good solution if only I wasn't stuck with an Eigen3 issue. I'll have to figure out that one for now.
@ahendrix What happens if it hangs? Should I reboot it or let it be?
"hangs" is tricky. It may be working, it just may not show any obvious signs that it's working. I would open another terminal and use
top
orhtop
to monitor CPU activity to see if any process is using the CPU heavily, or if many small compile processes are running.It would be completely unresponsive, no mouse or keyboard responses. Display wise, I'm stuck on the activity bar showing 99%. Then again, it could be the display not updating, but I really wouldn't know and can't test.