Thanks for your replies.

> Is your goal to have libarrow be loaded from a relative path of
libparquet?

My impression is that I don't have a choice if I installed from homebrew.
That @rpath/libarrow.700.dylib reference looks like it's hard-coded in the
libparquet binary.

> maybe it is connected to https://github.com/apache/arrow/pull/11602.

Yes, it is turned off in the homebrew build:
❯ cat
/opt/homebrew/Cellar/apache-arrow/7.0.0_1/lib/cmake/arrow/ArrowOptions.cmake
| grep RPATH
set(ARROW_RPATH_ORIGIN "OFF")
set(ARROW_INSTALL_NAME_RPATH "OFF")

But it sounds like the general process in using the homebrew Arrow binaries
on Mac OS is:

 1. brew install apache-arrow
 2. Either:
    a. Do some rpath modification (like I did):
CXX_FLAGS=-Wl,-rpath,/opt/homebrew/opt/apache-arrow/lib/
    b. Or set DYLD_LIBRARY_PATH (as Vibhatha suggested):
DYLD_LIBRARY_PATH=/opt/homebrew/opt/apache-arrow/lib/
 3. g++ $(pkg-config --cflags --libs arrow-flight) $CXX_FLAGS example.cpp
-o example

I was wondering if that second step wasn't necessary, but it sounds like it
is.


On Mon, Feb 21, 2022 at 12:22 AM Alenka Frim <[email protected]> wrote:

> Hi Will,
>
> maybe it is connected to https://github.com/apache/arrow/pull/11602.
>
> Alenka
>
> On Sat, Feb 19, 2022 at 8:18 AM James Duong <[email protected]>
> wrote:
>
>> Hi Will,
>>
>> Is your goal to have libarrow be loaded from a relative path of
>> libparquet? I've found that @loader_path works well for this and is close
>> to how the rpath works in Linux.
>> Details about different dynamic loading paths here:
>> https://wincent.com/wiki/%40executable_path%2C_%40load_path_and_%40rpath
>>
>> On Fri, Feb 18, 2022 at 5:17 PM Vibhatha Abeykoon <[email protected]>
>> wrote:
>>
>>> Hello Will,
>>>
>>> How about setting the DYLD_LIBRARY_PATH?
>>>
>>> On Sat, Feb 19, 2022 at 12:18 AM Will Jones <[email protected]>
>>> wrote:
>>>
>>>> Is there a recommended way to handle RPATH and brew on MacOS? When
>>>> trying to link to libparquet it fails with:
>>>>
>>>> dyld[15311]: Library not loaded: @rpath/libparquet.700.dylib
>>>>   Referenced from:
>>>> /opt/homebrew/Cellar/apache-arrow/7.0.0_1/lib/libarrow_dataset.700.0.0.dylib
>>>>   Reason: tried: '/usr/local/lib/libparquet.700.dylib' (no such file),
>>>> '/usr/lib/libparquet.700.dylib' (no such file)Library not loaded:
>>>> @rpath/libarrow.700.dylib
>>>>
>>>> Unless I pass in -rpath,/opt/homebrew/opt/apache-arrow/lib/. Is that
>>>> expected? Or should I be adding that permanently to my rpath somehow? Or
>>>> should these libraries be symlinked to an existing directory on my rpath?
>>>>
>>>> Thanks,
>>>>
>>>> Will Jones
>>>>
>>> --
>>> Vibhatha Abeykoon
>>>
>>
>>
>> --
>>
>> *James Duong*
>> Lead Software Developer
>> Bit Quill Technologies Inc.
>> Direct: +1.604.562.6082 | [email protected]
>> https://www.bitquilltech.com
>>
>> This email message is for the sole use of the intended recipient(s) and
>> may contain confidential and privileged information.  Any unauthorized
>> review, use, disclosure, or distribution is prohibited.  If you are not the
>> intended recipient, please contact the sender by reply email and destroy
>> all copies of the original message.  Thank you.
>>
>

Reply via email to