在 Amazon Linux 2 上从源代码构建 AWS 开发工具包 [英] Building the AWS SDK from source on Amazon Linux 2

查看:27
本文介绍了在 Amazon Linux 2 上从源代码构建 AWS 开发工具包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试跟进 aws-lamba-cpp 以降低构建应用程序的复杂性.

I am trying to follow up suggestion from aws-lamba-cpp to reduce complexity in building my application.

如果您选择在使用的相同 Amazon Linux 版本上构建lambda,您可以避免在 zip 文件中打包 C 运行时.

If you choose to build on the same Amazon Linux version used by lambda, you can avoid packaging the C runtime in your zip file.

阅读后:

这是我尝试过的:

% docker run -it amazonlinux:latest /bin/bash
$ cd /tmp/
$ yum -y install libcurl-devel openssl-devel libuuid-devel cmake3 wget tar gzip make gcc-c++
$ wget https://github.com/aws/aws-sdk-cpp/archive/refs/tags/1.9.9.tar.gz
$ tar xfz 1.9.9.tar.gz
$ cd aws-sdk-cpp-1.9.9/
$ mkdir build
$ cd build
$ cmake3 .. -DBUILD_ONLY=s3 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON
-- TARGET_ARCH not specified; inferring host OS to be platform compilation target
-- Building AWS libraries as shared objects
-- Generating linux build config
-- Building project version: 1.9.9
-- The CXX compiler identification is GNU 7.3.1
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.7")
--   Zlib library: /usr/lib64/libz.so
-- Encryption: Openssl
-- Found OpenSSL: /usr/lib64/libcrypto.so (found version "1.0.2k")
--   Openssl include directory: /usr/include
--   Openssl library: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so
-- Http client: Curl
-- Found CURL: /usr/lib64/libcurl.so (found version "7.61.1")
--   Curl include directory: /usr/include
--   Curl library: /usr/lib64/libcurl.so
-- Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC
-- Performing Test HAVE_ATOMICS_WITHOUT_LIBATOMIC - Success
CMake Error at CMakeLists.txt:184 (include):
  include could not find load file:

    AwsFindPackage


CMake Error at CMakeLists.txt:194 (add_subdirectory):
  The source directory

    /tmp/aws-sdk-cpp-1.9.9/crt/aws-crt-cpp

  does not contain a CMakeLists.txt file.


-- Add s3-crt:s3 to C2J_SPECIAL_NAME_LIST
-- Considering s3
-- Looking for pathconf
-- Looking for pathconf - found
-- Looking for umask
-- Looking for umask - found
-- The C compiler identification is GNU 7.3.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Updating version info to 1.9.9
-- Custom memory management enabled; stl objects now using custom allocators
-- Performing Test CURL_HAS_H2
-- Performing Test CURL_HAS_H2 - Success
-- Performing Test CURL_HAS_TLS_PROXY
-- Performing Test CURL_HAS_TLS_PROXY - Success
CMake Error at aws-cpp-sdk-core/CMakeLists.txt:496 (aws_use_package):
  Unknown CMake command "aws_use_package".


-- Configuring incomplete, errors occurred!
See also "/tmp/aws-sdk-cpp-1.9.9/build/CMakeFiles/CMakeOutput.log".
See also "/tmp/aws-sdk-cpp-1.9.9/build/CMakeFiles/CMakeError.log".

在 Amazon Linux 2 系统上构建 aws-sdk-cpp 的正确解决方案是什么?

What is the correct solution to build aws-sdk-cpp on an Amazon Linux 2 system ?

推荐答案

过去几周发生了一些变化,之前对我来说效果很好,现在我遇到了和你一样的错误.

Something changed in the past weeks, it worked fine for me before, now I got the same error as you.

使用子模块克隆为我修复了它:

Cloning with submodules fixed it for me:

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

(在 Git 2.13 及更高版本中,可以使用 --recurse-submodules 代替 --recursive)

(With version 2.13 of Git and later, --recurse-submodules can be used instead of --recursive)

这篇关于在 Amazon Linux 2 上从源代码构建 AWS 开发工具包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆