Compiler support during CMake cache tests phase

已回答

Hi all,

I am currently trying to setup CLion for cross compiling projects using the Texas Instruments cl2000 compiler (this is for C28x chips). I know such configuration is not supported out of the box but I had success in the past setting up similar compilers.

My current setup is to define a toolchain file in order to indicate the compiler and other tools (ar, nm, strip, ...) and the locations of the compiler libraries and headers. The setup is functional as using CMake on the command line I can build the project. In CLion I can also build the project but I get an error when the CMake cache is being created or reloaded (which makes me think that it is due to a step which is internal to CLion).

The error is the following:

Cannot get compiler information for configuration Debug:
    Compiler exited with error code 1: /Applications/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/bin/cl2000 -xc --include_path=/Applications/ti/ccsv7/tools/compiler/ti-cgt-c2000_16.9.1.LTS/bin/../include -v -dD -E
    Fatal error: cannot open source file "@/private/var/folders/1w/0ljwcxvs45v2qz5bvkt4fr4w0000gn/T/compiler-arguments.txt"
    1 catastrophic error detected in the compilation of "@/private/var/folders/1w/0ljwcxvs45v2qz5bvkt4fr4w0000gn/T/compiler-arguments.txt".
    Compilation terminated.

The error is caused by the fact that the flags (-xc -dD and -E) do not have a "correct" meaning for the cl2000 compiler.

Question: is there any documentation on how this step is conducted in CLion? or is there any way to modify the underlying script?

 

0

CLion doesn't support the mentioned compiler yet. As a workaround, you might try to open CMakeCache.txt directly instead, does that help?

-1

I have the same here with the IAR compiler:

Cannot get compiler information:

Cannot get compiler information:
Compiler exited with error code 2: C:\Program Files (x86)\IAR Systems\Embedded Workbench 7.3\arm\bin\iccarm.exe -xc -DDEBUG=1 -DHSE_VALUE=((uint32_t)8000000) -DSTM32F469_479xx -DUSE_RTOS=0 -DUSE_STDPERIPH_DRIVER -Dstd= -IC:\\Projects\\chameleon\\branch\\mcu_32f469\\platform\\embedded\\test\\DynamicAnalysis\\CppTestLib\\cpptest-embedded\\inc -IC:\\Projects\\chameleon\\branch\\mcu_32f469\\platform\\embedded\\test\\DynamicAnalysis\\CppTestLib\\cpptest-embedded\\target -fpch-preprocess -v -dD -E
Command line error: Unable to open the command file "pch-preprocess"
0

Can anybody explain which compiler information is expected by this step?

"Cannot get compiler information:"
0
Avatar
Permanently deleted user

I try to use Clion build android ndk using CMake, I change the toolchains file.

Reload get error below

Cannot get compiler information:
Compiler exited with error code 1: /Users/xxx/Android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang -xc -Dmtmvcore_EXPORTS -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fno-integrated-as -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -O0 -fno-limit-debug-info -fPIC -fpch-preprocess -v -dD -E
Android clang version 3.8.275480 (based on LLVM 3.8.275480)
Target: x86_64-apple-darwin17.3.0
Thread model: posix
InstalledDir: /Users/xxx/Android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin
clang: warning: argument unused during compilation: '-mfloat-abi=softfp'
clang: warning: argument unused during compilation: '-mfpu=vfpv3-d16'
clang: warning: argument unused during compilation: '-mthumb'
clang: warning: argument unused during compilation: '-Wa,--noexecstack'
"/Users/xxx/Android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name compiler-file -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -no-integrated-as -munwind-tables -target-cpu armv7-a -target-linker-version 2.24 -v -dwarf-column-info -debug-info-kind=standalone -dwarf-version=2 -debugger-tuning=lldb -ffunction-sections -resource-dir /Users/xxx/Android/android-ndk/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib64/clang/3.8.275480 -D mtmvcore_EXPORTS -D ANDROID -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D ___CIDR_DEFINITIONS_END -O0 -Wformat -Werror=format-security -fno-dwarf-directory-asm -fno-autolink -fdebug-compilation-dir /Users/xxx/projects/mtmvcore-ws/MTMVCore/src/cmake-build-debug-android -ferror-limit 19 -fmessage-length 0 -stack-protector 2 -fblocks -fobjc-runtime=macosx-10.13.0 -fencode-extended-block-signature -fmax-type-align=16 -fdiagnostics-show-option -dD -o - -x c /private/var/folders/x3/91mwj2j166sbl3w1_lf27l200000gn/T/compiler-file
error: unknown target CPU 'armv7-a'

2

请先登录再写评论。