apache / arrow-adbc

Database connectivity API standard and libraries for Apache Arrow
https://arrow.apache.org/adbc/
Apache License 2.0
382 stars 95 forks source link

Unable to install ruby red-adbc on Mac M1 #1253

Open pstalcup opened 1 year ago

pstalcup commented 1 year ago

When I attempt to install the red-adbc gem , it fails.

gem install red-adbc
Building native extensions. This could take a while...
ERROR:  Error installing red-adbc:
    ERROR: Failed to build gem native extension.

    current directory: /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/gems/red-adbc-0.7.0/dependency-check
/Users/pstalcup/.rvm/rubies/ruby-3.2.2/bin/ruby -rrubygems /Users/pstalcup/.rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/exe/rake RUBYARCHDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0 RUBYLIBDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0

rake failed, exit code 1

Gem files will remain installed in /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/gems/red-adbc-0.7.0 for inspection.
Results logged to /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0/gem_make.out

I had similar failures for trying to install red-arrow, and was able to install it following a suggestion from https://github.com/apache/arrow/issues/14945#issuecomment-1352598282 However, when I attempt to apply the same technique it says

gem install red-adbc -- --with-ldflags="-Wl,-undefined,dynamic_lookup"
Building native extensions with: '--with-ldflags=-Wl,-undefined,dynamic_lookup'
This could take a while...
ERROR:  Error installing red-adbc:
    ERROR: Failed to build gem native extension.

    current directory: /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/gems/red-adbc-0.7.0/dependency-check
/Users/pstalcup/.rvm/rubies/ruby-3.2.2/bin/ruby -rrubygems /Users/pstalcup/.rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/exe/rake RUBYARCHDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0 RUBYLIBDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0 --with-ldflags\=-Wl,-undefined,dynamic_lookup
invalid option: --with-ldflags=-Wl,-undefined,dynamic_lookup

rake failed, exit code 1

Gem files will remain installed in /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/gems/red-adbc-0.7.0 for inspection.
Results logged to /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0/gem_make.out

Is there any way I can install this gem?

lidavidm commented 1 year ago

Is it possible to attach that logfile?

pstalcup commented 1 year ago

Contents of the respective files:

current directory: /Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/gems/red-adbc-0.7.0/dependency-check
/Users/pstalcup/.rvm/rubies/ruby-3.2.2/bin/ruby -rrubygems /Users/pstalcup/.rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/exe/rake RUBYARCHDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0 RUBYLIBDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0

rake failed, exit code 1

and

/Users/pstalcup/.rvm/rubies/ruby-3.2.2/bin/ruby -rrubygems /Users/pstalcup/.rvm/rubies/ruby-3.2.2/lib/ruby/gems/3.2.0/gems/rake-13.0.6/exe/rake RUBYARCHDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0 RUBYLIBDIR\=/Users/pstalcup/.rvm/gems/ruby-3.2.2@tiosftr/extensions/arm64-darwin-22/3.2.0/red-adbc-0.7.0 --with-ldflags\=-Wl,-undefined,dynamic_lookup
invalid option: --with-ldflags=-Wl,-undefined,dynamic_lookup

rake failed, exit code 1
lidavidm commented 1 year ago

Hmm, guess that doesn't say much.

The Rakefile it's running is trying to determine if the native packages are installed. Are they? I guess if you're on macOS, those aren't necessarily distributed through Homebrew or anything, so you may have to build from source.

kou commented 1 year ago

You need to install ADBC GLib manually https://github.com/apache/arrow-adbc/tree/main/glib#how-to-install on macOS for now. Because we don't have ADBC GLib package for macOS for now.

Or we can create a Homebrew fomula like https://github.com/Homebrew/homebrew-core/blob/master/Formula/a/apache-arrow-glib.rb .