I have an environment script of yocto toolchain which sets all the environmental variables like CC
CXX
PATH
etc.
Basically it has the following lines:
export CC="arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=$SDKTARGETSYSROOT"
export CXX="arm-oe-linux-gnueabi-g++ -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=$SDKTARGETSYSROOT"
I sourced
this file in my current shell
and ran cmake
command. Then I get the following error in CMakeError.log
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /home/ramana/9150/toolchain/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/ramana/9150/toolchain/sysroots/cortexa8hf-vfp-neon-oe-linux-gnueabi
Build flags:
Id flags:
The output was:
No such file or directory
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: /home/ramana/9150/toolchain/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/ramana/9150/toolchain/sysroots/cortexa8hf-vfp-neon-oe-linux-gnueabi
Build flags:
Id flags: -c
The output was:
No such file or directory
and so on.
If I do ls
on that file:
ramana@ramana-VirtualBox:~/9150$ ls -l /home/ramana/9150/toolchain/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc
-rwxr-xr-x 1 ramana ramana 862352 Jan 23 17:38 /home/ramana/9150/toolchain/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc
so file exists in that path.
Next I tried setting CMAKE_C_COMPILER
and CMAKE_CXX_COMPILER
in CMakeLists.txt
as:
set (CMAKE_C_COMPILER $ENV{CC})
set (CMAKE_CXX_COMPILER $ENV{CXX})
Now I get the same error in CMakeError.log
:
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/ramana/9150/toolchain/sysroots/cortexa8hf-vfp-neon-oe-linux-gnueabi
Build flags:
Id flags:
The output was:
No such file or directory
Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
Compiler: arm-oe-linux-gnueabi-gcc -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=/home/ramana/9150/toolchain/sysroots/cortexa8hf-vfp-neon-oe-linux-gnueabi
Build flags:
Id flags: -c
The output was:
No such file or directory
Then I tried the command line option using
cmake -DCMAKE_C_COMPILER=$CC
Then I get the same error with compiler options
missing. So I added double quotes to $CC
above. Then I get the same error as in previous two scenarios.
These are recommended options available, but I failed to use these. What am I missing here? Please help. Thanks in advance