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

Torch install fails on AlmaLinux 8.9 with `GLIBCXX_3.4.26' not found #1226

Open
dlaflamme opened this issue Dec 31, 2024 · 0 comments
Open

Comments

@dlaflamme
Copy link

Host is AlmaLinux 8.9. Installed compiler is g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22).

R is 4.3.2.

install.packages("torch") appears to work:

<...snip...>

* installing *source* package ‘torch’ ...
** package ‘torch’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: ‘g++ (GCC) 8.5.0 20210514 (Red Hat 8.5.0-22)’
*** Skip building lantern.
*** Renaming init
"/opt/R/4.3.2/lib/R/bin/Rscript" "../tools/renameinit.R"
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c amp.cpp -o amp.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c autograd.cpp -o autograd.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c backends.cpp -o backends.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c codegen.cpp -o codegen.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c contrib.cpp -o contrib.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c cuda.cpp -o cuda.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c device.cpp -o device.o
In file included from device.cpp:1:
../inst/include/lantern/lantern.h: In function ‘bool lanternInit(const string&, std::__cxx11::string*)’:
../inst/include/lantern/lantern.h:9774:6: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without
 bool lanternInit(const std::string &libPath, std::string *pError)
      ^~~~~~~~~~~
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c dimname_list.cpp -o dimname_list.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c dtype.cpp -o dtype.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c gen-namespace.cpp -o gen-namespace.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c generator.cpp -o generator.o
g++ -std=gnu++17 -I"/opt/R/4.3.2/lib/R/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/Rcpp/include' -I/usr/local/include    -fpic  -g -O2  -c indexing.cpp -o indexing.o

<...snip...>

g++ -std=gnu++17 -shared -L/opt/R/4.3.2/lib/R/lib -L/usr/local/lib -o torch.so RcppExports.o amp.o autograd.o backends.o codegen.o contrib.o cuda.o device.o dimname_list.o dtype.o gen-namespace.o generator.o indexing.o ivalue.o jit-compile.o jit-execute.o lantern.o layout.o mem
ory_format.o nn_utils_rnn.o qscheme.o quantization.o reduction.o save.o scalar.o script_module.o stack.o storage.o tensor.o tensor_list.o torch_api.o torch_exports.o trace.o utils.o variable_list.o xptr.o -L/opt/R/4.3.2/lib/R/lib -lR
*** Renaming torch lib to torchpkg
"/opt/R/4.3.2/lib/R/bin/Rscript" "../tools/renamelib.R"
installing to /local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/00LOCK-torch/00new/torch/libs
** R
** inst
** byte-compile and prepare package for lazy loading

<...snip...>

* DONE (torch)

The downloaded source packages are in
        ‘/tmp/RtmpxDHUtw/downloaded_packages’

But then:

> library(torch)
ℹ Additional software needs to be downloaded and installed for torch to work correctly.
Do you want to continue? (Yes/no/cancel) Yes
trying URL 'https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.1%2Bcpu.zip'
Content type 'application/zip' length 181781260 bytes (173.4 MB)
==================================================
downloaded 173.4 MB

trying URL 'https://torch-cdn.mlverse.org/binaries/refs/heads/cran/v0.13.0/latest/lantern-0.13.0+cpu+x86_64-Linux.zip'
Content type 'application/zip' length 5657334 bytes (5.4 MB)
==================================================
downloaded 5.4 MB

Warning message:
ℹ torch failed to start, restart your R session to try again.
ℹ You might need to reinstall torch using `install_torch()`
✖ /local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/torch/lib/liblantern.so - /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/torch/lib/liblantern.so)
Caused by error in `cpp_lantern_init()`:
! /local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/torch/lib/liblantern.so - /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /local/home/dlaflamme/R/x86_64-pc-linux-gnu-library/4.3/torch/lib/liblantern.so)
>

This seems related to whatever lantern version was downloaded (https://torch-cdn.mlverse.org/binaries/refs/heads/cran/v0.13.0/latest/lantern-0.13.0+cpu+x86_64-Linux.zip).

Notice that in the install step, the following line appeared:

*** Skip building lantern.

Why was it skipped? Perhaps if it is not skipped it will be downloaded and built locally? Is there a way to force this behavior?

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

1 participant