User Tools

Site Tools


getting_started:compile_eeros_man

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_man [2021/02/12 17:09] – external edit 127.0.0.1getting_started:compile_eeros_man [2021/10/24 11:46] (current) – [Compile Additional Libraries] ursgraf
Line 1: Line 1:
-====== Compile ======+====== Compile Manually ======
  
 +Back to [[getting_started:install:manually|]].
  
-===== Compile Using a Script ===== +Compile and install EEROS for the host as follows:
-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+
 <code> <code>
-install_dir="$wd"/install-armhf  +mkdir build-x86 
-build_dir="$wd"/build-armhf +cd build-x86 
 +$ mkdir eeros 
 +$ cd eeros 
 +$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 .. 
 +$ make 
 +$ make install
 </code> </code>
 +If your target architecture is different from the host platform we suggest to use a SDK. If you don't use a SDK, you have to specify a toolchain file with as given in [[getting_started:host_and_target#cross_compilation|Cross Compilation]]. An example of such a toolchain file can be found in [[https://github.com/eeros-project/eeros-build-scripts.git]].
  
- +Per default, debug information will be included in the code. For maximum efficiency make sure to change the cmake command to:
-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+cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 -DCMAKE_BUILD_TYPE=Release ..
 </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''. 
  
-Continue with [[getting_started:deploy|]].+===== Compile Hardware Wrapper Libraries =====
  
 +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 in a similar fashion as you did with the EEROS library itself, e.g. fetch the code of the simulator
 +<code>
 +$ git clone https://github.com/eeros-project/sim-eeros.git sim-eeros
 +</code>
  
- +Build and install it
-===== Compile Manually in Terminal ===== +
-Compile and install EEROS to a custom folder as follows:+
 <code> <code>
-$ cd path/to/working/directory +$ cd build-x86 
-$ mkdir build-eeros-x86-64 +$ mkdir sim-eeros 
-$ cd build-eeros-x86-64 +$ cd sim-eeros 
-$ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 ..+$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 ..
 $ make $ make
 $ make install $ make install
-</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: 
-<code> 
-$ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 -DCMAKE_BUILD_TYPE=Release .. 
 </code> </code>
  
 +Continue with [[getting_started:deploy:deploy_manually|]].
  
-We recommend to not install EEROS globally on your systemHowever, if you want to install it globally you have to execute the following commands: +===== Compile Additional Libraries ===== 
-<code> + 
-make install +Some blocks of the control system use further libraries such as CANOpen, LibUSB, MODBUS and so on. You have to fetch, make and install these libraries first. Then you must build EEROS with some additional switches so that when building EEROS these libraries will be found and linkedChange the cmake command as follows
-</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+
 <code> <code>
-$ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 ..+$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 -DUSE_CAN=TRUE ..
 </code> </code>
 +when using the CANOpen library. These will also compile the EEROS examples which demonstrate the use of CAN.
  
-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  
getting_started/compile_eeros_man.1613146164.txt.gz · Last modified: 2021/02/12 17:09 by 127.0.0.1