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

installation fails on Alpine Linux #7

Closed
bastistician opened this issue Nov 18, 2024 · 3 comments
Closed

installation fails on Alpine Linux #7

bastistician opened this issue Nov 18, 2024 · 3 comments

Comments

@bastistician
Copy link

In my Alpine Linux system, compilation of 'rxode2ll' fails with the dubious error

/usr/include/fortify/stdlib.h:23:15: fatal error: stdlib.h: No such file or directory

(The complete error message is attached below.)

The error seems to be related to the use of -isystem rather than -I to specify header locations, probably resulting in a problematic include order, at least on this system. I see that 'rxode2ll' already has a "workaround" for Windows, where it will use -I rather than -isystem and I can confirm that this would also fix installation on Alpine Linux:

diff --git a/inst/tools/workaround.R b/inst/tools/workaround.R
index ed779f8..e1d35b8 100644
--- a/inst/tools/workaround.R
+++ b/inst/tools/workaround.R
@@ -21,7 +21,7 @@ if (.Platform$OS.type == "windows" && !file.exists("src/Makevars.win")) {
   close(file.out)
 } else {
   file.out <- file("src/Makevars", "wb")
-  writeLines(gsub("@ISYSTEM@", "isystem", .in),
+  writeLines(gsub("@ISYSTEM@", if (R.version$os == "linux-musl") "I" else "isystem", .in),
              file.out)
   close(file.out)
 }
error log
g++ -std=gnu++17 -I"/home/runner/R-patched/build/include" -DNDEBUG  -I'/home/runner/R-patched/lib/Rcpp/include' -I'/home/runner/R-patched/lib/RcppEigen/include' -I'/home/runner/R-patched/lib/StanHeaders/include' -I'/home/runner/R-patched/lib/BH/include' -I'/home/runner/R-patched/lib/RcppParallel/include' -I/usr/local/include   -fopenmp -D_isrxode2parse_ -DBOOST_DISABLE_ASSERTS -DBOOST_NO_CXX11_STATIC_ASSERT -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -D_HAS_AUTO_PTR_ETC=0 -D_REENTRANT -isystem"/home/runner/R-patched/lib/BH/include" -isystem"/home/runner/R-patched/lib/RcppEigen/include" -isystem'/home/runner/R-patched/lib/RcppParallel/include' -D_REENTRANT -DSTAN_THREADS -DTBB_INTERFACE_NEW   -isystem/usr/include -DTBB_INTERFACE_NEW -isystem'/home/runner/R-patched/lib/StanHeaders/include/src'  -isystem"/home/runner/R-patched/lib/Rcpp/include" -fpic  -O2 -mtune=native -D__MUSL__ -Wno-ignored-attributes   -c RcppExports.cpp -o RcppExports.o
In file included from /usr/include/c++/13.2.1/cstdlib:79,
                 from /usr/include/c++/13.2.1/ext/string_conversions.h:43,
                 from /usr/include/c++/13.2.1/bits/basic_string.h:4109,
                 from /usr/include/c++/13.2.1/string:54,
                 from /usr/include/c++/13.2.1/bits/locale_classes.h:40,
                 from /usr/include/c++/13.2.1/bits/ios_base.h:41,
                 from /usr/include/c++/13.2.1/streambuf:43,
                 from /usr/include/c++/13.2.1/bits/streambuf_iterator.h:35,
                 from /usr/include/c++/13.2.1/iterator:66,
                 from /home/runner/R-patched/lib/RcppEigen/include/RcppEigenForward.h:25,
                 from /home/runner/R-patched/lib/RcppEigen/include/RcppEigen.h:25,
                 from RcppExports.cpp:4:
/usr/include/fortify/stdlib.h:23:15: fatal error: stdlib.h: No such file or directory
   23 | #include_next <stdlib.h>
      |               ^~~~~~~~~~
compilation terminated.
@bastistician
Copy link
Author

Fixed via #8.

@mattfidler
Copy link
Member

Thanks @bastistician

@mattfidler
Copy link
Member

Updated 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

No branches or pull requests

2 participants