Skip to content

Commit

Permalink
add specific sysreqs for INLA installation (#139)
Browse files Browse the repository at this point in the history
* add specific sysreqs for INLA installation

* run on this dev branch

* add udunits2 for fedora

* check the package to verify if INLA is installed

* we do not need to test the CRAN here

* run checks on HEAD of the branch

* no need to install from source

* try without gsl install (old DESC file)

* only update devtools - for speed

* Revert "only update devtools - for speed"

This reverts commit c05b5f9.

* update only needed packages

* go back to updating all

* installing from source + checks

* adding openssl as sysdep

* adding curl as sysdep

* trying INLA install via sysreq on Ubuntu

* trying INLA install via sysreq Fedora

* trying INLA install via sysreq Windows

* running checks at the end

* runnin on dev - to revert

* upgrading ubuntu floavors

* simpler dependency statemnt (incl. suggests)

* also checks on macOS

* adding the shlib_openmp_clfags to pkg_libs

* addressing warning from checks

* bump R6 to dependency so it is installed on cueck_built

* include macos for testing

* only fail on error

* rely on rcmdcheck

* removing prev. absent dep again

* fix in build args param

* adding sf as dependency (>fmesher>INLA)

* ingore vignettes

* losing Matrix req that requires R > 4.4.0

* remove dev running condition

* install with pak (and thus sysdeps)

* install curl for pak

* separate step for pak install

* including optional deps (i.e. also Suggests)

* reverting dep for Matrix

* adding INLA repo

* cleaning up

* try again with adding INLA repo

* removing version pinning for Matrix

* rely on sysdeps for fedora

* ditch biocm specialy install

* adding jags as sysdep (for ubuntu)

* setup on Ubuntu with pak

* removing dev running cond

* now with pak

* update might not be needed with pak

* also adding libcurl for pak install

* Case sensitivity

* expicitely loading data

* since tests run isolated - load package first

* pak based setup on Fedora

* adding Macos pak setup

* better output for testthat

* Windows setup with pak

* updated instructions for Linux based systems

* updated instructions for Linux based systems

* formatting

* adapting instructions for Mac&Windows

* adaptig installing f GH

* completing with pak install

* adpted installation instructions for pak

* cleaning up

* keep only intallation steps

* renaming

* adapting setup batches

* cleaning up

* corrected naming

* typo

* completing from source install

---------

Co-authored-by: Jonas I. Liechti <j-i-l@t4d.ch>
  • Loading branch information
matteodelucchi and j-i-l authored Aug 7, 2024
1 parent 4279bc3 commit 49f0a6d
Show file tree
Hide file tree
Showing 8 changed files with 319 additions and 541 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ jobs:
- name: install config and build dependencies
run: |
dnf -y install pkg-config
dnf -y install cmake
dnf -y install R-devtools
dnf -y install libcurl-devel # needed for pak
- name: install GSL
- name: install pak
run: |
dnf -y install gsl-devel
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
shell: Rscript {0}

- name: install JAGS
run: |
Expand All @@ -73,38 +72,16 @@ jobs:
library("rjags")
shell: Rscript {0}

- name: install INLA dependencies
run: |
dnf -y install udunits2-devel
dnf -y install libcurl-devel # rCurls package (for INLA)
dnf -y install openssl-devel # s2 package
dnf -y install libjpeg-devel # jpeg package
dnf -y install proj-devel # sf package
dnf -y install geos-devel # sf package
dnf -y install gdal-devel # terra package
- name: install INLA
run: |
install.packages("INLA", repos = c(CRAN = "https://cran.r-project.org", INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
shell: Rscript {0}

- name: installing dependencies from BiocManager
run: |
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager", repos=c(CRAN="https://cran.r-project.org"))
BiocManager::install("Rgraphviz")
BiocManager::install("graph")
shell: Rscript {0}

- name: install from CRAN
run: |
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
library('abn')
shell: Rscript {0}
# - name: install from CRAN with pak
# run: |
# pak::pkg_install('abn', dependencies=TRUE)
# library('abn')
# shell: Rscript {0}

- name: install from GitHub
- name: pak install from GitHub
run: |
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
library('abn')
shell: Rscript {0}

Expand All @@ -118,7 +95,5 @@ jobs:

- name: install from source
run: |
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
pak::local_install(dependencies=TRUE)
shell: Rscript {0}
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
run: |
brew install jags
- name: install rjags
run: |
install.packages("rjags", type="source", repos=c(CRAN="https://cran.r-project.org"))
library("rjags")
shell: Rscript {0}
# - name: install rjags
# run: |
# install.packages("rjags", type="source", repos=c(CRAN="https://cran.r-project.org"))
# library("rjags")
# shell: Rscript {0}

- name: install INLA dependencies
run: |
Expand All @@ -58,23 +58,21 @@ jobs:
install.packages("INLA", repos = c(CRAN = "https://cran.r-project.org", INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
shell: Rscript {0}

- name: installing dependencies from BiocManager
- name: install pak
run: |
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager", repos=c(CRAN="https://cran.r-project.org"))
BiocManager::install("Rgraphviz")
BiocManager::install("graph")
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
shell: Rscript {0}

- name: install from CRAN
run: |
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
library('abn')
shell: Rscript {0}
# - name: install from CRAN with pak
# run: |
# pak::pkg_install('abn', dependencies=TRUE)
# library('abn')
# shell: Rscript {0}

- name: install from GitHub
- name: pak install from GitHub
run: |
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
library('abn')
shell: Rscript {0}

Expand All @@ -88,7 +86,5 @@ jobs:

- name: install from source
run: |
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
pak::local_install(dependencies=TRUE)
shell: Rscript {0}
77 changes: 77 additions & 0 deletions .github/workflows/Ubuntu_setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Workflow is triggered on label and check installation on various operating systems
# This action is adapted from https://github.com/t4d-gmbh/stubbed_versioning
name: Ubuntu Install

on:
push:
branches:
- "main"

env:
BRANCH: ${{ github.head_ref || github.ref_name }}

permissions:
packages: read
contents: write
pull-requests: write
repository-projects: write

jobs:
setup-and-install:
runs-on: ubuntu-latest
name: ubuntu-latest R release
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:

- name: Update and upgrade
run: |
sudo apt-get update && sudo apt-get upgrade
- name: install R
run: |
sudo apt-get -y install r-base
- name: fixing folder perms for local lib
run: |
sudo chown root:adm -R /usr/lib/R
sudo chmod g+w -R /usr/lib/R
sudo chown root:adm -R /usr/local/lib/R
sudo chmod g+w -R /usr/local/lib/R
- name: install config and build dependencies
run: |
sudo apt-get -y install libcurl4-openssl-dev # needed for pak
- name: install pak
run: |
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
shell: Rscript {0}

# - name: install from CRAN with pak
# run: |
# pak::pkg_install('abn', dependencies=TRUE)
# library('abn')
# shell: Rscript {0}

- name: pak install from GitHub
run: |
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
library('abn')
shell: Rscript {0}

- name: fetch the repository from GitHub
uses: actions/checkout@v4

- name: deactivate the renv
run: |
renv::deactivate()
shell: Rscript {0}

- name: install from source
run: |
pak::local_install(dependencies=TRUE)
shell: Rscript {0}
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ jobs:
R_KEEP_PKG_SOURCE: yes
steps:

- name: prepare windows
- name: install pak
run: |
install.packages("devtools", repos=c(CRAN="https://cran.r-project.org"))
install.packages('pak', repos=c(CRAN="https://cran.r-project.org"))
shell: Rscript {0}

- name: install GSL
Expand All @@ -55,28 +55,16 @@ jobs:
library("rjags")
shell: Rscript {0}

- name: install INLA
run: |
install.packages("INLA", repos = c(CRAN = "https://cran.r-project.org", INLA = "https://inla.r-inla-download.org/R/stable"), dep = TRUE)
shell: Rscript {0}

- name: installing dependencies from BiocManager
run: |
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager", repos=c(CRAN="https://cran.r-project.org"))
BiocManager::install("Rgraphviz")
BiocManager::install("graph")
shell: Rscript {0}

- name: install from CRAN
run: |
install.packages('abn', repos=c(CRAN="https://cran.r-project.org"))
library('abn')
shell: Rscript {0}
# - name: install from CRAN with pak
# run: |
# pak::pkg_install('abn', dependencies=TRUE)
# library('abn')
# shell: Rscript {0}

- name: install from GitHub
- name: pak install from GitHub
run: |
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
pak::repo_add(INLA = "https://inla.r-inla-download.org/R/stable/")
pak::pkg_install("furrer-lab/abn@${{ env.BRANCH }}", dependencies=TRUE)
library('abn')
shell: Rscript {0}

Expand All @@ -90,7 +78,12 @@ jobs:

- name: install from source
run: |
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never', repos=c(CRAN="https://cran.r-project.org"))
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
pak::local_install(dependencies=TRUE)
shell: Rscript {0}

- name: run the tests
run: |
pak::pak('r-lib/testthat')
library("abn")
testthat::test_local(path='tests', load_package='none')
shell: Rscript {0}
113 changes: 0 additions & 113 deletions .github/workflows/onlabel_Ubuntu_setup.yml

This file was deleted.

Loading

0 comments on commit 49f0a6d

Please sign in to comment.