ankane / torch.rb

Deep learning for Ruby, powered by LibTorch
Other
704 stars 30 forks source link

failing on libtorch version #34

Closed taf2 closed 2 years ago

taf2 commented 2 years ago

./utils.h:8:1: error: static_assert failed due to requirement '1 == 1 && 9 == 11' "Incompatible LibTorch version"

orlando-labs commented 2 years ago

Hi, @taf2, you are trying to build torch-rb against wrong version of libtorch. If you are trying to build actual at the moment torch-rb version 0.10.1 then you must have libtorch 1.11.0. Looks like your libtorch version is 1.9.*

taf2 commented 2 years ago

@orlando-labs thanks - just ran brew install libtorch and got that older version... i'm running brew update now to see if i can get the newer version.

orlando-labs commented 2 years ago

Actual brew should do the trick

orlylabs@MacBook-Pro ~ % brew upgrade libtorch
Warning: libtorch 1.11.0 already installed
taf2 commented 2 years ago

Yes this worked! I also noticed when compiling with brew on linux... i had issues with LD_LIBRARY_PATH and CXXFLAGS, since by default brew linux puts things in /home/linuxbrew/... I'm at work now but can share details tonight... it's been usually nice to be able to use brew in mac and linux...

ankane commented 2 years ago

Hey @taf2, thanks for sharing. For Homebrew on Linux, you'll need to run:

bundle config build.torch-rb --with-torch-dir=/home/linuxbrew/.linuxbrew

before installing the gem. I've added it to the readme in the commit above.

taf2 commented 2 years ago

@ankane thanks that worked - much easier thank hacking env vars thank you!

ankane commented 1 year ago

For future readers: Torch.rb now checks /home/linuxbrew/.linuxbrew, so no additional config is needed.