Closed elbowdonkey closed 1 year ago
I tried the following and was able to build the gem without errors:
bundle config build.torch-rb --with-torch-dir=/opt/homebrew/Cellar/libtorch/1.12.1
bundle install
My Gemfile
:
source "https://rubygems.org"
gem "torch-rb"
I just realized that the README.md already describes how to solve my issue and I just didn't see it. Closing.
Glad you found it. Just pushed a change to automatically detect so no additional config is needed.
In issue #48 I found the current brew renaming 'libtorch' to pytorch, so there still needs further tuning.
When trying to install
torch-rb
on a Mac M1 Pro, I get:Looking at the
mkmf.log
, something that stands out to me is:System info:
macOS 12.6 Macbook Pro, M1 Pro 32MB
I've tried installing
libtorch
using brew. After seeing the extension fail to build, I noticed that the brew version oflibtorch
for M1 is 1.12.1.I uninstalled the brew version in favor of using
pip install libtorch
- that installs1.2.0.1
, which is quite old. Still. when trying to install thetorch-rb
gem, I get the same error in themkmf.log
.Given the age of the pip installed
libtorch
, I removed it and reinstalled it via brew.When running
brew info libtorch
I noticed thatpython@3.10
was listed as a build dependency, and that it wasn't satisfied:So now I'm looking at python.
I installed python 3.10.0 through
pyenv
and verified its working.brew info libtorch
doesn't show the dependency as being satisfied still, which I suspect is because brew is assuming I didbrew install python@3.10
.I may try installing
python@3.10
through brew just to see if it helps, but in the meantime, am I missing something important here?mkmf.log