Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to cross compile the sdk on mips? #1635

Closed
Kelephant opened this issue May 17, 2021 · 2 comments
Closed

how to cross compile the sdk on mips? #1635

Kelephant opened this issue May 17, 2021 · 2 comments

Comments

@Kelephant
Copy link

there is my option,but i get some error,how can i resolve it?
1、 export CC=mips-linux-uclibc-gnu-gcc
export CXX=mips-linux-uclibc-gnu-g++
export AR=mips-linux-uclibc-gnu-ar
export LD=mips-linux-uclibc-gnu-ld

2、mkdir build && cd build
3、cmake ..

error
Found the following definitions for ota_demo_core_mqtt: ROOT_CA_CERT_PATH, CLIENT_IDENTIFIER, OS_NAME, OS_VERSION, HARDWARE_PLATFORM_NAME
WARNING: ota_demo_core_mqtt missing definitions for macros: AWS_IOT_ENDPOINT, CLIENT_CERT_PATH, CLIENT_PRIVATE_KEY_PATH, CLIENT_USERNAME, CLIENT_PASSWORD
To run ota_demo_core_mqtt, define required macros in ota_demo_core_mqtt/demo_config.h.

Using values in demo_config.h to define the following macros for shadow_demo_main:
ROOT_CA_CERT_PATH
CLIENT_IDENTIFIER
THING_NAME
OS_NAME
OS_VERSION
HARDWARE_PLATFORM_NAME
Found the following definitions for shadow_demo_main: ROOT_CA_CERT_PATH, CLIENT_IDENTIFIER, THING_NAME, OS_NAME, OS_VERSION, HARDWARE_PLATFORM_NAME
WARNING: shadow_demo_main missing definitions for macros: AWS_IOT_ENDPOINT, CLIENT_CERT_PATH, CLIENT_PRIVATE_KEY_PATH, CLIENT_USERNAME, CLIENT_PASSWORD
To run shadow_demo_main, define required macros in shadow_demo_main/demo_config.h.

CMake Warning at demos/CMakeLists.txt:25 (message):
rt library could not be found. Demos that use it will be excluded from the
default target.

Downloading the Amazon Root CA certificate...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1188 100 1188 0 0 5613 0 --:--:-- --:--:-- --:--:-- 5630
Downloading the Baltimore Cybertrust Root CA certificate...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1262 100 1262 0 0 6769 0 --:--:-- --:--:-- --:--:-- 6784
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
LIB_RT
linked by target "ota_demo_core_http" in directory /home/wqk/aws/t31/aws-iot-device-sdk-embedded-c/demos/ota/ota_demo_core_http
linked by target "ota_demo_core_mqtt" in directory /home/wqk/aws/t31/aws-iot-device-sdk-embedded-c/demos/ota/ota_demo_core_mqtt

-- Configuring incomplete, errors occurred!
See also "/home/wqk/aws/t31/aws-iot-device-sdk-embedded-c/build/CMakeFiles/CMakeOutput.log".
See also "/home/wqk/aws/t31/aws-iot-device-sdk-embedded-c/build/CMakeFiles/CMakeError.log".

@yourslab
Copy link
Contributor

There are a couple of problems I notice. The first, I see that you are missing the following definitions:

WARNING: ota_demo_core_mqtt missing definitions for macros: AWS_IOT_ENDPOINT, CLIENT_CERT_PATH, CLIENT_PRIVATE_KEY_PATH, CLIENT_USERNAME, CLIENT_PASSWORD

You can do this by passing these as CMake flags. It works similarly for all other demos with the same warning message:

cmake .. -DAWS_IOT_ENDPOINT="---" -DCLIENT_ 
dc CERT_PATH="---" -DCLIENT_PRIVATE_KEY_PATH="---" -DCLIENT_USERNAME="---" -DCLIENT_PASSWORD="---"

Note that this is not required if you do not need the demo. The warning is just there to state that the demo won't compile by default upon entering make.

The other problem is that the rt library is required by the OTA and S3 multithreaded demos. There are various sources on the internet that have the rt library precompiled with the mips toolchain that you can then install to your filesystem though I have not tested them myself. However, if you do not have any need for these demos, you can simply remove these lines to exclude demos that require the rt library from building:
https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/http/http_demo_s3_download_multithreaded/CMakeLists.txt#L9-L43
https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/ota/ota_demo_core_http/CMakeLists.txt#L11-L64
https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/ota/ota_demo_core_mqtt/CMakeLists.txt#L10-L57

@Kelephant
Copy link
Author

There are a couple of problems I notice. The first, I see that you are missing the following definitions:

WARNING: ota_demo_core_mqtt missing definitions for macros: AWS_IOT_ENDPOINT, CLIENT_CERT_PATH, CLIENT_PRIVATE_KEY_PATH, CLIENT_USERNAME, CLIENT_PASSWORD

You can do this by passing these as CMake flags. It works similarly for all other demos with the same warning message:

cmake .. -DAWS_IOT_ENDPOINT="---" -DCLIENT_ 
dc CERT_PATH="---" -DCLIENT_PRIVATE_KEY_PATH="---" -DCLIENT_USERNAME="---" -DCLIENT_PASSWORD="---"

Note that this is not required if you do not need the demo. The warning is just there to state that the demo won't compile by default upon entering make.

The other problem is that the rt library is required by the OTA and S3 multithreaded demos. There are various sources on the internet that have the rt library precompiled with the mips toolchain that you can then install to your filesystem though I have not tested them myself. However, if you do not have any need for these demos, you can simply remove these lines to exclude demos that require the rt library from building:
https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/http/http_demo_s3_download_multithreaded/CMakeLists.txt#L9-L43
https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/ota/ota_demo_core_http/CMakeLists.txt#L11-L64
https://github.com/aws/aws-iot-device-sdk-embedded-C/blob/main/demos/ota/ota_demo_core_mqtt/CMakeLists.txt#L10-L57

Thank you for your help. I have resolved it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants