Building a docker container

Hi, I am attempting to create Linux “Bookworm” docker container with the compiled Solar2D run-times so that I can use Solar2D to make on-screen training sequences for medical instruments, even use it to display results emerging from a patients vital signs. This top layer would be pure LUA. Hardware abstraction layers and middleware written in C++, may even use RTOS. The idea fits with the idea of making open source medical instrumentation and research instruments. So far I have made a container with all the dependencies needed to cross-compile the Solar2D so it can run on an multi-core Arm64 board running Linux Bookworm. Fairly painful work, but worthwhile to escape the clutches of Qt.

5 Likes

Sitrep: the docker container for building solar2D on a Toradex iMX8 SOM is done.

So the GitHub - coronalabs/corona: Solar2D Game Engine main repository (ex Corona SDK) repo has “master” and “experimental” branches.

I decided I would try to build for the “master” branch.

I am noticing that there are some new files in the “experimental” branch, and that the Makefile in the master branch hiccups as they are not on “master”

~/corona/platform/linux/build$ cmake -DCMAKE_TOOLCHAIN_FILE="…/imx8.cmake" …/
– The CXX compiler identification is GNU 12.2.0
– The C compiler identification is GNU 12.2.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Detecting C compiler ABI info
– Detecting C compiler ABI info - done
– Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
– Detecting C compile features
– Detecting C compile features - done
CORONA_ROOT: /home/torizon/corona
– Configuring done
CMake Error at CMakeLists.txt:846 (add_executable):
Cannot find source file:

/home/torizon/corona/librtt/Corona/CoronaObjects.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc

CMake Error at CMakeLists.txt:846 (add_executable):
No SOURCES given to target: Solar2D

CMake Error at CMakeLists.txt:883 (add_executable):
No SOURCES given to target: Solar2DSimulator

CMake Error at CMakeLists.txt:920 (add_executable):
No SOURCES given to target: Solar2DBuilder

CMake Generate step failed.

So the way forward is going to have to be a fork of the repository, and make some changes !

Cheers
RIchard

Sit.rep: So I had a look at the CMakeLists and made a new branch of my fork, you are welcome to come over and have a look…

To access it:
HBL001/corona at linux-build (github.com)

So back to the story, I changed the CMakeLists.txt replacing the “lua_to_native_unixeol.sh” to “lua_to_native.sh”. It made a big difference.

Also I had an issue where the linker was looking in the wrong directory, so I added

set(CMAKE_BUILD_RPATH “/usr/aarch64-linux-gnu/lib”)

and now to build… Oh no, not again, more…

[ 4%] Built target CoronaBuilder
[ 4%] Built target BuilderPluginDownloader
[ 4%] Built target CoronaBuilderPluginCollector
[ 4%] Built target create_build_properties
[ 4%] Built target config_require
[ 4%] Built target ftp
[ 4%] Built target headers
[ 4%] Built target http
[ 4%] Built target ltn12
[ 4%] Built target mbox
[ 4%] Built target mime
[ 4%] Built target smtp
[ 4%] Built target socket
[ 4%] Built target ssl
[ 4%] Built target tp
[ 4%] Built target url
[ 4%] Building CXX object CMakeFiles/Solar2D.dir/generated_src/init.cpp.o
In file included from /home/torizon/corona/librtt/Core/Rtt_Build.h:13,
from /home/torizon/corona/platform/linux/build/generated_src/init.cpp:11:
/home/torizon/corona/librtt/Core/Rtt_Version.h:39:24: error: operator ‘==’ has no left operand
39 | #if Rtt_BUILD_REVISION == Rtt_LOCAL_BUILD_REVISION
| ^~
make[2]: *** [CMakeFiles/Solar2D.dir/build.make:76: CMakeFiles/Solar2D.dir/generated_src/init.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:451: CMakeFiles/Solar2D.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I think there is a typo in here

The PushObjectFactories() method appears to be related to the Solar2D (formerly known as Corona SDK) framework. It is used for managing object factories within the display system. Let’s break it down:

  1. Purpose:
  • The PushObjectFactories() method is typically called during initialization or setup. It allows the display system to register various object factories (e.g., for creating images, text, shapes, etc.) that can be used throughout your application.
  1. Context:
  • In the context of Solar2D, the Rtt::Display class represents the display system. This class provides methods for creating and managing visual elements (sprites, images, text, etc.) that appear on the screen.
  1. Functionality:
  • The PushObjectFactories() method is responsible for adding built-in object factories (such as image factories) to the display system. These factories allow you to create instances of display objects (e.g., images) with specific properties (e.g., size, position, rotation).
  • By pushing object factories, you ensure that the display system knows how to create different types of objects when requested.

Was https://github.com/coronalabs/corona/issues/705 yours, or are you just both running into the same issue?

CoronaObjects.cpp is part of a pending branch. @vlads and I have been trying to keep it up-to-date, but this little goof slipped in. You should be able to simply remove the file from the project and try to build again. (And send along a PR if it’s fixed.)


PushObjectFactories() lets you add variants of Solar2D’s objects—Rtt::DisplayObject under the hood—with customized virtual methods, either by “before” and “after” logic and / or suppressing the original behavior. In particular, this can be used to mix actual rendering calls into object updates, where they can actually have some effect: an object might Draw() some OpenGL state change, for example.

It was mine. I was a little unsure the best place to raise my hand and ask !

The repo has more discussion, so I will head there

2 Likes