aws / aws-sdk-cpp

AWS SDK for C++
Apache License 2.0
1.95k stars 1.05k forks source link

Build fails with 'error while loading shared libraries: libaws-cpp-sdk-identity-management.so:' #929

Closed glaubitz closed 4 years ago

glaubitz commented 6 years ago

Trying to build on Debian unstable with:

# apt install libcurl4-openssl-dev libssl-dev uuid-dev zlib1g-dev libpulse-dev ninja-build

and

$ cd aws-sdk-1.5.7
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja
$ ninja

fails with

glaubitz@epyc:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build$ ninja
[1/4] Linking CXX executable aws-cpp-sdk-identity-management-tests/aws-cpp-sdk-identity-management-tests
FAILED: aws-cpp-sdk-identity-management-tests/aws-cpp-sdk-identity-management-tests 
: && /usr/bin/c++  -O3 -DNDEBUG  -rdynamic aws-cpp-sdk-identity-management-tests/CMakeFiles/aws-cpp-sdk-identity-management-tests.dir/RunTests.cpp.o aws-cpp-sdk-identity-management-tests/CMakeFiles/aws-cpp-sdk-identity-management-tests.dir/auth/CognitoCachingCredentialsProviderTest.cpp.o aws-cpp-sdk-identity-management-tests/CMakeFiles/aws-cpp-sdk-identity-management-tests.dir/auth/PersistentCognitoIdentityProvider_JsonFileImplTest.cpp.o aws-cpp-sdk-identity-management-tests/CMakeFiles/aws-cpp-sdk-identity-management-tests.dir/auth/STSAssumeRoleCredentialsProviderTest.cpp.o  -o aws-cpp-sdk-identity-management-tests/aws-cpp-sdk-identity-management-tests  -Wl,-rpath,/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-identity-management:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-cognito-identity:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-sts:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/testing-resources:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core aws-cpp-sdk-identity-management/libaws-cpp-sdk-identity-management.so aws-cpp-sdk-cognito-identity/libaws-cpp-sdk-cognito-identity.so aws-cpp-sdk-sts/libaws-cpp-sdk-sts.so testing-resources/libtesting-resources.so aws-cpp-sdk-core/libaws-cpp-sdk-core.so -lpthread && cd /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-identity-management-tests && /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-identity-management-tests/aws-cpp-sdk-identity-management-tests
/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-identity-management-tests/aws-cpp-sdk-identity-management-tests: error while loading shared libraries: libaws-cpp-sdk-identity-management.so: cannot open shared object file: No such file or directory
[2/4] Linking CXX executable aws-cpp-sdk-s3-encryption-tests/aws-cpp-sdk-s3-encryption-tests
FAILED: aws-cpp-sdk-s3-encryption-tests/aws-cpp-sdk-s3-encryption-tests 
: && /usr/bin/c++  -O3 -DNDEBUG  -rdynamic aws-cpp-sdk-s3-encryption-tests/CMakeFiles/aws-cpp-sdk-s3-encryption-tests.dir/CryptoModulesTest.cpp.o aws-cpp-sdk-s3-encryption-tests/CMakeFiles/aws-cpp-sdk-s3-encryption-tests.dir/DataHandlersTest.cpp.o aws-cpp-sdk-s3-encryption-tests/CMakeFiles/aws-cpp-sdk-s3-encryption-tests.dir/EncryptionMaterialsTest.cpp.o aws-cpp-sdk-s3-encryption-tests/CMakeFiles/aws-cpp-sdk-s3-encryption-tests.dir/RunTests.cpp.o  -o aws-cpp-sdk-s3-encryption-tests/aws-cpp-sdk-s3-encryption-tests  -Wl,-rpath,/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/testing-resources:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-s3:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-kms:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-s3-encryption testing-resources/libtesting-resources.so aws-cpp-sdk-core/libaws-cpp-sdk-core.so aws-cpp-sdk-s3/libaws-cpp-sdk-s3.so aws-cpp-sdk-kms/libaws-cpp-sdk-kms.so aws-cpp-sdk-s3-encryption/libaws-cpp-sdk-s3-encryption.so -lpthread && cd /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-s3-encryption-tests && /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-s3-encryption-tests/aws-cpp-sdk-s3-encryption-tests
/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-s3-encryption-tests/aws-cpp-sdk-s3-encryption-tests: error while loading shared libraries: libtesting-resources.so: cannot open shared object file: No such file or directory
[3/4] Linking CXX executable aws-cpp-sdk-text-to-speech-tests/aws-cpp-sdk-text-to-speech-tests
FAILED: aws-cpp-sdk-text-to-speech-tests/aws-cpp-sdk-text-to-speech-tests 
: && /usr/bin/c++  -O3 -DNDEBUG  -rdynamic aws-cpp-sdk-text-to-speech-tests/CMakeFiles/aws-cpp-sdk-text-to-speech-tests.dir/RunTests.cpp.o aws-cpp-sdk-text-to-speech-tests/CMakeFiles/aws-cpp-sdk-text-to-speech-tests.dir/TextToSpeechManagerTests.cpp.o  -o aws-cpp-sdk-text-to-speech-tests/aws-cpp-sdk-text-to-speech-tests  -Wl,-rpath,/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-text-to-speech:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-polly:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/testing-resources:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core aws-cpp-sdk-text-to-speech/libaws-cpp-sdk-text-to-speech.so aws-cpp-sdk-polly/libaws-cpp-sdk-polly.so testing-resources/libtesting-resources.so aws-cpp-sdk-core/libaws-cpp-sdk-core.so -lpthread && cd /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-text-to-speech-tests && /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-text-to-speech-tests/aws-cpp-sdk-text-to-speech-tests
/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-text-to-speech-tests/aws-cpp-sdk-text-to-speech-tests: error while loading shared libraries: libaws-cpp-sdk-text-to-speech.so: cannot open shared object file: No such file or directory
[4/4] Linking CXX executable aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests
FAILED: aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests 
cd /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core-tests && /usr/bin/cmake -E copy_directory /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/aws-cpp-sdk-core-tests/resources /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core-tests && cd /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build && /usr/bin/c++  -O3 -DNDEBUG  -rdynamic aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/RunTests.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/VersionTests.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/auth/AWSAuthSignerTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/auth/AWSCredentialsProviderTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/auth/AWSHttpResourceClientTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/config/AWSProfileConfigLoaderTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/client/AWSClientTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/client/AWSErrorMashallerTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/aws/client/HttpSchemeMapperTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/http/HttpClientTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/http/HttpTypesMapperTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/http/SignalHandlerTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/http/URITest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/DNSTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/DateTimeTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/EnumOverflowTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/FileSystemUtilsTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/GetTheLightsTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/HashingUtilsTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/OSVersionInfoTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/StringUtilsTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/UUIDTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/crypto/CryptoStreamsTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/crypto/SymmetricCiphersTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/json/JsonSerializerTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/stream/PreallocatedStreamBufTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/stream/SimpleStreamBufTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/xml/XmlSerializerTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/threading/DefaultExecutorTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/threading/ReaderWriterLockTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/memory/AWSMemoryTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/memory/SimpleStringStreamTests.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/logging/LoggingTest.cpp.o aws-cpp-sdk-core-tests/CMakeFiles/aws-cpp-sdk-core-tests.dir/utils/ratelimiter/RateLimiterTests.cpp.o  -o aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests  -Wl,-rpath,/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/testing-resources:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core testing-resources/libtesting-resources.so aws-cpp-sdk-core/libaws-cpp-sdk-core.so -lpthread && cd /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core-tests && /local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests
/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build/aws-cpp-sdk-core-tests/aws-cpp-sdk-core-tests: error while loading shared libraries: libtesting-resources.so: cannot open shared object file: No such file or directory
ninja: build stopped: subcommand failed.
glaubitz@epyc:/local_scratch/glaubitz/home:glaubitz:branches:Cloud:Tools/aws-sdk-cpp/aws-sdk-cpp-1.5.7/build$

Seems like the build system tries to run tests in the build target which is not what it should do.

Also, it's apparently forgetting to set LD_LIBRARY_PATH to set the proper search path for the shared libraries it built.

The main README.md is also missing clear build instructions for Debian, openSUSE and Fedora.

KaibaLopez commented 4 years ago

Hi sorry for the lack of response on this, I'm doing some issue clean up and wanted to check on this, hopefully you're not still having this issue on the current version of the sdk. Let me know