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

Sitrep: got myself a fork, cloned the repo, added my cross-compilation container and then selected the experimental branch. All the build files in the CMakelists.txt can be found I hope.

~/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
– Generating done
– Build files have been written to: ~/corona/platform/linux/build

~/corona/platform/linux/build$

Looking promising.

make VERBOSE = 1 (close eyes and fingers crossed).

1% good, 2% good, 3% good. Its made some executables, but wait…

[ 4%] Built target lua_binaries
make[2]: Entering directory ‘/home/torizon/corona/platform/linux/build’
/usr/bin/cmake -E env BUILD_CONFIG="" /home/torizon/corona/platform/linux/lua_to_native_unixeol.sh -m remdebug /home/torizon/corona/external/remdebug-1.0/src/remdebug/engine.lua /home/torizon/corona/platform/linux/build/generated_src/ /home/torizon/corona/platform/linux/build
No such file or directory

We don’t have a “lua_to_native_unixeol.sh” … but there is “lua_to_native.sh”.

Oooh.

Ahhh here we are…!

Linux: improving support and adding flatpak

bakeinflash committed on Mar 23, 2022

COMMAND ${CMAKE_COMMAND} -E env BUILD_CONFIG=${BUILD_CONFIG} ${CORONA_ROOT}/platform/linux/lua_to_native.sh ${LUA_FILE} ${Lua2CppOutputDir}/ ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS dos2unix)
COMMAND ${CMAKE_COMMAND} -E env BUILD_CONFIG=${BUILD_CONFIG} ${CORONA_ROOT}/platform/linux/lua_to_native_unixeol.sh ${LUA_FILE} ${Lua2CppOutputDir}/ ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS lua_binaries)

Right.

/platform/linux/lua_to_native.sh

was superseded by

/platform/linux/lua_to_native_unixeol.sh

But the script that is called up, does not exist. Did a search all over the repo and cannot see it. This looks like a forgot

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