cmake是否适用于交叉编译器Linaro链?

时间:2015-08-30 16:25:37

标签: cmake arm cross-compiling

我有一个C项目,它支持许多平台。它的发电机有Borland  Makefile,NMake Makefiles,MSVC 6,7,8,9,11,Eclipse CDT4 - Unix  Makefiles等我在Windows 7上用cmake生成了MSVC 9解决方案  没关系。

现在,我想在TI Sitara SDK上生成ARM Cortex A8项目  以上C项目。 TI Sitara SDK安装在Ubuntu 14.04 OS主机上  电脑。有一个交叉编译工具链:Ubuntu PC上的Linaro。

从原始的C项目文档中,看起来如下所示  适用于Sitara SDK,因为它使用Eclipse(但它有8.1.1  帮助窗口,高于CDT4)

Eclipse CDT4 ‐ Unix Makefiles
                              = Generates Eclipse CDT 4.0 project files.

我已经设置了编译器路径:

export CMAKE_C_COMPILER=/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc

export CMAKE_ECLIPSE_VERSION=4.2

当我运行cmake时,仍然存在这样的错误:

u64rj@u64rj-MS-7696:~/u64rj-Fixed/sdk-2-src$ cmake -G "Eclipse CDT4 - Unix Makefiles" -DBUILD=LINUX-ARMv7a -DCFG=Debug -DMATH=I32
-- CMAKE SCRIPTS VERSION 1.1.1.0
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:90 (file):
  file Internal CMake error when trying to open file:
  /home/u64rj-Fixed/sdk-2-src/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c
  for writing.
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:100 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:39 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
  common-build/cmake/sdk-project-include.cmake:1189 (project)
  CMakeLists.txt:4 (SDK_PROJECT)


CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:90 (file):
  file Internal CMake error when trying to open file:
  /home/u64rj-Fixed/sdk-2-src/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c
  for writing.
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:100 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:39 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
  common-build/cmake/sdk-project-include.cmake:1189 (project)
  CMakeLists.txt:4 (SDK_PROJECT)


CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:90 (file):
  file Internal CMake error when trying to open file:
  /home/u64rj-Fixed/sdk-2-src/CMakeFiles/2.8.12.2/CompilerIdC/CMakeCCompilerId.c
  for writing.
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:100 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:39 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCCompiler.cmake:131 (CMAKE_DETERMINE_COMPILER_ID)
  common-build/cmake/sdk-project-include.cmake:1189 (project)
  CMakeLists.txt:4 (SDK_PROJECT)


-- The C compiler identification is unknown
CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:90 (file):
  file Internal CMake error when trying to open file:
  /home/u64rj-Fixed/sdk-2-src/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
  for writing.
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:100 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:39 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID)
  common-build/cmake/sdk-project-include.cmake:1189 (project)
  CMakeLists.txt:4 (SDK_PROJECT)


CMake Error at /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:90 (file):
  file Internal CMake error when trying to open file:
  /home/u64rj-Fixed/sdk-2-src/CMakeFiles/2.8.12.2/CompilerIdCXX/CMakeCXXCompilerId.cpp
  for writing.
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:100 (CMAKE_DETERMINE_COMPILER_ID_WRITE)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCompilerId.cmake:39 (CMAKE_DETERMINE_COMPILER_ID_BUILD)
  /usr/share/cmake-2.8/Modules/CMakeDetermineCXXCompiler.cmake:127 (CMAKE_DETERMINE_COMPILER_ID)
  common-build/cmake/sdk-project-include.cmake:1189 (project)
  CMakeLists.txt:4 (SDK_PROJECT)


-- The CXX compiler identification is unknown
-- Could not determine Eclipse version, assuming at least 3.6 (Helios). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.
-- Check for working C compiler: /home/u64rj-Fixed/sdk-2-src/arm-linux-gnueabihf-gcc
CMake Error: your C compiler: "/home/u64rj-Fixed/sdk-2-src/arm-linux-gnueabihf-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: Internal CMake error, TryCompile configure of cmake failed
-- Check for working C compiler: /home/u64rj-Fixed/sdk-2-src/arm-linux-gnueabihf-gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler
  "/home/u64rj-Fixed/sdk-2-src/arm-linux-gnueabihf-gcc"
  is not able to compile a simple test program.

  It fails with the following output:





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  common-build/cmake/sdk-project-include.cmake:1189 (project)
  CMakeLists.txt:4 (SDK_PROJECT)


CMake Error: your C compiler: "/home/u64rj-Fixed/sdk-2-src/arm-linux-gnueabihf-gcc" was not found.   Please set CMAKE_C_COMPILER to a valid compiler path or name.
CMake Error: your CXX compiler: "/home/u64rj-Fixed/sdk-2-src/arm-linux-gnueabihf-g++" was not found.   Please set CMAKE_CXX_COMPILER to a valid compiler path or name.
-- Configuring incomplete, errors occurred!
See also "/home/u64rj-Fixed/sdk-2-src/CMakeFiles/CMakeOutput.log".
See also "/home/u64rj-Fixed/sdk-2-src/CMakeFiles/CMakeError.log".
u64rj@u64rj-MS-7696:~/u64rj-Fixed/sdk-2-src$ 

ARMv7a是TI Sitara AM3358芯片构建中的架构。

我不知道为什么它会在C项目路径中搜索交叉编译器:     CMake错误:您的C编译器:" / home / u64rj-Fixed / sdk-2-src / arm-linux-gnueabihf-gcc"没找到。请将CMAKE_C_COMPILER设置为有效的编译器路径或名称。     CMake错误:内部CMake错误,cmake的TryCompile配置失败      - 检查工作的C编译器:/ home / u64rj-Fixed / sdk-2-src / arm-linux-gnueabihf-gcc - broken

即使工具链的交叉编译器是由导出CMAKE_C_COMPILER = / home / u64rj / ti-processor-sdk-linux-am335x-evm-01.00.00.03 / linux-devkit / sysroots / i686-arago-的Linux的/ usr /斌/臂-Linux的gnueabihf-GCC

谢谢,

0 个答案:

没有答案