AWS SDK CPP would not compile

Plugging away on a project where I need to reference the C++ SDK for AWS. I’m working on a small t3a.micro instance and this is how how the commands went:

~/sdk_build$ cmake ../aws-sdk-cpp -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH=/usr/local/ -DCMAKE_INSTALL_PREFIX=/usr/local/ -DBUILD_ONLY=”s3″

CMake Warning at CMakeLists.txt:9 (message):

  In 1.11 releases, we are releasing experimental alternative building

  mode.By setting -DLEGACY_BUILD=OFF you can test our advances in modern

  CMake building and provide early feedback.  The legacy support is set by

  default in 1.11, when you complete build updating scripts please update the

[…]
 — Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC

— Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC – Success

CMake Error at CMakeLists.txt:225 (include):

  include could not find requested file:

    AwsFindPackage

[…]

CMake Error at crt/aws-crt-cpp/CMakeLists.txt:140 (include):

  include could not find requested file:

    AwsSharedLibSetup

CMake Error at crt/aws-crt-cpp/CMakeLists.txt:197 (include):

  include could not find requested file:

    AwsCheckHeaders

CMake Error at crt/aws-crt-cpp/CMakeLists.txt:198 (aws_check_headers):

  Unknown CMake command “aws_check_headers”.

 

 

— Configuring incomplete, errors occurred!

 

 

Hmm, that seems odd. I have a note on what commands to run and these commands ran fine on another server only yesterday. I removed the cloned aws-cdk-cpp folder and tried again. Same thing. Maybe I’m missing something else?

I started stepping through my documents and noticed:

:~$ git clone –recurse-submodules https://github.com/aws/aws-sdk-cpp

Cloning into ‘aws-sdk-cpp’…

remote: Enumerating objects: 1081754, done.

remote: Counting objects: 100% (1215/1215), done.

remote: Compressing objects: 100% (630/630), done.

remote: Total 1081754 (delta 609), reused 772 (delta 411), pack-reused 1080539 (from 3)

Receiving objects: 100% (1081754/1081754), 633.97 MiB | 19.19 MiB/s, done.

Resolving deltas: 100% (857146/857146), done.

Updating files: 100% (135908/135908), done.

Submodule ‘aws-common-runtime/aws-crt-cpp’ (https://github.com/awslabs/aws-crt-cpp.git) registered for path ‘crt/aws-crt-cpp’

Cloning into ‘/home/ubuntu/aws-sdk-cpp/crt/aws-crt-cpp’…

remote: Enumerating objects: 11729, done.        

[…]

Receiving objects: 100% (112048/112048), 577.64 MiB | 24.84 MiB/s, done.

fatal: fetch-pack: invalid index-pack output

fatal: clone of ‘https://github.com/awslabs/aws-lc.git’ into submodule path ‘/home/ubuntu/aws-sdk-cpp/crt/aws-crt-cpp/crt/aws-lc’ failed

Failed to clone ‘crt/aws-lc’ a second time, aborting

fatal: Failed to recurse into submodule path ‘crt/aws-crt-cpp’

Ha! I hadn’t noticed that before. The git clone failure doesn’t show up in red and I was busy doing other things and didn’t notice the failure. The next command that I would run would be the cmake above, so of course it failed because the git clone failed. Now how to fix this?

Based on a memory related comment here, I decided to increased my AWS EC2 instance size from a t3a.micro to a t3a.small. And that was it. The git clone now works fine and everything compiled.

Scroll to top