rhdf5 icon indicating copy to clipboard operation
rhdf5 copied to clipboard

external_filters.h:1:9: error: no macro name given in #define directive

Open dbdimitrov opened this issue 3 years ago • 9 comments

Hi @grimbough,

I'm trying to install rhdf5 (SingleCellExperiment really), but I encounter the following error when trying to install from BioConductor: [removed image as it contains personal paths]

and another error when trying to install via: devtools::install_github("https://github.com/grimbough/rhdf5")

[removed image as it contains personal paths]

─ Session info ──────────────────────────────────────────────── setting value
version R version 4.0.3 (2020-10-10) os Ubuntu 20.04.2 LTS
system x86_64, linux-gnu
ui RStudio
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz Europe/Berlin
date 2021-08-05

─ Packages ────────────────────────────────────────────────── ! package * version date lib source
P askpass 1.1 2019-01-13 [?] CRAN (R 4.0.3) R BiocManager * 1.30.16 <NA> [?] <NA>
P cachem 1.0.5 2021-05-15 [?] CRAN (R 4.0.3) R callr 3.7.0 <NA> [?] <NA>
P cli 3.0.1 2021-07-17 [?] CRAN (R 4.0.3) P crayon 1.4.1 2021-02-08 [?] CRAN (R 4.0.3) R credentials * 1.3.1 <NA> [?] <NA>
P curl 4.3.2 2021-06-23 [?] CRAN (R 4.0.3) R desc 1.3.0 <NA> [?] <NA>
R devtools 2.4.2 <NA> [?] <NA>
P ellipsis 0.3.2 2021-04-29 [?] CRAN (R 4.0.3) P fansi 0.5.0 2021-05-25 [?] CRAN (R 4.0.3) P fastmap 1.1.0 2021-01-25 [?] CRAN (R 4.0.3) P fs 1.5.0 2020-07-31 [?] CRAN (R 4.0.3) P glue 1.4.2 2020-08-27 [?] CRAN (R 4.0.3) P jsonlite 1.7.2 2020-12-09 [?] CRAN (R 4.0.3) P lifecycle 1.0.0 2021-02-15 [?] CRAN (R 4.0.3) P magrittr 2.0.1 2020-11-17 [?] CRAN (R 4.0.3) R memoise 2.0.0 <NA> [?] <NA>
P openssl 1.4.4 2021-04-30 [?] CRAN (R 4.0.3) P pillar 1.6.2 2021-07-29 [?] CRAN (R 4.0.3) R pkgbuild 1.2.0 <NA> [?] <NA>
P pkgconfig 2.0.3 2019-09-22 [?] CRAN (R 4.0.3) R pkgload 1.2.1 <NA> [?] <NA>
P prettyunits 1.1.1 2020-01-24 [?] CRAN (R 4.0.3) R processx 3.5.2 <NA> [?] <NA>
R ps 1.6.0 <NA> [?] <NA>
P purrr 0.3.4 2020-04-17 [?] CRAN (R 4.0.3) P R6 2.5.0 2020-10-28 [?] CRAN (R 4.0.3) P remotes 2.4.0 2021-06-02 [?] CRAN (R 4.0.3) VP renv 0.12.5 2021-07-21 [?] CRAN (R 4.0.3) P rlang 0.4.11 2021-04-30 [?] CRAN (R 4.0.3) R rprojroot 2.0.2 <NA> [?] <NA>
R rstudioapi 0.13 <NA> [?] <NA>
R sessioninfo 1.1.1 <NA> [?] <NA>
P sys 3.4 2020-07-23 [?] CRAN (R 4.0.3) R testthat 3.0.4 <NA> [?] <NA>
P tibble 3.1.3 2021-07-23 [?] CRAN (R 4.0.3) R usethis 2.0.1 <NA> [?] <NA>
P utf8 1.2.2 2021-07-24 [?] CRAN (R 4.0.3) P vctrs 0.3.8 2021-04-29 [?] CRAN (R 4.0.3) P withr 2.4.2 2021-04-18 [?] CRAN (R 4.0.3)

V ── Loaded and on-disk version mismatch. P ── Loaded and on-disk path mismatch. R ── Package was removed from disk.

dbdimitrov avatar Aug 05 '21 16:08 dbdimitrov

The error looks like it's because something inappropriate gets inserted into the external_filters.h file, and then the compilation of the package fails. It's suppose to detect whether the rhdf5filters package is installed, and then insert either _H5P_filters or undef into that file, however it looks like you're getting something else printed instead.

I'm concerned by the .Renviron contains invalid line(s) statement that appears, that doesn't sound good and is probably what's being printed instead.

The code that adds to that header is below. What do you see if you run that in a command terminal?

Rscript" -e 'cat(if(require("rhdf5filters", quietly = TRUE)) "_H5P_filters" else "undef")'

grimbough avatar Aug 05 '21 19:08 grimbough

Hi @grimbough,

Thank you so much for your prompt response!

Indeed, it was an inappropriate symbol in the .Renviron.

dbdimitrov avatar Aug 05 '21 20:08 dbdimitrov

I also just got hit by this (my .Rprofile prints stuff). Perhaps you can change Rscript -e 'cat(if(require("rhdf5filters", quietly = TRUE)) "_H5P_filters" else "undef")' to something like Rscript -e 'quit(status=require("rhdf5filters", quietly = TRUE))' "_H5P_filters" else "undef")' && echo _H5P_filters || echo undef ?

jan-glx avatar Dec 09 '21 12:12 jan-glx

@jan-glx which version of rhdf5 are you trying to install? That line currently has a tail -n1 after it.

https://github.com/grimbough/rhdf5/blob/c053f51d186504a5bb6273c33f2aeaae9939db0c/configure.ac#L9-L10

Just want to make sure it's the current implementation that's failing for you.

grimbough avatar Dec 09 '21 13:12 grimbough

3.13 (, and HEAD of master) The fix with the tail was probably enough for the vast majority of cases. In my case, my .Rprofile would print a single @ char without newline (to be able to see that is has run completely but without making much noise). Accordingly it took me quite a while to figure out what the problem was. (I jut got rid of the @ for now, so this is not urgent)

jan-glx avatar Dec 09 '21 14:12 jan-glx

I like the suggestion, I just think it needs to be !require(...) as bash will treat a return code of 0 as success e.g.

https://github.com/grimbough/rhdf5/blob/fbb3f7b1ac05a6ee8cd8f54f78f490ddd461fc97/configure.ac#L9

Hopefully that works. Can you test with your original .Rprofile and install from master again?

grimbough avatar Dec 09 '21 16:12 grimbough

Unfortunately is does not work (by bad). The output still shows up. One could redirect it by inserting > \dev\null or >&2 before the &&. Perhaps one could even keep the output on stdout and fix this somehow differently but I have no experience with configure scripts.

jan-glx avatar Dec 13 '21 10:12 jan-glx

So what's the final part of your .Rprofile? Is it just cat("@") ? Let me know and I'll work with a local copy to try and get this suppressed. rhdf5 isn't the only package that uses this approach in configure, so it's good to find these edge cases and try to make it more robust.

grimbough avatar Dec 13 '21 11:12 grimbough

Yes, just cat("@").

jan-glx avatar Dec 13 '21 15:12 jan-glx