This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| icub:yarp_pc [2013/01/08 10:52] – [ERRORS during compilation or generation of the makefiles:] ramirezk | icub:yarp_pc [2013/04/25 18:58] (current) – jansohn | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Installing YARP on a PC====== | ||
| + | |||
| + | 1) Make sure that the following programs are installed: | ||
| + | |||
| + | sudo apt-get install cmake libace-dev subversion cmake-curses-gui libgtk2.0-dev libgsl0-dev libreadline-dev g++ libncurses5-dev libgtkmm-2.4-dev libglademm-2.4-dev | ||
| + | | ||
| + | Recommended: | ||
| + | |||
| + | Alternative (**NOT** recommended): | ||
| + | sudo apt-get install libcv-dev libcvaux-dev libopencv-dev | ||
| + | | ||
| + | 2) Then we obtain YARP from the repositories: | ||
| + | cd ~/local/src | ||
| + | svn co https:// | ||
| + | | ||
| + | 3) Configuring YARP: | ||
| + | cd yarp2 | ||
| + | mkdir build && cd build | ||
| + | ccmake -DCMAKE_BUILD_TYPE=Release -DCREATE_SHARED_LIBRARY=ON -DCREATE_DEVICE_LIBRARY_MODULES=ON -DCREATE_GUIS=ON -DCREATE_LIB_MATH=ON -DCREATE_OPTIONAL_CARRIERS=ON -DENABLE_yarpmod_opencv_grabber=ON .. | ||
| + | |||
| + | |||
| + | Hit ' | ||
| + | |||
| + | CMAKE_BUILD_TYPE to " | ||
| + | CREATE_SHARED_LIBRARY, | ||
| + | CREATE_DEVICE_LIBRARY_MODULES, | ||
| + | CREATE_GUIS, | ||
| + | CREATE_GYARPMANAGER, | ||
| + | CREATE_LIB_MATH, | ||
| + | CREATE_OPTIONAL_CARRIERS, | ||
| + | ENABLE_yarpmod_opencv_grabber, | ||
| + | |||
| + | Hit ' | ||
| + | |||
| + | 4) Install YARP | ||
| + | make | ||
| + | sudo make install | ||
| + | | ||
| + | 5) (Additional) Install YARP for Matlab | ||
| + | |||
| + | Make sure yarp2 was compiled with option CREATE_SHARED_LIBRARY set to ON (especially make sure that no old static libraries (*.a) remain in / | ||
| + | |||
| + | Java SDK needs to be installed (i.e. Oracle Java) | ||
| + | sudo add-apt-repository ppa: | ||
| + | sudo apt-get update | ||
| + | sudo apt-get install oracle-java7-installer | ||
| + | |||
| + | Add the following lines to ~/.bashrc (of course you need to change them to your actual paths, if you use matlab 32bit replace " | ||
| + | export JAVA_HOME=/ | ||
| + | export LD_PRELOAD=/ | ||
| + | |||
| + | Next install SWIG | ||
| + | sudo apt-get install swig | ||
| + | |||
| + | Go to YARP for Matlab folder and compile the sources | ||
| + | cd ${YARP_ROOT}/ | ||
| + | mkdir build && cd build | ||
| + | ccmake -DCREATE_JAVA=ON .. | ||
| + | make | ||
| + | |||
| + | Now we need to compile the Java classes and copy them to a new structure | ||
| + | cd generated_src/ | ||
| + | javac -source 1.3 -target 1.3 *.java | ||
| + | mkdir ~/ | ||
| + | mv LoadYarp.class YarpImageHelper.class ~/ | ||
| + | mkdir ~/ | ||
| + | mv *.class ~/ | ||
| + | javac -source 1.3 -target 1.3 *.java | ||
| + | |||
| + | Add the following lines to ~/ | ||
| + | ~/ | ||
| + | ~/ | ||
| + | |||
| + | Find out the location of librarypath.txt (' | ||
| + | chmod +w ~/ | ||
| + | | ||
| + | Add the following line to ~/ | ||
| + | ~/ | ||
| + | | ||
| + | ==== ERRORS during compilation or generation of the makefiles: ==== | ||
| + | |||
| + | * If YARP binaries cannot find OpenCV libraries run the following command to update the library configuration: | ||
| + | sudo ldconfig | ||
| + | | ||
| + | *If when configuring yarp with the flag: | ||
| + | |||
| + | CMake Error: File ~/ | ||
| + | |||
| + | therefore, comment the line 7 from ~/ | ||
| + | # | ||
| + | and configure again with the same flag on. | ||
| + | |||
| + | ==== Other ERRORS ==== | ||
| + | |||
| + | If you start Matlab from a launcher icon the LD_PRELOAD won't be set correctly, change launcher icon (/ | ||
| + | Exec=env " | ||