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

Both sides previous revisionPrevious revision
Next revision
Previous revision
getting_started:compile_eeros_man [2021/03/25 19:21] ursgrafgetting_started:compile_eeros_man [2021/10/24 11:46] (current) – [Compile Additional Libraries] ursgraf
Line 1: Line 1:
 ====== Compile Manually ====== ====== Compile Manually ======
  
 +Back to [[getting_started:install:manually|]].
  
-Compile and install EEROS as follows:+Compile and install EEROS for the host as follows:
 <code> <code>
-$ cd path/to/working/directory +$ mkdir build-x86 
-$ mkdir build-eeros-x86-64 +$ cd build-x86 
-$ cd build-eeros-x86-64 +$ mkdir eeros 
-$ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 ..+$ cd eeros 
 +$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 ..
 $ make $ make
 $ make install $ make install
 </code> </code>
-If your target architecture is different from the host platform you have to use a //tool chain file// or use a SDK. If your development architecture is different from your target architecture and you don't use a SDK, you have to specify a toolchain file as described in [[getting_started:host_and_target|]]. You can enter this file in the field "Extra Arguments" with //DCMAKE_TOOLCHAIN_FILE=path/to/toolchain-file.cmake//.+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:
-Per default, debug information will be included in the code. For maximum efficiency make sure to change the 4th line to:+
 <code> <code>
-$ cmake -DCMAKE_INSTALL_PREFIX=/absolute/path/to/working/directory/install-x86-64 -DCMAKE_BUILD_TYPE=Release ..+$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 -DCMAKE_BUILD_TYPE=Release ..
 </code> </code>
  
  
-We recommend to not install EEROS globally on your system. However, if you want to install it globally you have to execute the following commands:+===== 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> <code>
 +$ git clone https://github.com/eeros-project/sim-eeros.git sim-eeros
 +</code>
 +
 +Build and install it
 +<code>
 +$ cd build-x86
 +$ mkdir sim-eeros
 +$ cd sim-eeros
 +$ cmake -DCMAKE_INSTALL_PREFIX=../../install-x86 ..
 +$ make
 $ make install $ make install
 </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+ 
 +Continue with [[getting_started:deploy:deploy_manually|]]. 
 + 
 +===== Compile Additional Libraries ===== 
 + 
 +Some blocks of the control system use further libraries such as CANOpen, LibUSB, MODBUS and so onYou 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 linked. Change the cmake command as follows
 <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.1616696505.txt.gz · Last modified: 2021/03/25 19:21 by ursgraf