-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The aws sdk and libtorch build failed #2808
Comments
how are you installing the SDK? this error to me indicates that you have drift in your installation where you are including a header that expects these functions to be present but are using a binary where they are not present. Those specific functions were added in a 1.10 version a while ago. My guess if you clean installed the SDK install to a specific directory, you would not see this problem
also just for clarity this is not the linking stage of our project, this is during the linking of your build when |
Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one. |
Build S3 part of aws-sdk-cpp: http_predict/downLoad.cpp example code: // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
#include "torch/torch.h"
#include "torch/script.h"
#include <iostream>
#include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/GetObjectRequest.h>
#include <fstream>
#include "s3download.h"
bool AwsDoc::S3::GetObject(const Aws::String &objectKey,
const Aws::String &fromBucket,
const Aws::Client::ClientConfiguration &clientConfig) {
Aws::S3::S3Client client(clientConfig);
Aws::S3::Model::GetObjectRequest request;
request.SetBucket(fromBucket);
request.SetKey(objectKey);
Aws::S3::Model::GetObjectOutcome outcome =
client.GetObject(request);
if (!outcome.IsSuccess()) {
const Aws::S3::S3Error &err = outcome.GetError();
std::cerr << "Error: GetObject: " <<
err.GetExceptionName() << ": " << err.GetMessage() << std::endl;
}
else {
std::cout << "Successfully retrieved '" << objectKey << "' from '"
<< fromBucket << "'." << std::endl;
}
return outcome.IsSuccess();
}
#ifndef TESTING_BUILD
int main() {
Aws::SDKOptions options;
Aws::InitAPI(options);
{
//TODO(user): Change bucketName to the name of a bucket in your account.
const Aws::String bucketName = "<Enter bucket name>";
//TODO(user): Change objectName to the name of an object in the bucket.
//See create_bucket.cpp and put_object.cpp to create a bucket and load an object into that bucket.
const Aws::String objectName = "<Enter object name>";
Aws::Client::ClientConfiguration clientConfig;
// Optional: Set to the AWS Region in which the bucket was created (overrides config file).
// clientConfig.region = "us-east-1";
AwsDoc::S3::GetObject(objectName, bucketName, clientConfig);
}
Aws::ShutdownAPI(options);
return 0;
}
#endif // TESTING_BUILD s3download.h: #include <aws/core/Aws.h>
#include <aws/s3/S3Client.h>
#include <aws/s3/model/BucketLocationConstraint.h>
namespace AwsDoc {
namespace S3 {
bool GetObject(const Aws::String &objectKey,
const Aws::String &fromBucket,
const Aws::Client::ClientConfiguration &clientConfig);
extern std::mutex upload_mutex;
extern std::condition_variable upload_variable;
} // namespace S3
} // namespace AwsDoc |
Can you please clean your build and install folders and then try rebuilding this sdk? |
Describe the bug
The bug manifests as undefined references to specific functions in the AWS SDK during the linking stage of your project build.
Expected Behavior
I expect the project to be built successfully.
Current Behavior
Reproduction Steps
CMakeLists.txt :
Possible Solution
No response
Additional Information/Context
Only aws getobject is used in the actual source code.There is no problem when aws and libtorch build projects separately,This problem arises when the combination comes together.libtorch is available in version 1.7.0
AWS CPP SDK version used
AWS CPP SDK-1.11.237
Compiler and Version used
gcc-7.3.1
Operating System and version
centos
The text was updated successfully, but these errors were encountered: