Code Monkey home page Code Monkey logo

Comments (6)

evangorstein avatar evangorstein commented on August 18, 2024 2

Agreed! I just had a similar experience struggling to figure out how to use RCall in the automatic testing environment with github actions (locally, testing run smoothly). Considering that one huge use case of RCall is to compare the results of your Julia implementation with the results from a given R package, it would be extremely helpful to have it documented how to set up the automatic testing environment so that RCall works.

from rcall.jl.

palday avatar palday commented on August 18, 2024 1

I'm not opposed to adding some tips to the docs in a section titled something like "Using RCall in CI". Two other places to look for examples:

from rcall.jl.

lrnv avatar lrnv commented on August 18, 2024

@evangorstein could you share your setup ? Mine is unfortunately still in private repo but will be released soon

from rcall.jl.

evangorstein avatar evangorstein commented on August 18, 2024

I ended up copy-pasting from the workflow for MonotoneSplines.jl that you linked to. That is, I included the following in my workflow file

      - uses: r-lib/actions/setup-r@v2
        with:
          r-version: ${{ matrix.r-version }}
      # actually it seems that without installing `libcurl4-openssl-dev`, there also exists a libcurl.so, but at `/lib/x86_64-linux-gnu/libcurl.so.4` instead of `/usr/lib/x86_64-linux-gnu/libcurl.so.4`
      # for consistency with previous setting and also recommended at https://github.com/r-lib/actions/tree/v2/setup-r-dependencies, continue to install `libcurl4-openssl-dev`
      - name: Install libcurl on Linux
        if: runner.os == 'Linux'
        run: sudo apt-get update -y && sudo apt-get install -y libcurl4-openssl-dev
      - name: Install Dependencies for R
        run: |
          r = getOption("repos")
          r["CRAN"] = "https://cloud.r-project.org/"
          options(repos=r)
          install.packages("some_package")
        shell: sudo Rscript {0}

and then later

      - uses: julia-actions/julia-runtest@v1
        env:
          LD_PRELOAD: /usr/lib/x86_64-linux-gnu/libcurl.so.4
          LD_LIBRARY_PATH: /opt/R/${{ matrix.r-version }}/lib/R/lib

I'm not sure whether all of this is necessary, but I included it all just in case.

from rcall.jl.

lrnv avatar lrnv commented on August 18, 2024

Just to give a small status update since this is runing on a private repo EDIT: not anymore got published, the file is there. The way of setting R packages that i used (the r-lib/actions/setup-r-dependencies@v2 action) gives automatic caching of them from a run to the next and is the actual recomended way of doing this.

However I still struggle to get it stable : it installs the last version of every R package each times, which is known to be buggy, and in 3 weeks I had to upload the R version twice from 4.1 to 4.3 to 4.4.0 now... Maybe there is something that could be done to freeze package versions with R::renv but I was not able to make it work.

from rcall.jl.

cecileane avatar cecileane commented on August 18, 2024

I also recently struggled with this, mostly to make Julia RCall find the path to R under macos-latest. It worked with this setup.

from rcall.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.