Skip to content

Commit

Permalink
Fix: detailed installation instructions (#126)
Browse files Browse the repository at this point in the history
* on label install check mac & windows

* fixing running condition

* installing dependencies for macos

* try installing gsl package

* dedicated window pipeline

* fixing os parameter

* dedicated macos workflow

* Revert "try installing gsl package"

This reverts commit b6678f5.

* minor label formatting

* fixing container declaration

* installing jags

* adding jags path

* trying again with install

* installing rjags providing Jags home

* try with silent mode fore setup exe'

* adding more R versions

* install INLA

* renaming workflow

* debugging - show gls configs

* fixing to always report

* create configure file with autoconf

* installing automake

* debugging - gsl path

* providing flags for clang/gcc as well

* debugging - check jags location

* try to detect the paths for jags

* passing the args to Makevars

* better test

* debugging

* unconditional try

* debugging

* separate install of rjags

* simplify

* working with only configure.ac file

* providing jags paths does not help

* started with Fedora installation workflow

* started with restructuring installation section

* adding installing ... sections

* workflow to Fedora

* in a container it is

* installing missing tools

* specify mirror

* missing gfortran and deps

* wip on README

* fixing INLA installation mirror

* more details on jags

* adding mirrors

* Info about GSL

* fixing installation command

* done with extre installation steps

* harmonizing structure

* fixing gsl download

* providig mirror

* separately install rjags

* install R-devtools

* adding BiocManager deps

* fixing testthat call

* installing INLA separately

* fixing name

* intalling R on macos

* test without cmake

* getting the tests and run testthat

* properly handling renv

* attempt to link (r)jags

* intalling alos Suggests

* fixing path to jags.pc

* installing Suggests

* also install rjags explicitly

* install pkg-config for rjags

* working config on fedora server

* try with the pkg-config path

* without specifying type

* debugging

* fixed R script run

* check runtime linkage

* better highlighting

* debugging

* provide path to jags library

* try without pkg_config_path

* details about fedora and jags

* including entropy package

* to revert - test with actual version

* run autoconf before installing from source

* started with prereq part

* started with macos prereqs

* separate location for build and test

* Ubuntu installation workflow

* Ubuntu based workflow

* debugging folder permisssions

* allow adm group to write to /usr/local/lib

* install dependencies

* completing installing from ... parts

* formatting

* specify which dependencies

* identical testing workflow

* fixing pkg root

* adding dependencies for testing

* adding udunits for INLA #125

* typeo

* adiding curl dev for inla dep.

* installing INLA dependencies

* try to avoid version check issue in devtools

* installing openssl heasders

* installing openssl dev

* fixing package name

* first make dir writeable

* macos install gdal for s2>fmesher>INLA

* installing gdal for INLA

* fixing folder perms for R site-library

* jpeg headers for INLA dependency

* includig gdal headers for INLA

* adding gdal headers for INLA

* adding testthat again

* try install avoiding useing local .o and .so

* testing the install via CRAN

* bouncing moments dependency

* fixing typeo

* proj headers for sf>fmesher>INLA

* adding proj headers for INLA

* adding configure built with configure.ac - see #127

* specify mirror for CRAN install

* adding some more info to configure

* fixing typeo

* uniform naming

* loading library

* cleaning up windows workflow

* cleaning up macos workflow

* cleaning up fedora workflow

* cleaning up ubuntu workflow

* installing geos headers for INLA

* installing geos>terra>INLA

* corrected comment

* building from source

* how to install from source

* adding pandoc to build from source

* do not build vignettes

* fixing devtools info for mac +

* do not build vignettes

* specify repos

* ditch the matrix

* using autoreconf

* removing virtual env setup for now (is untested)

* only claim what we really tested

* minor completion by adding mirror

* adding install status badges

* minor formatting

* running on specific branch

* more structure in INLA part

* test headers

* formatting dropdowns as headers

* properly set targeted branch

* minor formatting

* adding rjags install for ubunut

* fixing typos

* fixing #129 - typo

* better indentation

* fixing some permissions for fedora

* simply ignore the installation issue for html docs
  • Loading branch information
j-i-l committed Jul 14, 2024
1 parent cf09d5e commit 616ce66
Show file tree
Hide file tree
Showing 12 changed files with 1,160 additions and 201 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/onlabel_CRAN_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ jobs:
run: |
renv::deactivate()
shell: Rscript {0}
- name: Change permissions of configure
- name: Configure ABN for installation
run: |
chmod +x configure
shell: bash
autoreconf
- name: Install package dependencies
run: |
devtools::install_deps(pkg = '.', dependencies = TRUE, upgrade='never')
Expand Down
164 changes: 164 additions & 0 deletions .github/workflows/onlabel_Fedora_setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# 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: Fedora Install

on:
pull_request:
types: [ labeled ]

env:
LABEL_CHECK: 'fedoraInstall::check'
LABEL_SUCCESS: 'fedoraInstall::passed'
LABEL_FAILURE: 'fedoraInstall::failed'
JAGS: '4.3.2'
BUILD_LOC: "./build"
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
container:
image: "fedora:latest"
if: ${{ github.event.label.name == 'fedoraInstall::check' }}
name: fedora-latest R release
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- name: prepare fedora
run: |
dnf -y install wget
dnf -y install gcc
dnf -y install gcc-c++
dnf -y install gfortran
dnf -y install lapack* # is needed on fedora server
dnf -y install blas*
dnf -y install atlas*
- name: install R
run: |
dnf -y install R
- name: install config and build dependencies
run: |
dnf -y install pkg-config
dnf -y install cmake
dnf -y install R-devtools
- name: install GSL
run: |
dnf -y install gsl-devel
- name: install JAGS
run: |
wget -O /tmp/jags.tar.gz https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/JAGS-${{ env.JAGS }}.tar.gz/download
cd /tmp
tar -xf jags.tar.gz
cd /tmp/JAGS-${{ env.JAGS }}
./configure --libdir=/usr/local/lib64
make
make install
- name: assert runtime linkage
run: |
echo "/usr/local/lib64" > /etc/ld.so.conf.d/jags.conf
/sbin/ldconfig
- name: install rjags
run: |
install.packages("rjags", configure.args="--enable-rpath", repos=c(CRAN="https://cran.r-project.org"))
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 GitHub
run: |
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
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: |
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")
shell: Rscript {0}

report_Fedora_setup:
if: ${{ (success() || failure()) }}
needs:
- setup-and-install
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.setup-and-install.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.setup-and-install.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.setup-and-installoutcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
134 changes: 134 additions & 0 deletions .github/workflows/onlabel_Macos_setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# 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: Macos Install

on:
pull_request:
types: [ labeled ]

env:
LABEL_CHECK: 'macosInstall::check'
LABEL_SUCCESS: 'macosInstall::passed'
LABEL_FAILURE: 'macosInstall::failed'
BUILD_LOC: "./build"
BRANCH: ${{ github.head_ref || github.ref_name }}

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

jobs:
setup-and-install:
if: ${{ github.event.label.name == 'macosInstall::check' }}
name: macos-latest R release
runs-on: macos-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
steps:
- name: prepare macos
run: |
brew install R
brew install pkg-config
brew install automake # needed to run autoconf
- name: install GSL
run: |
brew install gsl
- name: install JAGS
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 INLA dependencies
run: |
brew install udunits
brew install openssl@1.1 # s2 package
brew install gdal # installs geos as dependency
# for s2 fmesher terra)
brew install proj # sf 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 GitHub
run: |
devtools::install_github("furrer-lab/abn", ref="${{ env.BRANCH }}", dependencies=c("Depends", "Imports", "LinkingTo"), local=FALSE)
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: |
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")
shell: Rscript {0}

report_Macos_setup:
if: ${{ (success() || failure()) }}
needs:
- setup-and-install
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.setup-and-install.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.setup-and-install.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.setup-and-install.outcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
Loading

0 comments on commit 616ce66

Please sign in to comment.