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

Environment build fails with S4 => S4SXP error #112

Closed
anisotropi4 opened this issue Jul 22, 2024 · 14 comments
Closed

Environment build fails with S4 => S4SXP error #112

anisotropi4 opened this issue Jul 22, 2024 · 14 comments

Comments

@anisotropi4
Copy link
Collaborator

When trying to install an R environment on a new machine the build for the rsgeo package fails with the following error:

   Compiling geo v0.28.0 (https://github.com/georust/geo#ff0eccbc)
error[E0425]: cannot find value `S4SXP` in this scope
   --> /tmp/RtmpBedzSp/R.INSTALL18cf22abbf157/rsgeo/src/vendor/extendr-api/src/lib.rs:574:15
    |
574 |         S4 => S4SXP,
    |               ^^^^^ not found in this scope

Any thoughts about how to fix this?

@JosiahParry
Copy link
Collaborator

Looks like an issue with some libRsys bindings. Instead of compiling from source you should install from a precompiled binary.

Please install from https://josiahparry.r-universe.dev/rsgeo

@Robinlovelace
Copy link
Contributor

Woa, that's a pretty deeply embedded issue. Could it be hardware related, e.g. you're running on an old CPU that is not compatible with this instruction set Will? Curious to know if the work-around works..

@JosiahParry
Copy link
Collaborator

JosiahParry commented Jul 22, 2024 via email

@Robinlovelace
Copy link
Contributor

Is there a way to tell R where to install it from in the DESCRIPTION?

https://github.com/nptscot/networkmerge/blob/main/DESCRIPTION

@anisotropi4
Copy link
Collaborator Author

anisotropi4 commented Jul 23, 2024

This is broken when I try this on a clean install.

As clean install is by running the commands from the code/install.R I would ask that this is updated to reflect the dependencies:

 $ Rscript code/install.R

This is also the case when running install.packages('rsgeo', repos = c('https://josiahparry.r-universe.dev', 'https://cloud.r-project.org')) as suggested but this appears to still gives:

> install.packages('rsgeo', repos = c('https://josiahparry.r-universe.dev', 'https://cloud.r-project.org'))
Installing package into ‘~/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
trying URL 'https://josiahparry.r-universe.dev/src/contrib/rsgeo_0.1.7.tar.gz'
Content type 'application/x-gzip' length 9038197 bytes (8.6 MB)
==================================================
downloaded 8.6 MB

* installing *source* package ‘rsgeo’ ...
...
   Compiling log v0.4.22
   Compiling geo v0.28.0 (https://github.com/georust/geo#ff0eccbc)
error[E0425]: cannot find value `S4SXP` in this scope
   --> /tmp/RtmpCiyt2m/R.INSTALL1b7b633c2cb16/rsgeo/src/vendor/extendr-api/src/lib.rs:574:15
    |
574 |         S4 => S4SXP,
    |               ^^^^^ not found in this scope

For more information about this error, try `rustc --explain E0425`.
error: could not compile `extendr-api` (lib) due to 1 previous error

Further suggestions welcome.

@anisotropi4
Copy link
Collaborator Author

Update: If I run install.packages('rsgeo', repos = c('https://josiahparry.r-universe.dev', 'https://cloud.r-project.org')) on an existing install this works.

The issue appears to be how to get this to work on a clean install.

@Robinlovelace
Copy link
Contributor

Have changed how we install it @anisotropi4 hoping that fixes it for future users. We can re-open if not properly fixed and any further changes welcome.

@anisotropi4 anisotropi4 reopened this Jul 23, 2024
@anisotropi4
Copy link
Collaborator Author

This has failed again on my new environment. I guess what I would like to see, outwith using Docker, is an environment build guide that allows the system to run with dependencies.

For example:

  1. Install R on linux using these instructions
  2. Run $ Rscript code/install.R to install and build R dependencies
  3. Install quarto using these instructions

...and so on...

As it stands I'm stuck.

@Robinlovelace
Copy link
Contributor

I think Pixi was kind of designed to solve this kind of thing.

@Robinlovelace
Copy link
Contributor

Related thread, mentioning R and Python support: posit-dev/positron#3724

@Robinlovelace
Copy link
Contributor

I guess what I would like to see, outwith using Docker, is an environment build guide that allows the system to run with dependencies.

For example:

1. Install [R on linux using these instructions](https://cran.r-project.org/bin/linux/ubuntu/fullREADME.html)

2. Run `$ Rscript code/install.R` to install and build R dependencies

3. Install [quarto using these instructions](https://quarto.org/docs/get-started/)

Agree that should be in the README. Do those things not currently work, even after the 'fix' in 8a20325 ?

@JosiahParry
Copy link
Collaborator

If you're getting prompted to install from source say "no". I cannot repro this issue. The r-universe has linux binaries provided. It looks like you're running an old version of R (4.1) which may be the root of the issue.

If you want to create an issue in rsgeo with a reproducible example that is very welcomed.

Thanks!

@anisotropi4
Copy link
Collaborator Author

Please advice what I need to do about this, noting that I have followed recommended R install instructions for a Debian/Ubuntu based linux install.

If the intent is to deviate from the standard LTS version of R, I would ask that this is made clear.

@anisotropi4
Copy link
Collaborator Author

The issue is the R version. For some reason the clean install ignored the additional repository, reverted to the based LTS Debian package, and installed R 4.1.1.

A couple of things with this,

  1. While the default LTS Debian package looks like it is three years out of date, I think we need to make it clear that only version 4.4 is supported.
  2. The final step of the Linux install instructions on cran don't seem to work. In particular the following fails to update /etc/apt/source.list.d/additional-repositories.list:
$ sudo` add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"  

Which is why the old version of R was installed.

  1. The full Linux install instructions on cran also don't seem to work. I ended up creating the following repository entry, which does:
$ cat /etc/apt/sources.list.d/additional-repositories.list 
deb https://cran.ma.imperial.ac.uk/bin/linux/ubuntu jammy-cran40/

Based on this, I can now render the paper, but without many warm fuzzies from for Linux users.

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

3 participants