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

Missing dependency libgsl.so #127

Closed
trevorcampbell opened this issue Jul 9, 2023 · 4 comments
Closed

Missing dependency libgsl.so #127

trevorcampbell opened this issue Jul 9, 2023 · 4 comments

Comments

@trevorcampbell
Copy link

trevorcampbell commented Jul 9, 2023

Hi there!

I've been playing around with tidyclust, and it looks really neat. I think I found a missing dependency of libgsl.so -- it's a bit of an unlikely case, because most machines will already have it, but I'm running things in a pared down Docker container which didn't have it originally.

Reprex

If I build this Dockerfile (there are probably more packages than necessary to reproduce there, but this was the Dockerfile for the image I was working with):

FROM rocker/verse:4.3.1

RUN apt-get update --fix-missing
RUN Rscript -e "update.packages(ask = FALSE)"
RUN install2.r --error magick \
                       cowplot \
                       kableExtra \
                       plotly \
                       tidymodels \
                       tidyclust \
                       kknn \
                       ggpubr \
                       ggforce \
                       themis \
                       egg \
                       fontawesome \
                       xfun \
                       tinytex \
                       reticulate \
                       rsvg

and run the following code

library(tidyverse)
library(tidymodels)
library(tidyclust)

penguins <- read_csv("penguins.csv")
spec <- k_means(num_clusters = tune()) |> set_engine("stats")
rec <- recipe(~ ., data=penguins) |> step_center(all_predictors()) |> step_scale(all_predictors())
boots <- bootstraps(penguins, times = 10)
workflow() |>
    add_recipe(rec) |>
    add_model(spec) |>
    tune_cluster(resamples = boots)

where penguins.csv contains

bill_length_mm,flipper_length_mm
39.2,196
36.5,182
34.5,187
36.7,187
38.1,181
39.2,190
36,195
37.8,193
46.5,213
46.1,215
47.8,215
45,220
49.1,212
43.3,208
46,195
46.7,195
52.2,197
46.8,189

I get the following error:

x Bootstrap01: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap02: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap03: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap04: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap05: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap06: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap07: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap08: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap09: internal: Error in `value[[3L]]()`:
! In me...
x Bootstrap10: internal: Error in `value[[3L]]()`:
! In me...

Investigating it a bit, I see that libgsl.so appears to be missing. I would expect tidyclust to install that as a dependency when it's installed.

f$.notes[[8]]$note
[1] "\033[1m\033[33mError\033[39m in `value[[3L]]()`:\033[22m\n\033[33m!\033[39m In metric: `sse_within_total`\nunable to load shared object '/usr/local/lib/R/site-library/RcppZiggurat/libs/RcppZiggurat.so':\n  libgsl.so.27: cannot open shared object file: No such file or directory"

If I then run

apt install libgsl27

in the container and then re-run the above R code, everything seems to work OK.

Versions

R 4.3.1
tidyverse 2.0.0
tidymodels 1.1.0
tidyclust 0.1.2
tune 1.1.1
parsnip 1.1.0
workflows 1.1.3
@EmilHvitfeldt
Copy link
Member

Hello @trevorcampbell Thank you for the report, and the fine detective work!

When looking at the error message we see '/usr/local/lib/R/site-library/RcppZiggurat/libs/RcppZiggurat.so' leading me to suspect that this is an bug in {RcppZiggurat} rather than {tidyclust}.

pak::pkg_deps_explain("tidyclust", "RcppZiggurat")
#> ℹ Loading metadata database
#> ✔ Loading metadata database ... done
#> 
#> tidyclust -> Rfast -> RcppZiggurat

I would suggest you file an issue over in that repository https://github.com/eddelbuettel/rcppziggurat

@eddelbuettel
Copy link

leading me to suspect that this is an bug in RcppZiggurat

I take the other side in eddelbuettel/rcppziggurat#19

@eddelbuettel
Copy link

eddelbuettel commented Aug 12, 2023

What must have happened here is that a installation notice and error, likely from RcppGSL which has the 'hard' GSL dependendy, was ignored. What we have here is the usual issue of an R installation being unable to guarantee a system dependency. The minimally verifiable complete example given is based on rocker/r-verse which uses PPM/RSPM to install, and that can no 'real' connection to the system. If we use rocker/r2u, which does, it all works.

@github-actions
Copy link

This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue.

@github-actions github-actions bot locked and limited conversation to collaborators Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants