Hi all,

MATLAB uses the Arrow C++ libraries (i.e. libarrow.so) to read and write 
Parquet files (https://www.mathworks.com/help/matlab/ref/parquetread.html) 
While exploring ways to integrate more tightly with Arrow, we've run into a 
symbol/library naming clash issue.

When running pyarrow within the MATLAB process 
(https://www.mathworks.com/help/matlab/call-python-libraries.html?s_tid=CRUX_lftnav
 ), the libarrow.so loaded by pyarrow clashes with the libarrow.so shipping 
with MATLAB.

A few questions:

  1.   Is there a preferred way to change the internal "SONAME" of libarrow.so

     *   It would be nice to be able to easily change the 
“SONAME”<https://www.programmersought.com/article/3694626819/> to something 
like "arrowmw", in the case of MATLAB.  We are not talking about the library 
name per se., but the name used by the linker to load the dll. 
https://www.programmersought.com/article/3694626819/


     *   I noticed there is a CMake set_target_properties LIBRARY_OUTPUT_NAME 
option. Is this the best way to achieve this?




  1.  Does the CMake build system for the Arrow C++ libraries expose any 
preexisting flags to change the default arrow C++ namespace name? (e.g. in the 
style of the BCP tooling provided by the boost libraries)?

     *   To ensure that we have sufficiently isolated the libarrow.so shipping 
with MATLAB, we need to isolate the exported headers (i.e. change “namespace 
arrow” to “namespace arrowmw”).
     *   However, just changing the interface namespace might not be enough. We 
also need to isolate the implementation.

        *   C++ ODR violations can occur with classes, template and inline 
code, not just functions imported from the shared library; the runtime linker 
will merge symbols with the same fully-qualified name even if there was no 
compile or link time dependency between files.
        *   i.e. we need to change call site references from “arrow::status” to 
arrowmw::status”
To summarize:

  1.  Is there a Cmake option to change the build- level internal library name?

  1.  Are there any CMake options we can pass at build time to use "custom 
namspacing" when building the Arrow C++ libraries? and/or is there any BCP 
boost / llvm clang tooling that can aid in automating renaming of call site / 
changing namespace?
Thanks
Tahsin


Reply via email to