Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Mihini/Cross Compilation"
(→Step 3: get Mihini: the sed is no useless) |
|||
Line 22: | Line 22: | ||
Get the sources <source lang="bash"> | Get the sources <source lang="bash"> | ||
$ git clone https://github.com/nim65s/mihini-repo.git | $ git clone https://github.com/nim65s/mihini-repo.git | ||
− | + | </source> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | </source> | + | |
=== Step 4: build and make === | === Step 4: build and make === |
Revision as of 05:25, 14 August 2013
This page will help you through the process of building your Mihini's installation on your fast and powerful desktop computer for your embbeded architecture.
Contents
Raspbian (RaspberryPi & Debian)
The main files for this platform are already available, so that you will be able to get started quickly ; or it may be used as an example for the others platforms. Please, note that these steps have been validated on a 32 bit OS. Trying to run it on a 64 bit OS may give you errors when trying the build.sh .
Step 1: Get the prerequisites
On a Debian-based system, you will need to:$ sudo apt-get install build-essential cmake git telnet
Step 2: get the toolchain
We are going to use the Linaro toolchain, from the official raspberrypi repository:$ cd $ git clone https://github.com/raspberrypi/tools.git
Step 3: get Mihini
Get the sources$ git clone https://github.com/nim65s/mihini-repo.git
Step 4: build and make
To finish, let's build it:$ ./bin/build.sh -t raspberrypi-linaro $ cd build.raspberrypi-linaro $ make lua luac # Optional, if you want to use Modbus over serial (e.g. to run the Greenhouse sample) $ make modbus_serial $ make package
And Voilà, you have a .deb
or a .tar.gz
ready to be installed on your RPi !
Step 5: use it
If you are not sure of what to do with this .deb
, you can go to the Install Mihini page, skipping the first shell command which downloads a similar .deb
.
Then, you can go back to the main tutorial: Run Mihini on an Open Hardware platform
Configuring your own toolchain
The target you specify to build.sh
(which was «raspberrypi-linaro» in the example above) is used to select the toolchain. You will probably need to copy/paste an existing configuration in cmake/
, naming it toolchain.<your target's name>.cmake
, and changing the lines
SET(CMAKE_C_COMPILER /path/to/gcc) SET(CMAKE_CXX_COMPILER /path/to/g++)
Then, you shall also look at the folder porting/
, where you can make a new directory with the name of your target.
Prerequisites for making packages
Debian-based
sudo apt-get install build-essential cmake git telnet
Fedora
sudo yum install cmake gcc-c++ fedora-packager @development-tools telnet
ArchLinux
sudo pacman -Syu base-devel inetutils
Ångström / OpenEmbedded / OpenWRT
opkg install cmake