User Tools

Site Tools


getting_started:compile_eeros

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
Next revisionBoth sides next revision
getting_started:compile_eeros [2017/06/22 08:49] grafgetting_started:compile_eeros [2019/10/14 12:10] – [Compile Manually in Terminal] graf
Line 1: Line 1:
 ====== Compile EEROS ====== ====== Compile EEROS ======
  
-There are very often two versions of EEROS, because the host and the target usually don't have the same architecture. Therefore, it is recommended that EEROS is not globally installed. EEROS can be installed to a custom folder by setting the CMake variable CMAKE_INSTALL_PREFIX. 
  
 ===== Compile Using a Script ===== ===== Compile Using a Script =====
-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 customizing the ''config.sh.in'' file and getting the code you can compile EEROS, all necessary hardware libraries, and your application by executing+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. 
 +If you do a cross development and your target contains a different processor architecture from your host, you have to choose a suitable //tool chain file// and also 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> 
 +install_dir="$wd"/install-armhf  
 +build_dir="$wd"/build-armhf 
  
 +toolchain_file="$wd"/toolchainfile/arm-linux-gnueabihf-gcc-4.9.cmake
 +</code>
 +After this you proceed with
 <code> <code>
 $ ./make.sh $ ./make.sh
 </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. +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''.
  
-===== Compile with KDevelop =====+Next, if you are running EEROS on the host machine you can go to the first example [[getting_started:say_hello|]]. If you do a cross development on a host and are using it on a target platform you have to [[getting_started:deploy|]] it first.
  
-After the source has been fetched click **Next**: 
  
-{{:getting_started:compile_eeros_02_open_project.png|}} 
  
-Select the **CMakeLists.txt** file and click **Next**: +===== Compile Manually in Terminal ===== 
- +Compile and install EEROS to a custom folder as follows:
-{{:getting_started:compile_eeros_03_project_name.png|}} +
- +
-Enter the name of the project in KDevelop and click **Finish**: +
- +
-{{:getting_started:compile_eeros_04_config.png|}} +
- +
-Enter the location where EEROS should be build into the field **Build Directory**. It is recommended that you name this folder //build-PROJECTNAME-ARCHITECTURE// (e.g. build-eeros-x86-64, build-eeros-armhf, build-eeros-ppc, ...). +
- +
-Enter the location where EEROS should be installed to into the filed **Installation Prefix**. If you want to install EEROS globally on the current system then leave this field empty. It is recommended that you specify a location and that you name it //install-ARCHITECTURE// (e.g. install-x86-64, install-armhf, install-ppc, ...). +
- +
-Do not forget to choose the build type. Per default it will be ''Debug''. Make sure to change to ''Release'' for maximum efficiency. +
- +
-Enter any additional CMake arguments into the field **Extra Arguments**. If you want to cross-compile EEROS enter the path to the toolchain file (e.g. -DCMAKE_TOOLCHAIN_FILE=path/to/toolchain-file.cmake). +
- +
-Click **OK** to configure CMake. Before we build EEROS, a stable version should be checked out: +
- +
-{{:getting_started:compile_eeros_04b_branches.png|}} +
- +
-Right-click the EEROS Project and select **Git** > **Branches**: +
- +
-{{:getting_started:compile_eeros_04c_checkout.png|}} +
- +
-Select the stable branch you like and click **Checkout**. Stable branches have the format STABLEVERSION.x (e.g. 0.4.x, 0.5.x, 1.0.x, ...). +
- +
-{{:getting_started:compile_eeros_05_build.png?200|}} +
- +
-Build EEROS by clicking on the **Build** button. +
- +
-{{:getting_started:compile_eeros_06_install.png?200|}} +
- +
-Install EEROS by right-clicking on the project and selecting **Install**. This last step will install the header files into the directory **include** and the compiled library into the directory **lib**. The directory **lib** will also contain some necessary cmake files to compile EEROS applications.   +
- +
-===== Compile in terminal ===== +
- +
-Clone the EEROS source repository: +
-<code> +
-$ cd path/to/working/directory +
-$ git clone https://github.com/eeros-project/eeros-framework.git +
-</code> +
- +
-Checkout a stable version of EEROS: +
-<code> +
-$ cd eeros-framework +
-$ git checkout v0.5 +
-</code> +
- +
-Tags in the format vX.Y are stable releases. To show all tags execute the following command: +
-<code> +
-$ git tag +
-</code> +
- +
-Compile and install EEROS to a custom folder:+
 <code> <code>
 $ cd path/to/working/directory $ cd path/to/working/directory
Line 80: Line 32:
 $ make install $ 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: Per default, debug information will be included in the code. For maximum efficiency make sure to change the 4th line to:
 <code> <code>
Line 86: Line 38:
 </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:
 +<code>
 +$ make install
 +</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 architectures. For this purpose we will install various versions into custom folders named after the target architecture by setting the CMake variable CMAKE_INSTALL_PREFIX. 
 +
 +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