【发布时间】:2018-02-14 14:53:52
【问题描述】:
需要在 Axis 相机上运行 Azure IoT SDK C 示例。使用标准 cmake 构建示例不起作用,因为它们是为 64 位 x86_84 编译的。需要将其编译为 MIPS32。
尤金·肖。建议为它制作一个工具链文件。我现在写了一个,但它在 16% 时失败并出现以下错误:
[ 16%] /usr/bin/cmake: /usr/local/lib/libcurl.so.4: no version information available (required by /usr/bin/cmake)
Building C object c-utility/CMakeFiles/aziotsharedutil.dir/adapters/uniqueid_linux.c.o
/demo/azure-iot-sdk-c/c-utility/adapters/uniqueid_linux.c:7:23: fatal error: uuid/uuid.h: No such file or directory
compilation terminated.
make[2]: *** [c-utility/CMakeFiles/aziotsharedutil.dir/adapters/uniqueid_linux.c.o] Error 1
make[1]: *** [c-utility/CMakeFiles/aziotsharedutil.dir/all] Error 2
make: *** [all] Error 2
我的工具链文件:
INCLUDE(CMakeForceCompiler)
SET(CMAKE_SYSTEM_NAME Linux) # this one is important
SET(CMAKE_SYSTEM_VERSION 1) # this one not so much
SET(CMAKE_SYSTEM_PROCESSOR mips)
# this is the location of the imps toolchain targeting the M1125
SET(CMAKE_C_COMPILER /usr/local/mipsisa32r2el/r23/bin/mipsisa32r2el-axis-linux-gnu-gcc)
# this is the file system root of the target
#SET(CMAKE_FIND_ROOT_PATH /usr/local/mipsisa32r2el/r23)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
并使用 ´./build.sh --toolchain-file toolchain-mips.cmake` 运行它。
如果我按照documentation 所说的那样运行它,使用 -cl --sysroot=/usr/local/mipissa32r2el/r23。我收到它无法找到 OpenSSL 并且更早失败的错误。
【问题讨论】:
-
您需要一个用于 MIPS 的交叉编译器工具链。这就是建议。
-
啊,当然。好建议。
标签: c compilation mips axis toolchain