Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to compile on arch-linux #875

Open
mrAndersen opened this issue Jul 10, 2024 · 2 comments
Open

Unable to compile on arch-linux #875

mrAndersen opened this issue Jul 10, 2024 · 2 comments

Comments

@mrAndersen
Copy link

mrAndersen commented Jul 10, 2024

torch-sys is 0.14.0

Unable to compile torch-sys on arch gcc version 14.1.1, tried gcc 13, no luck, also tried all the combinations of ENV (LIBTORCH_USE_PYTORCH=1|0, LIBTORCH_BYPASS_VERSION_CHECK=1|0) it simply doesn't work. I am keep getting:

 cargo:warning=In file included from libtch/torch_api_generated.h:2,
  cargo:warning=                 from libtch/torch_api_generated.cpp:2:
  cargo:warning=libtch/torch_api_generated.cpp: In function ‘void atg__cslt_sparse_mm(at::Tensor**, tensor, tensor, tensor, int)’:
  cargo:warning=libtch/torch_api_generated.cpp:640:104: error: invalid initialization of reference of type ‘const std::optional<at::Tensor>&’ from expression of type ‘bool’
  cargo:warning=  640 |     auto outputs__ = torch::_cslt_sparse_mm(*compressed_A, *dense_B, (bias ? *bias : torch::Tensor()), (bool)transpose_result);
  cargo:warning=      |                                                                                                        ^~~~~~~~~~~~~~~~~~~~~~
  cargo:warning=libtch/torch_api.h:19:5: note: in definition of macro ‘PROTECT’
  cargo:warning=   19 |     x \
  cargo:warning=      |     ^

libtorch is maunally downloaded (version 2.3.0) and specified in LIBTORCH env during cargo build. Tried with cuda or without cuda - same error

@AAlieZZ
Copy link

AAlieZZ commented Aug 7, 2024

Back to the old version

[dependencies]
tch = { git = "https://github.com/LaurentMazare/tch-rs", rev = "a90854b2135b91546ca6082418d478126e1f6a26" }

And it worked!

@LaurentMazare
Copy link
Owner

Each version of tch/torch-sys is only compatible with a single version of libtorch. For 0.14.0, the matching libtorch version is 2.1.0 which probably explains the original error, 0.16.0 should be the version to use with libtorch 2.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants