Description
Describe the bug
While using the aws sdk in my code using Cmake, I get Could NOT find crypto (missing: crypto_LIBRARY) error since last 8 days, suddenly in Docker.
I dont get this error while building my code on Mac Os or Ubuntu Linux but see this error in Docker using Amazon Linux 2
Expected Behavior
cmake ../../
-- ###############################################
-- CMAKE_HOST_SYSTEM_NAME: Linux
-- ###############################################
LINUX OS IS = Ubuntu
-- Found AWS SDK for C++, Version: 1.9.192, Install Root:/usr/local, Platform Prefix:, Platform Dependent Libraries: pthread;crypto;ssl;z;curl
-- Components specified for AWSSDK: s3, application will be depending on libs: aws-cpp-sdk-s3;aws-cpp-sdk-core
-- Try finding aws-cpp-sdk-core
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Include Dir: /usr/include
-- LibCrypto Shared Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- LibCrypto Static Lib: /usr/lib/x86_64-linux-gnu/libcrypto.so
-- Found aws-cpp-sdk-core
-- Try finding aws-cpp-sdk-s3
-- Found aws-cpp-sdk-s3
-- Configuring done
-- Generating done
-- Build files have been written to:
Current Behavior
Step 38/40 : RUN cmake ../../
---> Running in f6107dab4a33
-- The C compiler identification is GNU 7.3.1
-- The CXX 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
-- 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
-- ###############################################
-- CMAKE_HOST_SYSTEM_NAME: Linux
-- ###############################################
LINUX OS IS AMZON LINUX
-- Found AWS SDK for C++, Version: 1.9.238, Install Root:/usr/local, Platform Prefix:, Platform Dependent Libraries: pthread;crypto;ssl;z;curl
-- Components specified for AWSSDK: s3, application will be depending on libs: aws-cpp-sdk-s3;aws-cpp-sdk-core
-- Try finding aws-cpp-sdk-core
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Found Threads: TRUE
CMake Error at /opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
Could NOT find crypto (missing: crypto_LIBRARY)
Call Stack (most recent call first):
/opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
/usr/local/lib64/s2n/cmake/modules/Findcrypto.cmake:67 (find_package_handle_standard_args)
/opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib64/s2n/cmake/s2n-config.cmake:9 (find_dependency)
/opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib64/aws-c-io/cmake/aws-c-io-config.cmake:4 (find_dependency)
/opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib64/aws-c-http/cmake/aws-c-http-config.cmake:3 (find_dependency)
/opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib64/aws-crt-cpp/cmake/aws-crt-cpp-config.cmake:3 (find_dependency)
/opt/cmake-3.13.3-Linux-x86_64/share/cmake-3.13/Modules/CMakeFindDependencyMacro.cmake:48 (find_package)
/usr/local/lib64/cmake/aws-cpp-sdk-core/aws-cpp-sdk-core-config.cmake:13 (find_dependency)
/usr/local/lib64/cmake/AWSSDK/AWSSDKConfig.cmake:307 (find_package)
CMakeLists.txt:55 (find_package)
Reproduction Steps
Docker FIle
FROM public.ecr.aws/amazonlinux/amazonlinux:2
RUN yum -y install unzip aws-cli
RUN amazon-linux-extras enable corretto8
RUN yum install java-1.8.0-amazon-corretto-devel -y
install boost
RUN yum install boost-devel -y
install dev tools complier etc
RUN yum groupinstall "Development Tools" -y
RUN curl https://cmake.org/files/v3.13/cmake-3.13.3-Linux-x86_64.tar.gz --output cmake-3.13.3-Linux-x86_64.tar.gz &&
tar -xvzf cmake-3.13.3-Linux-x86_64.tar.gz &&
mv cmake-3.13.3-Linux-x86_64 /opt &&
rm cmake-3.13.3-Linux-x86_64.tar.gz &&
ln -s /opt/cmake-3.13.3-Linux-x86_64/bin/cmake /usr/local/bin/cmake
#Install curl and openssl
RUN yum install curl-devel -y &&
yum install openssl-devel -y &&
yum install ninja-build -y
###################################################################
install AWS SDK s3 C++
###################################################################
WORKDIR /usr/
copy the aws sdk to Docker
RUN git clone --recurse-submodules https://github.com/aws/aws-sdk-cpp
change to this directory
WORKDIR /usr/aws-sdk-cpp/
RUN mkdir sdk_build
WORKDIR /usr/aws-sdk-cpp/sdk_build
run cmake to install its
#cmake ../aws-sdk-cpp/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/include -DBUILD_ONLY="s3"
RUN cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=/usr/local/include -DBUILD_ONLY="s3"
RUN make
RUN make install
The Aws sdk gets built nicely but when I use in my code
The following folder will be included
include_directories("${PROJECT_SOURCE_DIR}")
#Load required services/packages: This basic example uses S3.
find_package(AWSSDK REQUIRED COMPONENTS s3)
Possible Solution
No response
Additional Information/Context
No response
AWS CPP SDK version used
Latest
Compiler and Version used
-- The C compiler identification is GNU 7.3.1 -- The CXX compiler identification is GNU 7.3.1
Operating System and version
Amamzon Linux: latest