Open main menu

DAVE Developer's Wiki β

Changes

Building the SDK
{{AppliesToAXEL ULite AN}}
{{AppliesTo_SBC_Lynx_AN}}
{{AppliesTo_RIALTO_SBC_AN}}
{{InfoBoxBottom}}
=== Preparing the building environment ===
* Ubuntu cross-toolchain for ARM has to be installed, using <code>apt-get</code>
sudo apt-get install git python3 curl xz-utils sudo apt-get install gcc-arm-linux-gnueabihf g++-9-arm-linux-gnueabihf gcc-multilib sudo apt-get install g++-arm-linux-gnueabihf g++-multilib zip 
=== Building the SDK ===
The git repository from Google source can be cloned
Receiving objects: 100% (51219/51219), 37.00 MiB | 3.71 MiB/s, done.
Resolving deltas: 100% (37978/37978), done.
dvdk@vagrant:~/dart$ export PATH="$PATH:$PWD/depot_tools"
dvdk@vagrant:~/dart$
</pre>
fetch dart
</pre>
* now it is possible to checkout the <code>master</code> branch
git checkout master
* then, the <code>linux</code> target can be selected and synced
<pre class="workstation-terminal">
* ''for building'' the SDK, a dedicated Python script can be used
<pre>
export PATH="$PATH:$PWD/depot_tools"cd dart-sdk/sdk
./tools/build.py
</pre>
''You can also produce only a Dart VM runtime, no SDK, by replacing create_sdk with runtime. This process involves also building a VM that targets ia32/x64, which is used to generate a few parts of the SDK''
 
== Installing the SDK in the target ==
Once the SDK image has been created, it is possible to create an archive and copy it in the target (for example using ''scp'' or ''ftp'') and then extract the archive in the <code>/usr/bin</code> directory:
<pre class="workstation-terminal">
dvdk@vagrant:~/dart/dart-sdk/sdk/out/ReleaseXARM/dart-sdk$ ls -la
dvdk@vagrant:~/dart/dart-sdk/sdk/out/ReleaseXARM/dart-sdk$ sudo tar zcpf ../dart-sdk-arm.tar.gz *
dvdk@vagrant:~/dart/dart-sdk/sdk/out/ReleaseXARM/dart-sdk$
</pre>
and then extract the archive in the <code>/usr/bin</code> target directory:
<pre class="workstation-terminal">
root@desk-mx6ul-lynx:/usr/bin# mkdir dart-sdk
root@desk-mx6ul-lynx:/usr/bin# cd dart-sdk
root@desk-mx6ul-lynx:/usr/bin/dart-sdk# scp user@192.168.0.23:/tmp/dart* .
user@192.168.0.23's password:
dart-sdk-arm.tar.gz 100% 114MB 2.2MB/s 00:52
root@desk-mx6ul-lynx:/usr/bin/dart-sdk# tar zxpf dart-sdk-arm.tar.gz
root@desk-mx6ul-lynx:/usr/bin/dart-sdk#
</pre>
It runs and shows the version
<pre class="workstation-terminal">
root@desk-mx6ul-lynx:/usr/bin/dart-sdk# ./bin/dart --version
Dart SDK version: 2.19.0-edge.5501c7f9787b77897b9ac6fdd22103f273663d0d (be) (Fri Oct 14 03:13:52 2022 +0000) on "linux_arm"
root@desk-mx6ul-lynx:/usr/bin/dart-sdk#
</pre>
== Running the ''Hello world'' example ==
Before running a Hello World in Dart is to have the Dart SDK has to be installed on the local target, i.e. the previous steps have to be already accomplished.
The simpler example written in Dart can be the following one:
8,321
edits