REASY commented on PR #13157:
URL: https://github.com/apache/arrow/pull/13157#issuecomment-1196513157

   I've tried to add BUILD_SHARED_LIBS (related to 
https://github.com/aws/aws-sdk-cpp/issues/1334#issuecomment-595250929)
   ```
   diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
   index 5d1da18b7..f8679b04f 100644
   --- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
   +++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
   @@ -4552,6 +4552,7 @@ macro(build_awssdk)
      set(AWSSDK_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/awssdk_ep-install")
      set(AWSSDK_INCLUDE_DIR "${AWSSDK_PREFIX}/include")
      set(AWSSDK_LIB_DIR "lib")
   +  option(BUILD_SHARED_LIBS "Build shared libraries" ON)
   
      if(WIN32)
        # On Windows, need to match build types
   @@ -4781,6 +4782,7 @@ if(ARROW_S3)
        set_target_properties(AWS::aws-c-common
                              PROPERTIES INTERFACE_LINK_LIBRARIES
                                         "-pthread;pthread;-framework 
CoreFoundation")
   +    set(BUILD_SHARED_LIBS "ON")
      endif()
    endif()
   ```
   
   but getting the same error:
   ```
   Undefined symbols for architecture x86_64:
     
"Aws::S3::S3Client::GetObjectAttributes(Aws::S3::Model::GetObjectAttributesRequest
 const&) const", referenced from:
         vtable for arrow::fs::(anonymous namespace)::S3Client in 
libarrow.a(s3fs.cc.o)
     
"Aws::S3::S3Client::WriteGetObjectResponse(Aws::S3::Model::WriteGetObjectResponseRequest
 const&) const", referenced from:
         vtable for arrow::fs::(anonymous namespace)::S3Client in 
libarrow.a(s3fs.cc.o)
     
"Aws::S3::S3Client::GetObjectAttributesAsync(Aws::S3::Model::GetObjectAttributesRequest
 const&, std::__1::function<void (Aws::S3::S3Client const*, 
Aws::S3::Model::GetObjectAttributesRequest const&, 
Aws::Utils::Outcome<Aws::S3::Model::GetObjectAttributesResult, 
Aws::S3::S3Error> const&, std::__1::shared_ptr<Aws::Client::AsyncCallerContext 
const> const&)> const&, std::__1::shared_ptr<Aws::Client::AsyncCallerContext 
const> const&) const", referenced from:
         vtable for arrow::fs::(anonymous namespace)::S3Client in 
libarrow.a(s3fs.cc.o)
     
"Aws::S3::S3Client::GetObjectAttributesCallable(Aws::S3::Model::GetObjectAttributesRequest
 const&) const", referenced from:
         vtable for arrow::fs::(anonymous namespace)::S3Client in 
libarrow.a(s3fs.cc.o)
     
"Aws::S3::S3Client::WriteGetObjectResponseAsync(Aws::S3::Model::WriteGetObjectResponseRequest
 const&, std::__1::function<void (Aws::S3::S3Client const*, 
Aws::S3::Model::WriteGetObjectResponseRequest const&, 
Aws::Utils::Outcome<Aws::NoResult, Aws::S3::S3Error> const&, 
std::__1::shared_ptr<Aws::Client::AsyncCallerContext const> const&)> const&, 
std::__1::shared_ptr<Aws::Client::AsyncCallerContext const> const&) const", 
referenced from:
         vtable for arrow::fs::(anonymous namespace)::S3Client in 
libarrow.a(s3fs.cc.o)
     
"Aws::S3::S3Client::WriteGetObjectResponseCallable(Aws::S3::Model::WriteGetObjectResponseRequest
 const&) const", referenced from:
         vtable for arrow::fs::(anonymous namespace)::S3Client in 
libarrow.a(s3fs.cc.o)
   ld: symbol(s) not found for architecture x86_64
   clang: error: linker command failed with exit code 1 (use -v to see 
invocation)
   [179/185] Linking CXX shared library release/libgandiva_jni.900.0.0.dylib
   ninja: build stopped: subcommand failed.
   ec2-user@ip-x-x-x-x Desktop %
   ```
   
   I can see those simbols in libarrow.a, for example, GetObjectAttributes:
   ```
   ec2-user@ip-x-x-x-x arrow % nm ./cpp-build/cpp/release/libarrow.a | grep 
GetObjectAttributes
   no symbols
   no symbols
   no symbols
   no symbols
   no symbols
   no symbols
   no symbols
                    U 
__ZNK3Aws2S38S3Client19GetObjectAttributesERKNS0_5Model26GetObjectAttributesRequestE
                    U 
__ZNK3Aws2S38S3Client24GetObjectAttributesAsyncERKNS0_5Model26GetObjectAttributesRequestERKNSt3__18functionIFvPKS1_S5_RKNS_5Utils7OutcomeINS2_25GetObjectAttributesResultENS0_7S3ErrorEEERKNS6_10shared_ptrIKNS_6Client18AsyncCallerContextEEEEEESN_
                    U 
__ZNK3Aws2S38S3Client27GetObjectAttributesCallableERKNS0_5Model26GetObjectAttributesRequestE
   
   ```
   
   It is in the source code: 
[S3Client.h#L2563](https://github.com/aws/aws-sdk-cpp/blob/1.9.300/aws-cpp-sdk-s3/include/aws/s3/S3Client.h#L2563)
 and 
[S3Client.cpp#L1917](https://github.com/aws/aws-sdk-cpp/blob/1.9.300/aws-cpp-sdk-s3/source/S3Client.cpp#L1917)
 but cannot be found in the symbols:
   ```
   ec2-user@ip-x-x-x-x arrow % nm 
./cpp-build/cpp/awssdk_ep-prefix/src/awssdk_ep-build/aws-cpp-sdk-s3/libaws-cpp-sdk-s3.a
 | grep GetObjectAttributes
   ec2-user@ip-x-x-x-x arrow %
   ```
   
   @kou any thoughts?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to