Hello,
currently im trying to setup a cmake project which should be used to compile an application for the infineon aurix tc29xb microcontroller using the tasking toolchain.
The cmake project must be usable under windows and linux (docker container).
Since cmake 3.25 there is an official support for the tasking toolchain (thanks @go2sh !).
I started to setup the cmake project under linux (debian with installed build-essentials).
Therefore i created a toolchain file (tasking_toolchain.cmake) which is passed on the command line when invoking cmake to configure the project.
The toolchain file currently looks as followed:
message(STATUS "## DEBUG - Toolchain file entered!")
# Determine the tasking tricore toolchain binary paths.
# The user must provide the environment variable 'TASKING_TRICORE_TOOLCHAIN_PATH'
# which points to the installation directory of the tasking toolchain for the tricore.
# Example: C:/Tasking/ctc
# In the example the path 'C:/Tasking' could also contain other architecture toolchains, e.g. 'c51', 'carm', ...
# The toolchain for the tricore microcontroller is located in the subdirectoy 'ctc'.
set(TOOLCHAIN_PATH $ENV{TASKING_TRICORE_TOOLCHAIN_PATH})
set(TOOLCHAIN_BIN_PATH ${TOOLCHAIN_PATH}/bin)
set(EXE_SUFFIX ${CMAKE_EXECUTABLE_SUFFIX})
message(STATUS "## DEBUG - TOOLCHAIN_BIN_PATH=${TOOLCHAIN_BIN_PATH}")
set(CMAKE_SYSTEM_NAME "Generic")
set(CMAKE_SYSTEM_PROCESSOR "TriCore")
set(CMAKE_TASKING_TOOLSET "TriCore")
find_program(CMAKE_C_COMPILER
NAMES cctc${EXE_SUFFIX}
HINTS ${TOOLCHAIN_BIN_PATH}
)
find_program(CMAKE_CXX_COMPILER
NAMES cctc${EXE_SUFFIX}
HINTS ${TOOLCHAIN_BIN_PATH}
)
find_program(CMAKE_LINKER
NAMES cctc${EXE_SUFFIX}
HINTS ${TOOLCHAIN_BIN_PATH}
)
Using this toolchain file on the linux container worked so far to compile a minimal example.
Invocation:
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="./cmake/tasking/tasking_toolchain.cmake"
At this point i already was not clear on what binary to use for the C and CXX compiler variables.
Coming from GCC i would use the “ctc” and “cptc” binaries but this did not work.
Compiler identification unknown and not able to compile a simple test program.
Therefore i used the “cctc” for the C and CXX compiler, as well as for the linker.
When this was working i thought i got it.
Anyway build time was extremely slow on the docker container due to dependency scanning of a linked library (own mcal with iLLD).
To check if the slow build is related to the docker container i wanted to run the cmake configuration and build under windows with the same toolchain file which worked under linux.
First invocation failed since it just used the MSVC compiler.
I remembered that i run into same issues before when using GCC (e.g. cygwin or hightec compiler) without specified generator to use.
So i added the generator which should be used, the invocation therefore looked as followed:
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE="./cmake/tasking/tasking_toolchain.cmake" -G"Unix Makefiles"
This lead to the following error:
“CMake was unable to find a build program corresponding to “Unix Makefiles”. CMAKE_MAKE_PROGRAM is not set.”
So i added the following to the toolchain file:
find_program(CMAKE_MAKE_PROGRAM
NAMES cctc${EXE_SUFFIX}
HINTS ${TOOLCHAIN_BIN_PATH}
)
Also using the “cctc” here instead of the concrete make binary (e.g. amk or mktc) due to the previous issues when setting the compiler.
Now the output when invoking cmake as before is as followed:
-- The C compiler identification is Tasking 6.3
-- The CXX compiler identification is Tasking 6.3
-- Detecting C compiler ABI info
And here it hangs when detecting the C compiler ABI info.
After about 10 minutes it states that detecting the C compiler ABI info failed and afterwards it checks for a working C compiler (using the cctc), which also hangs for multiple minutes and fails as well.
The C compiler is not able to compile a simple test program.
Detailed output:
-- Check for working C compiler: C:/TASKING/ctc/bin/cctc.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.25/Modules/CMakeTestCCompiler.cmake:70 (message):
The C compiler
"C:/TASKING/ctc/bin/cctc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty
Run Build Command(s):C:/TASKING/ctc/bin/cctc.exe -f Makefile cmTC_651cb/fast && cctc E200: commandline: cannot open option file "#"
cctc E201: unknown option: "-B$(CMAKE_BINARY_DIR)"
cctc E201: unknown option: "--regenerate-during-build"
cctc E201: unknown option: "-B$(CMAKE_BINARY_DIR)"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc E201: unknown option: "--progress-dir=C:/dev/eec-board-drc_01-mcu/build/drc/ReleaseWin/CMakeFiles/CMakeScratch/TryCompile-5osoty/CMakeFiles"
cctc E201: unknown option: "--progress-num=1,2"
cctc F105: more than 42 errors - aborting
This happens on both (windows and linux).
When running without the specified generator on linux it works, so i guess its just using the default make which comes with the build-essentials.
I could use another make (cygwin, mingw) on windows as well, but shouldn’t it work using the binaries of the toolchain?
Does anyone (maybe @go2sh , @brad.king) can help me to correctly setup the usage of the tasking toolchain?
I’m totally stuck at this point and would be glad about any help.
Thanks in advance!
Regards,
Manuel