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

new v0.14.0 cannot be installed on Alpine Linux #1267

Closed
bastistician opened this issue Jan 31, 2025 · 4 comments · Fixed by #1268
Closed

new v0.14.0 cannot be installed on Alpine Linux #1267

bastistician opened this issue Jan 31, 2025 · 4 comments · Fixed by #1268

Comments

@bastistician
Copy link

Alpine Linux uses musl as its standard C library but RTLD_DEEPBIND as used at
https://github.com/mlverse/torch/blob/v0.14.0/inst/include/lantern/lantern.h#L10439-L10442
seems to require __GLIBC__.

* installing to library '/home/runner/R-patched/lib'
* installing *source* package 'torch' ...
** package 'torch' successfully unpacked and MD5 sums checked
** using staged installation
** libs
using C++ compiler: 'g++ (Alpine 14.2.0) 14.2.0'
make[1]: Entering directory '/var/local/PKGS/CRAN/torch/src'
*** Skip building lantern.
*** Renaming init
"/home/runner/R-patched/build/bin/Rscript" "../tools/renameinit.R"
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c RcppExports.cpp -o RcppExports.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c amp.cpp -o amp.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c autograd.cpp -o autograd.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c backends.cpp -o backends.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c codegen.cpp -o codegen.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c contrib.cpp -o contrib.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c cuda.cpp -o cuda.o
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG -I../inst/include/ -DRCPP_NO_UNWIND_PROTECT -I'/home/runner/R-patched/lib/Rcpp/include' -I/usr/local/include    -fpic  -O2 -mtune=native -Wno-ignored-attributes -D__MUSL__   -c device.cpp -o device.o
In file included from device.cpp:1:
../inst/include/lantern/lantern.h: In function 'bool lanternLoadLibrary(const std::string&, std::string*)':
../inst/include/lantern/lantern.h:10442:49: error: 'RTLD_DEEPBIND' was not declared in this scope
10442 |   pLibrary = dlopen(libFile.c_str(), RTLD_NOW | RTLD_DEEPBIND);
      |                                                 ^~~~~~~~~~~~~
make[1]: *** [/home/runner/R-patched/build/etc/Makeconf:204: device.o] Error 1
make[1]: Leaving directory '/var/local/PKGS/CRAN/torch/src'
make[1]: Entering directory '/var/local/PKGS/CRAN/torch/src'
make[1]: Leaving directory '/var/local/PKGS/CRAN/torch/src'
ERROR: compilation failed for package 'torch'
* removing '/home/runner/R-patched/lib/torch'
* restoring previous '/home/runner/R-patched/lib/torch'
@dfalbel
Copy link
Member

dfalbel commented Jan 31, 2025

Thanks for reporting @bastistician !
Can you check if remotes::install_github("mlverse/torch#1268") works for you?

@bastistician
Copy link
Author

Can you check if remotes::install_github("mlverse/torch#1268") works for you?

Yes, that one installs fine.

@dfalbel
Copy link
Member

dfalbel commented Jan 31, 2025

Thanks! I'll make a quick patch release to fix that.

@dfalbel
Copy link
Member

dfalbel commented Feb 4, 2025

It's now on CRAN

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

Successfully merging a pull request may close this issue.

2 participants