aws-samples / aws-iot-securetunneling-localproxy

AWS Iot Secure Tunneling local proxy reference C++ implementation
https://docs.aws.amazon.com/iot/latest/developerguide/what-is-secure-tunneling.html
Apache License 2.0
74 stars 71 forks source link

CMAKE Error in building local proxy #31

Closed ccas007 closed 3 years ago

ccas007 commented 3 years ago

When following the instructions for building the local proxy, the final step, building the AWS code itself fails to build the make file giving an error that a REPLACE operation has the wrong number of arguments. Both the code downloaded from AWS and following the git download in the local proxy instructions fail the same way in the same place.

Other sources say that this can happen if a string argument is blank, not filled in by the CMAKE.

How do I fix this and build this?

kareali commented 3 years ago

Hi @ccas007 , Could you please send the whole build log? Also what version of the cmake are you using?

ccas007 commented 3 years ago
ubuntu@arm:/CareHub/IOT/dependencies/aws-iot-securetunneling-localproxy/build$ cmake ../CMake Error at CMakeLists.txt:49 (string):  string sub-command REPLACE requires at least four arguments.  CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):  Imported targets not available for Boost version 106900Call Stack (most recent call first):  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)  CMakeLists.txt:72 (find_package)  CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):  Imported targets not available for Boost version 106900Call Stack (most recent call first):  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)  CMakeLists.txt:72 (find_package)  CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):  Imported targets not available for Boost version 106900Call Stack (most recent call first):  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)  /usr/share/cmake-35/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)  CMakeLists.txt:72 (find_package)  CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):  Imported targets not available for Boost version 106900Call Stack (most recent call first):  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)  CMakeLists.txt:72 (find_package)  CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):  Imported targets not available for Boost version 106900Call Stack (most recent call first):  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)  CMakeLists.txt:72 (find_package)  CMake Warning at /usr/share/cmake-3.5/Modules/FindBoost.cmake:725 (message):  Imported targets not available for Boost version 106900Call Stack (most recent call first):  /usr/share/cmake-3.5/Modules/FindBoost.cmake:763 (_Boost_COMPONENT_DEPENDENCIES)  /usr/share/cmake-3.5/Modules/FindBoost.cmake:1332 (_Boost_MISSING_DEPENDENCIES)  CMakeLists.txt:72 (find_package)  -- Boost version: 1.69.0-- Found the following Boost libraries:--   system--   log--   log_setup--   thread--   program_options--   date_time-- Configuring incomplete, errors occurred!See also "/CareHub/IOT/dependencies/aws-iot-securetunneling-localproxy/build/CMakeFiles/CMakeOutput.log".See also "/CareHub/IOT/dependencies/aws-iot-securetunneling-localproxy/build/CMakeFiles/CMakeError.log".ubuntu@arm:/CareHub/IOT/dependencies/aws-iot-securetunneling-localproxy/build$ Christopher Smithcsmith@phasemargin.com From: Kareem AliSent: Wednesday, October 14, 2020 11:29 AMTo: aws-samples/aws-iot-securetunneling-localproxyCc: ccas007; MentionSubject: Re: [aws-samples/aws-iot-securetunneling-localproxy] CMAKE Error in building local proxy (#31)  Virus-free. www.avast.com
kareali commented 3 years ago

@ccas007 the log shows that you're using CMake 3.5. At least CMake 3.6 is required for this script, this is what's causing the error.

Because CMake 3.5 defines PROTOBUF_LITE_LIBRARY instead of Protobuf_LITE_LIBRARY and in the CMakeLists.txt we use Protobuf_LITE_LIBRARY and when CMake tries to find it can't so it throws an error that you need 4 arguments. The recommended fix would be to upgrade CMake to at least 3.6.