Building the SDK: Difference between revisions

From AsteroidOS
m (prettify Related pages)
(clarify that there are two versions of the SDK)
Line 1: Line 1:
[[Category:Developers]]
[[Category:Developers]]
The Software Development Kit (SDK) for AsteroidOS is a set of tools and libraries for developing software to run on AsteroidOS. Since AsteroidOS is a Linux distribution, you can use just about any programming language to develop software, but most of the core applications use a combination of C++ and Qt, with CMake to build. To get things running quickly, it's recommended to download and install the prebuilt version as described in [[Installing the SDK]]. This page describes how to build the SDK from source.  Be aware that this can take several hours, even on a fast computer. There are two choices to build the SDK: build natively without software containers or build within a software container (such as docker or podman).
The Software Development Kit (SDK) for AsteroidOS is a set of tools and libraries for developing software to run on AsteroidOS. Since AsteroidOS is a Linux distribution, you can use just about any programming language to develop software, but most of the core applications use a combination of C++ and Qt, with CMake to build. To get things running quickly, it's recommended to download and install the prebuilt version as described in [[Installing the SDK]]. This page describes how to build the SDK from source.  Be aware that this can take several hours, even on a fast computer.  
 
==== Which SDK? ====
One thing to note is that while this describes "the SDK", there are actually two versions -- the main one is used to develop software that runs on ARM-based watches running AsteroidOS.  The other one is the SDK for developing applications that run on the emulator, which uses qemux86.  See the [[Emulator]] page for details on the qemux86 version.  This page describes only the main ARM-based SDK but building the emulator version is almost the same -- the difference is that instead of
source ./prepare-build.sh dory
bitbake meta-toolchain-qt5
you would do this instead:
source ./prepare-build.sh qemux86
bitbake meta-toolchain-qt5
 
You can install both SDKs on the same machine -- they do not interfere.
 
== With or without software containers? ==
There are two choices to build the SDK: build natively without software containers or build within a software container (such as docker or podman).


Building natively requires somewhat fewer resources (memory and disk space) than building with containers but requires software, such a compilers and other tools, to be installed on the host system.  Since these software packages are different for each Linux distribution, this method requires more knowledge and patience to install required software that might not already be installed on your host computer.
Building natively requires somewhat fewer resources (memory and disk space) than building with containers but requires software, such a compilers and other tools, to be installed on the host system.  Since these software packages are different for each Linux distribution, this method requires more knowledge and patience to install required software that might not already be installed on your host computer.

Revision as of 19:04, 16 November 2023

The Software Development Kit (SDK) for AsteroidOS is a set of tools and libraries for developing software to run on AsteroidOS. Since AsteroidOS is a Linux distribution, you can use just about any programming language to develop software, but most of the core applications use a combination of C++ and Qt, with CMake to build. To get things running quickly, it's recommended to download and install the prebuilt version as described in Installing the SDK. This page describes how to build the SDK from source. Be aware that this can take several hours, even on a fast computer.

Which SDK?

One thing to note is that while this describes "the SDK", there are actually two versions -- the main one is used to develop software that runs on ARM-based watches running AsteroidOS. The other one is the SDK for developing applications that run on the emulator, which uses qemux86. See the Emulator page for details on the qemux86 version. This page describes only the main ARM-based SDK but building the emulator version is almost the same -- the difference is that instead of

source ./prepare-build.sh dory
bitbake meta-toolchain-qt5

you would do this instead:

source ./prepare-build.sh qemux86
bitbake meta-toolchain-qt5

You can install both SDKs on the same machine -- they do not interfere.

With or without software containers?

There are two choices to build the SDK: build natively without software containers or build within a software container (such as docker or podman).

Building natively requires somewhat fewer resources (memory and disk space) than building with containers but requires software, such a compilers and other tools, to be installed on the host system. Since these software packages are different for each Linux distribution, this method requires more knowledge and patience to install required software that might not already be installed on your host computer.

The alternative, building with software containers, is somewhat more simpler in that the required software is only installed within the container and not on your host computer, but it requires much more time to compile everything. Still, this may be preferable for people who wish to keep the build environment isolated from the host computer.

Building the Cross Compilation Toolchain

If you’ve already got an OpenEmbedded build directory via the Building AsteroidOS page, cd to that directory. Else, create one with:

Build without containers

git clone https://github.com/AsteroidOS/asteroid
cd asteroid/

Then, build the cross compilation toolchain with:

source ./prepare-build.sh dory
bitbake meta-toolchain-qt5

Build with containers

Assuming you already prepared a docker or podman build environment as described in Building AsteroidOS, build the SDK like so:

sudo docker rm -f asteroidos-toolchain
sudo docker run -it \
  --name asteroidos-toolchain \
  -v /etc/passwd:/etc/passwd:ro \
  -u "$(id -u):$(id -g)" \
  -v "$HOME/.gitconfig:/$HOME/.gitconfig:ro" \
  -v "$(pwd):/asteroid" asteroidos-toolchain \
  bash -c "source ./prepare-build.sh dory && bitbake meta-toolchain-qt5"

or

podman run --rm -it \
  -v "$(pwd)":/asteroid:z \
  --userns keep-id asteroidos-toolchain \
  bash -c "source ./prepare-build.sh dory && bitbake meta-toolchain-qt5"

Install the SDK

Whether you have built with or without containers, if the process was successful, you should have an SDK installation script tmp-glibc/deploy/sdk/oecore-x86_64-armv7vehf-neon-toolchain-nodistro.0.sh (relative to the build> directory). Follow these steps to install the SDK.

Related pages

installing the SDK

Building AsteroidOS

Creating an Asteroid app