lidavidm commented on pull request #11889:
URL: https://github.com/apache/arrow/pull/11889#issuecomment-988271237


   Thanks! Unfortunately I still get a lot of linker errors using the repro 
from JIRA, but at least the Abseil issues are eliminated. I think the remaining 
issues are just because of the order of libraries/needing to repeat libraries.
   
   This is what CMake generates, which fails with linker errors:
   ```
   /usr/bin/c++ -O3 -DNDEBUG  CMakeFiles/arrow_example.dir/example.cc.o -o 
arrow_example  /home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a  
/home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a  
-pthread  /usr/lib/x86_64-linux-gnu/libssl.so  
/usr/lib/x86_64-linux-gnu/libcrypto.so  -lrt  
/home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a
   ```
   The errors indicate `libarrow_flight.a` is missing symbols from `libarrow.a` 
and the bundled gRPC is missing symbols from OpenSSL.
   
   This works:
   ```
   /usr/bin/c++ -O3 -DNDEBUG  CMakeFiles/arrow_example.dir/example.cc.o -o 
arrow_example  
/home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_flight.a  
/home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow.a  -pthread 
/home/lidavidm/Code/upstream/arrow-14708/install/lib/libarrow_bundled_dependencies.a
  /usr/lib/x86_64-linux-gnu/libssl.so  /usr/lib/x86_64-linux-gnu/libcrypto.so  
-lrt
   ```
   i.e. link libarrow_flight, then libarrow, then 
libarrow_bundled_dependencies, then OpenSSL.
   
   Flipping the order of libraries in the CMakeLists.txt fixes the first issue, 
so I suppose this is user error, or we're missing some dependency expressed in 
CMake(?).
   
   The installed ArrowFlightTargets.cmake does *not* declare arrow_static in 
INTERFACE_LINK_LIBRARIES - my CMake understanding is poor but perhaps we need 
to do so? (It is odd because arrow_static is in the STATIC_LINK_LIBS in 
flight/CMakeLists.txt.) Also, ArrowTargets.cmake declares OpenSSL as part of 
arrow_static's INTERFACE_LINK_LIBRARIES, but ArrowConfig.cmake does not do the 
same for arrow_bundled_dependencies.


-- 
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