2017-01-11 3 views
1

Récemment mis à jour CMake vers la version 3.7.1 à partir de la version 2.8.1, qui fonctionnait parfaitement.Échec de l'identification du compilateur CMake C

La mise à jour nécessitait la suppression de la commande obsolète CMAKE_FORCE_C_COMPILER du fichier de chaîne d'outils, qui était utilisée pour ignorer la vérification automatique d'un compilateur actif.

J'ai essayé de régler la variable, SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) pour passer le test, mais il n'y a pas de changement de comportement.

Maintenant que les vérifications semblent nécessaires, CMake ne peut pas identifier mon compilateur (TriCore_v6.0r1).


Messages d'erreur:

L'identification du compilateur C n'a pas pu être trouvée dans "C: /Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.elf"

Le compilateur C identification introuvable dans "C: /Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.map"

L'identifiant du compilateur C est introuvable dans "C: /Build/CMakeFiles/3.7.1/CompilerIdC /CMakeCCompilerId.mdf "

L'identification du compilateur C n'a pas pu être trouvée dans "C: /Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.o"

le fichier Compiler source d'identification du compilateur C "CMakeCCompilerId.c" a échoué. compilateur: C: /TASKING/TriCore_v6.0r1/ctc/bin/cctc.exe drapeaux de Constitution: drapeaux Id: -AA

Note: selon l'usage, le compilateur n'accepte pas ce drapeau (-AA)

La sortie était la suivante:

ctc E200: ligne de commande: option "-A": sous-option non valide "a"

L'identification du compilateur C n'a pas pu être trouvée dans "C: /Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.elf"

L'identification du compilateur C n'a pas pu être trouvée dans « C:/Construire/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.map »

l'identification du compilateur C n'a pas pu être trouvée dans "C: /Build/CMakeFiles/3.7.1/CompilerIdC/CMakeCCompilerId.mdf"

Vérifier si le compilateur C IAR utilisant "" ne correspond pas à "IAR. + Compilateur":

Idéalement, j'aimerais que le compilateur soit reconnu, mais comme Altium ne supporte pas l'outil CMake, je me contenterais de sauter ces vérifications si cela résout mon problème et me permet de le recréer avec succès.

fichier Toolchain:

################################# 
# CMake Tool Chain File 
# for TASKING Build Environment 
################################# 

# Deprecated! 
# INCLUDE(CMakeForceCompiler) 

# Skip CMake’s checks for a working compiler by omitting compilation of CMakeCCompilerId.c 
# SET(CMAKE_C_COMPILER_ID "Tasking") 

# Try to force the compiler 
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "") 
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "") 

# Use of "Generic", because target system is an embedded device 
SET(CMAKE_SYSTEM_NAME Generic) 
SET(CMAKE_SYSTEM_VERSION 1) 
SET(can_use_assembler TRUE) 

# Specify the cross compiler 
SET(CCPATH $ENV{TASKING_PATH}) 
SET(CC "${CCPATH}/ctc/bin/cctc.exe") 
SET(CXX "${CCPATH}/ctc/bin/cctc.exe") 

SET(CMAKE_AR "${CCPATH}/ctc/bin/artc.exe" CACHE FILEPATH "Archiver") 

# Deprecated! 
# Force CMake to use the specified cross compiler 
# CMAKE_FORCE_C_COMPILER (${CC} ctc) 
# CMAKE_FORCE_CXX_COMPILER (${CXX} ctc) 


SET(CCVERBOSE "") 

# Specify compiler call notation and compiler flags 
SET(CMAKE_C_COMPILE_OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/bin/perl.exe ${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/compliation_manager.pl <CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> <SOURCE> -c") 

# Specify linker call notation and linker flags 
#SET(CMAKE_C_LINK_EXECUTABLE "<CMAKE_C_COMPILER> <OBJECTS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -r -o <TARGET>") 
#The Call to the perl script to manage the cross core linking, and will call the linker and scripts for updating the symbols 
SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/bin/perl.exe ${CMAKE_CURRENT_SOURCE_DIR}/../../DevelopmentEnv/BuildEnv/BuildUtilities/linking_manager.pl -DListOfObjects <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> -o <TARGET> -Wl--output=${PROJECT_NAME}.hex:IHEX:4,linear") 

# search for programs in the build host directories 
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) 

# search for libraries and headers in the target directories 
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) 
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) 

#Commented as previously used for Greenhills 
#SET (MAP_OPTIONS "-map=${PROJECT_NAME}.map -Ml -Mu -Mx -keepmap") 

SET (CORE0_C_FLAGS ${CCVERBOSE} "-t --core=tc1.6.x --iso=90 --eabi-compliant --integer-enumeration --language=-comments,-gcc,+volatile,-strings --switch=auto --align=0 --default-near-size=0 --default-a0-size=0 --default-a1-size=0 -O2ROPYG --tradeoff=4 -g --source -DOS_TRICOREARCH=OS_TRICOREARCH_16EP -DOS_CPU=OS_TC29XT -DUSE_TASKING_INIT=1 -DCOMPILERCFG_EXTENSION_MCAL_FILE -D__TRICORE -DDEM_DONT_PROVIDE_LEGACY_SYMBOLIC_NAMES -DTS_ARCH_FAMILY=TS_TRICORE -DTS_ARCH_DERIVATE=TS_TC29XT -DOS_KERNEL_TYPE=OS_SYSTEM_CALL -DOS_USE_TRACE=0 -DOS_USE_CLZ_QUEUE_ALGORITHM=1 -DOS_DEVELOPMENT_SANITY_CHECKS=0 -DOS_MEMORY_MODEL=OS_MM_DEFAULT -DOS_MEMMAP=0 -DOS_MULTICORE=OS_SINGLE -DOS_TRICORE_USED_CORE=0 -DOS_CPU=OS_TC29XT -DOS_TOOL=OS_tasking -DOS_ARCH=OS_TRICORE -DOS_RELEASE_SUFFIX=OS_AS403") 
SET (CORE0_LINK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/99_Env/LinkerScript/Core0-TRICORE-tasking.lsl") 
SET (CORE0_LIB "${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_c2038bfb98_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_ca2b8bdbb8_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Extended_error_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_user_lib_SoRoooS0.a") 
SET (CORE0_LINK_FLAGS ${CCVERBOSE} "-lrt -lc -DCore=0 -Wl--define=PreLink=ON -I${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/boards/TriboardTC29XT ${CORE0_LIB} -Wl-OCLtxY -Wl--error-limit=0 --map-file-format=+lsl --library=fp_fpu -d ${CORE0_LINK_FILE}") 

SET (CORE1_C_FLAGS ${CCVERBOSE} "-t --core=tc1.6.x --iso=90 --eabi-compliant --integer-enumeration --language=-comments,-gcc,+volatile,-strings --switch=auto --align=0 --default-near-size=0 --default-a0-size=0 --default-a1-size=0 -O2ROPYG --tradeoff=4 -g --source -DOS_TRICOREARCH=OS_TRICOREARCH_16EP -DOS_CPU=OS_TC29XT -DUSE_TASKING_INIT=0 -DCOMPILERCFG_EXTENSION_MCAL_FILE -D__TRICORE -DDEM_DONT_PROVIDE_LEGACY_SYMBOLIC_NAMES -DTS_ARCH_FAMILY=TS_TRICORE -DTS_ARCH_DERIVATE=TS_TC29XT -DOS_KERNEL_TYPE=OS_SYSTEM_CALL -DOS_USE_TRACE=0 -DOS_USE_CLZ_QUEUE_ALGORITHM=1 -DOS_DEVELOPMENT_SANITY_CHECKS=0 -DOS_MEMORY_MODEL=OS_MM_DEFAULT -DOS_MEMMAP=0 -DOS_MULTICORE=OS_SINGLE -DOS_TRICORE_USED_CORE=1 -DOS_CPU=OS_TC29XT -DOS_TOOL=OS_tasking -DOS_ARCH=OS_TRICORE -DOS_RELEASE_SUFFIX=OS_AS403") 
SET (CORE1_LINK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/99_Env/LinkerScript/Core1-TRICORE-tasking.lsl") 
SET (CORE1_LIB "${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_c203cbfb98_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Extended_error_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_user_lib_SoRoooS0.a") 
SET (CORE1_LINK_FLAGS ${CCVERBOSE} "-lrt -lc -DCore=1 -Wl--define=PreLink=ON -DSPM_PATH=${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/application/cvc/obj/ -I${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/boards/TriboardTC29XT ${CORE1_LIB} -Wl-OCLtxY -Wl--error-limit=0 --user-provided-initialization-code --library=fp_fpu -d ${CORE1_LINK_FILE}") 

SET (CORE2_C_FLAGS ${CCVERBOSE} "-t --core=tc1.6.x --iso=90 --eabi-compliant --integer-enumeration --language=-comments,-gcc,+volatile,-strings --switch=auto --align=0 --default-near-size=0 --default-a0-size=0 --default-a1-size=0 -O2ROPYG --tradeoff=4 -g --source -DOS_TRICOREARCH=OS_TRICOREARCH_16EP -DOS_CPU=OS_TC29XT -DUSE_TASKING_INIT=0 -DCOMPILERCFG_EXTENSION_MCAL_FILE -D__TRICORE -DDEM_DONT_PROVIDE_LEGACY_SYMBOLIC_NAMES -DTS_ARCH_FAMILY=TS_TRICORE -DTS_ARCH_DERIVATE=TS_TC29XT -DOS_KERNEL_TYPE=OS_SYSTEM_CALL -DOS_USE_TRACE=0 -DOS_USE_CLZ_QUEUE_ALGORITHM=1 -DOS_DEVELOPMENT_SANITY_CHECKS=0 -DOS_MEMORY_MODEL=OS_MM_DEFAULT -DOS_MEMMAP=0 -DOS_MULTICORE=OS_SINGLE -DOS_TRICORE_USED_CORE=2 -DOS_CPU=OS_TC29XT -DOS_TOOL=OS_tasking -DOS_ARCH=OS_TRICORE -DOS_RELEASE_SUFFIX=OS_AS403") 
SET (CORE2_LINK_FILE "${CMAKE_CURRENT_SOURCE_DIR}/99_Env/LinkerScript/Core2-TRICORE-tasking.lsl") 
SET (CORE2_LIB "${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_c203cbfb98_kern_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Extended_error_lib_SoRoooS0.a ${CMAKE_CURRENT_SOURCE_DIR}/01_Static/04_OS/Os_AS403/Lib/Os_Static_user_lib_SoRoooS0.a ") 
SET (CORE2_LINK_FLAGS ${CCVERBOSE} "-lrt -lc -DCore=2 -Wl--define=PreLink=ON -I${CMAKE_CURRENT_SOURCE_DIR}/01_Static/01_App/boards/TriboardTC29XT ${CORE2_LIB} -Wl-OCLtxY -Wl--error-limit=0 -Wl--user-provided-initialization-code --library=fp_fpu -d ${CORE2_LINK_FILE}") 
+0

Avez-vous essayé de créer votre propre [fichier CMake Toolchain] (https://cmake.org/cmake/help/v3.7/manual/cmake-toolchains.7.html)? Nous faisons quelque chose de similaire à la compilation croisée pour Linux. Puisque nous construisons pour l'hôte et une cible incorporée, nous spécifions la chaîne d'outils sur la ligne de commande avec '-DCMAKE_TOOLCHAIN_FILE = path/to/toolchain.cmake'. – jszakmeister

+0

'CMake ne peut pas identifier mon compilateur (TriCore_v6.0r1) .' - Essayez d'identifier le compilateur dans la chaîne d'outils, en définissant [CMAKE_C_COMPILER_ID] (https://cmake.org/cmake/help/v3.7/variable/CMAKE_LANG_COMPILER_ID.html) variable. Si aucune identification, répertoriée dans le document, convient à votre cas, vous pouvez utiliser n'importe quelle chaîne. Au moins, cela omet la compilation de 'CMakeCCompilerId.c', qui a échoué pour vous. – Tsyvarev

+0

Bienvenue dans StackOverflow. Pouvez-vous s'il vous plaît s'il vous plaît ajouter votre fichier toolchain? Juste à partir de la sortie, il semble y avoir quelque chose d'étrange. Si vous devez vraiment forcer le compilateur en utilisant 'SET (CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL" ")' et 'SET (CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL" ")' fonctionne toujours aussi avec les nouvelles versions de CMake. – Florian

Répondre

1

Merci à tous ceux qui ont répondu!

Comme suggéré @Florian, le compilateur pourrait être forcé en définissant les variables SET(CMAKE_C_COMPILER_WORKS TRUE CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_WORKS TRUE CACHE INTERNAL "")

Cependant, j'ai aussi remarqué que les variables ci-dessus sont unset sans les éléments suivants:
SET(CMAKE_C_COMPILER_FORCED TRUE CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_FORCED TRUE CACHE INTERNAL "")

Enfin, une autre paire de variables devait être définie pour empêcher une tentative d'identification fy le compilateur:
SET(CMAKE_C_COMPILER_ID_RUN TRUE CACHE INTERNAL "")
SET(CMAKE_CXX_COMPILER_ID_RUN TRUE CACHE INTERNAL "")