User Tools

Site Tools


getting_started:compile_eeros_host

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
getting_started:compile_eeros_host [2021/03/17 14:12] – created ursgrafgetting_started:compile_eeros_host [2023/04/13 08:51] (current) ursgraf
Line 1: Line 1:
 ====== Compile on the Host ====== ====== Compile on the Host ======
  
 +Back to [[getting_started:install:use_on_host|]].
  
-===== Compile Using a Script ===== +Fetch the [[https://github.com/eeros-project/eeros-build-scripts.git|EEROS scripts]] on your host and checkout the branch for the host <code> 
-As mentioned in [[getting_started:install_and_setup_development_environment#Getting_the_Sources_with_a_script|Installation and Setup]] we suggest to use a script. After having downloaded the code you can now compile EEROS, all necessary hardware libraries, and your application program. Set the build and install directories to meaningful names. E.g. if you develop on a x86 platform for an ARM platform, edit ''config.sh.in'' as follows +git clone https://github.com/eeros-project/eeros-build-scripts.git eeros-project 
-<code> +$ cd eeros-project 
-install_dir="$wd"/install-armhf  +$ git checkout host
-build_dir="$wd"/build-armhf +
 </code> </code>
  
- +Edit the ''config.sh.in'' file as follows
-If you use ROS you have to make sure to take necessary steps as given in [[getting_started:ros#Preparations_and_Building|Preparations and Building]], notably you have to run the ''setup.bash'' script of ROS. \\ +
-After this you proceed with+
 <code> <code>
-$ ./make.sh+use_simulator=true 
 +use_comedi=false 
 +use_ros=false 
 +use_ros2=false
 </code> </code>
  
-This will put all the executables into the build directory you have chosen and the compiled libraries together with the header files into the install directory. Please keep in mind that build and install directory are both defined in ''config.sh.in''.+This will build EEROS without the ROS examples. If you have ROS2 installed and want to build the ROS examples, change the ''config.sh.in'' to 
 +<code> 
 +use_simulator=true 
 +use_comedi=false 
 +use_ros=false 
 +use_ros2=true
  
-Continue with [[getting_started:deploy|]].+ros_setup_script=/opt/ros/kinetic/setup.bash 
 +</code> 
 +The last line must point to your ROS installation path. In general this will be ''/opt/ros/$ros_version_name/setup.bash''.
  
 +If you want to use ROS1, change the ''config.sh.in'' to
 +<code>
 +use_simulator=true
 +use_comedi=false
 +use_ros=true
 +use_ros2=false
  
 +ros_setup_script=/opt/ros/noetic/setup.bash
 +</code>
 +Further, when using ROS1, search for the line <code>ros_eeros_git_version=v2.0.0</code>
 +and change it into <code>ros_eeros_git_version=v1.0.1</code> 
  
-===== Compile Manually in Terminal ===== +[[http://www.comedi.org/|comedi]] stands for linux control and measurement device interface. It is a collection of drivers for a variety of common data acquisition plug-in boards on the host. 
-Compile and install EEROS to a custom folder as follows:+If you want to use EEROS with [[http://www.comedi.org/|]] you have to install comedi first, see [[http://www.comedi.org/]]. Then change the ''config.sh.in'' to
 <code> <code>
-$ cd path/to/working/directory +use_simulator=true 
-$ mkdir build-eeros-x86-64 +use_comedi=true 
-$ cd build-eeros-x86-64 +use_ros=false 
-$ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 .. +use_ros2=false
-$ make +
-$ make install+
 </code> </code>
-If your target architectur is different from the host platform you have to use a //tool chain file//. For more information see above [[getting_started:compile_eeros|Compile Using a Script]]. \\ + 
-Per default, debug information will be included in the code. For maximum efficiency make sure to change the 4th line to:+Now you can run the ''clone'' script 
 <code> <code>
-cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 -DCMAKE_BUILD_TYPE=Release ..+./clone.sh
 </code> </code>
  
  
-We recommend to not install EEROS globally on your systemHowever, if you want to install it globally you have to execute the following commands:+After having downloaded the code you can now compile EEROS together with necessary librariesThe build and install directories are set in ''config.sh.in'' as follows
 <code> <code>
-make install+install_dir="$wd"/install-x86  
 +build_dir="$wd"/build-x86 
 </code> </code>
-The reason for not installing EEROS globally is that you might need two or even more versions as soon as you compile for various target architecturesFor this purpose we will install various versions into custom folders named after the target architecture by setting the CMake variable CMAKE_INSTALL_PREFIX with+Change this setting if you want to choose different build and install directories 
 + 
 +After this you proceed with
 <code> <code>
-cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 ..+./make.sh
 </code> </code>
  
-As soon as you access dedicated hardware on your system you have to install one of the [[eeros_architecture:hal:hardware_libraries|]]. You do this +This will put all the executables into the build directory you have chosen and the compiled libraries together with the header files into the install directory. Please keep in mind that build and install directory are both defined in ''config.sh.in''
 + 
 +Continue with [[getting_started:write_app:use_on_host|]]. 
 + 
 + 
 + 
getting_started/compile_eeros_host.1615986765.txt.gz · Last modified: 2021/03/17 14:12 by ursgraf