Deploying Carmenta Engine 5 Applications on Linux/ARM
Deploying applications
This article describes how to deploy a Carmenta Engine application on Linux/ARM.
The libraries that needs to be present when deploying a Carmenta Engine application on Linux/ARM is the same as the ones listed in Deploying Carmenta Engine 5 applications on Linux. The Deployment using packages and the Carmenta Engine packages sections in the same location are also valid for Linux/ARM.
Deploying .NET applications
For a .NET application, you should use the standard deployment method for such applications, i.e. run a 'dotnet publish ...' command. All needed Carmenta Engine components will be copied from the NuGet packages.
dotnet publish --runtime linux-arm64 --configuration Release --self-contained --output SimpleTileServer-linux-arm64
# Copy the Carmenta Engine SDK license for use as a runtime license key while developing
cp /etc/Carmenta/License.carmentakey SimpleTileServer-linux-arm64/data/License.carmentakey
LD_LIBRARY_PATH=. ./SimpleTileServer
Deploying Java applications
The packages used when deploying a Java application is in the same location as the once used when deploying a C++ application.
For a Java application, a Java Runtime Environment (JRE) version 8 or later must also be installed.
The Java applications can be built on the host computer and copied to the Linux/ARM device. Make sure the version of the Java SDK is equal to or lower than the Java runtime used on the device.
Deploying C++ applications
The rpm and deb packages for Linux/ARM, that can be used when deploying applications, are located in the /usr/share/carmenta/linux directory. Install them on the device with the system package manager before running the application. The carmenta.public.gpg key, that can be used to verify the signed rpm packages, is located in the same directory.
While developing, you can use your Carmenta Engine SDK license key as a runtime license on the Linux/ARM device. To run the samples, without changing the call to Runtime.Initialize, you can, after installing the carmenta-engine package, copy the License.carmentakey file from your /etc/Carmenta/ directory to the /etc/Carmenta/ directory on the Linux/ARM device.
Building C++ applications
To build a C++ application for Linux/ARM the host computer needs to have a cross compiler and the libraries necessary for building the application built for Linux/ARM installed.
The following example shows how to setup a cross compiler on Debian Linux.
# Install the C++ cross compiler
apt update && apt install g++-aarch64-linux-gnu
# Enable installing packages for the arm64 architecture
dpkg --add-architecture arm64
# Install libraries and tools needed for building the sample
apt update && apt install libx11-dev:arm64 make
# Install the Carmenta Engine packages for Linux/ARM
apt install /usr/share/carmenta/linux/carmenta-engine_5.*_arm64.deb /usr/share/carmenta/linux/carmenta-engine-dev_5.*_arm64.deb
Extract and build the HelloWorldX11, with the C++ cross compiler, on the host computer.
tar xf /usr/share/carmenta/samples/Applications/HelloWorldX11.tar.gz
cd HelloWorldX11
CXX=aarch64-linux-gnu-g++ make
Building Qt applications
Setup the cross compiler as described in Building C++ applications. To build Qt applications for Linux/ARM some additional packages needs to be installed.
# Install libraries and tools needed for building the sample
apt install qtdeclarative5-dev:arm64 qml-module-qtquick-controls:arm64 cmake
tar xf /usr/share/carmenta/samples/Applications/HelloWorldQtQuick.tar.gz
cd HelloWorldQtQuick
CXX=aarch64-linux-gnu-g++ cmake .
make
Testing applications in a container
For testing an application built for Linux/ARM, you can use Podman to test running the application before deploying to a device. To emulate the Linux/ARM environment, in the container, the QEMU user mode emulation binaries can be used.
apt install podman qemu-user-static
Below are some examples on how to run some of the Carmenta Engine sample applications in a container.
For the example below to work the Carmenta Samples Geodata needs to be installed and a Carmenta Engine SDK license needs to be registered on the host computer.
Running the .NET SimpleTileServer sample
Follow the instructions in Deploying .NET applications on Linux/ARM and, after starting the container, the Example for launching a deployed version of the SimpleTileServer sample application above.
For the example to work the deployed SimpleTileServer sample needs to be in your home directory on the host computer.
podman run --arch arm64 --rm -ti \\
-p 38624:38624 \\
-v /usr/share/carmenta/geodata-5.15:/usr/share/carmenta/geodata-5.15:ro \\
-v ${HOME}/SimpleTileServer-linux-arm64:/SimpleTileServer:ro \\
ubuntu:22.04
You should now have an interactive prompt inside the container. To download and install the required packages for Carmenta Engine and the SimpleTileServer sample, run:
# Install some libraries needed to run Carmenta Engine
apt update && apt install libicu70 libcurl4 libfontconfig1
LD_LIBRARY_PATH=. ./SimpleTileServer --urls "http://*:38624/;"
To view the SimpleTileServer sample running in the container, open http://localhost:38624/ in a web browser on the host computer.
Running the Java HelloWorldJava sample
Follow the instructions in Deploying Java applications on Linux/ARM before starting the container.
For the example to work the sample needs to be in your home directory on the host computer.
podman run --arch arm64 --rm -ti \\
-v /usr/share/carmenta/geodata-5.15:/usr/share/carmenta/geodata-5.15:ro \\
-v /etc/Carmenta/License.carmentakey:/etc/Carmenta/License.carmentakey:ro \\
-v /usr/share/carmenta/linux:/usr/share/carmenta/linux:ro \\
-v ${HOME}/HelloWorldJava:/HelloWorldJava:ro \\
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \\
-e DISPLAY \\
rockylinux:9
You should now have an interactive prompt inside the container. To download and install the required packages for Carmenta Engine and the HelloWorldJava sample, run:
# Install the Carmenta Engine runtime, Java and some libraries needed to run the sample
dnf install java-17-openjdk libglvnd-gles mesa-dri-drivers /usr/share/carmenta/linux/carmenta-engine-5.*.aarch64.rpm /usr/share/carmenta/linux/carmenta-engine-java-5.*.rpm
# Run the application
cd /HelloWorldJava
./run.sh
Running the C++ HelloWorldX11 sample
Follow the instructions in Building C++ applications and Deploying C++ applications on Linux/ARM before starting the container.
For the example to work the sample needs to be in your home directory on the host computer.
podman run --arch arm64 --rm -ti \\
-v /usr/share/carmenta/geodata-5.15:/usr/share/carmenta/geodata-5.15:ro \\
-v /etc/Carmenta/License.carmentakey:/etc/Carmenta/License.carmentakey:ro \\
-v /usr/share/carmenta/linux:/usr/share/carmenta/linux:ro \\
-v ${HOME}/HelloWorldX11:/HelloWorldX11:ro \\
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \\
-e DISPLAY \\
rockylinux:9
You should now have an interactive prompt inside the container. To download and install the required packages for Carmenta Engine and the HelloWorldX11 sample, run:
# Install the Carmenta Engine runtime and some libraries needed to run the sample
dnf install fontconfig libglvnd-gles libX11 mesa-dri-drivers /usr/share/carmenta/linux/carmenta-engine-5.*.aarch64.rpm
# Run the application
cd /HelloWorldX11
./HelloWorldX11
Running the C++ HelloWorldQtQuick sample
Follow the instructions in Building Qt applications before starting the container.
For the example to work the sample needs to be in your home directory on the host computer.
podman run --arch arm64 --rm -ti \\
-v /etc/Carmenta/License.carmentakey:/etc/Carmenta/License.carmentakey:ro \\
-v /usr/share/carmenta/linux:/usr/share/carmenta/linux:ro \\
-v ${HOME}/HelloWorldQtQuick:/HelloWorldQtQuick:ro \\
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \\
-e DISPLAY \\
ubuntu:22.04
You should now have an interactive prompt inside the container. To download and install the required packages for Carmenta Engine and the HelloWorldQtQuick sample, run:
apt update && apt install libqt5quick5-gles qml-module-qtquick-controls /usr/share/carmenta/linux/carmenta-engine_5.*_arm64.deb
# Run the application
cd /HelloWorldQtQuick
./HelloWorldQtQuick
You can follow the same instructions for building and running the HelloWorldQt sample, just install the libqt5gui5-gles package instead of the libqt5quick5-gles and the qml-module-qtquick-controls packages when running the sample.