nlmixr2 / rxode2

rxode2
https://nlmixr2.github.io/rxode2/
GNU General Public License v3.0
30 stars 7 forks source link

installation fails on Alpine Linux #805

Open bastistician opened 1 day ago

bastistician commented 1 day ago

This is similar to nlmixr2/rxode2ll#7. On Alpine Linux, compilation of 'rxode2' fails with

/usr/include/c++/13.2.1/cmath:47:15: fatal error: math.h: No such file or directory

Using -I instead of -isystem fixes it:

diff --git a/inst/tools/workaround.R b/inst/tools/workaround.R
index f2f86c90c..07e21c61b 100644
--- a/inst/tools/workaround.R
+++ b/inst/tools/workaround.R
@@ -57,7 +57,7 @@ if (.Platform$OS.type == "windows" && !file.exists("src/Makevars.win")) {
 } else {
   .in <- gsub("@CXX14STD@", "-std=gnu++14", .in)
   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)
 }
mattfidler commented 1 day ago

Thanks will fix this in the related packages.