Skip to content

Commit

Permalink
compile jags with R specific libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed Jan 14, 2024
1 parent 2038d53 commit 3b67b35
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions containers/fedora/clang/R-devel/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,21 @@ ENV PATH="/opt/$FLAVOUR/bin:${PATH}"
RUN echo 'options(repos =c(CRAN = "https://cran.rstudio.com"))' \
>> /opt/$FLAVOUR/lib64/R/library/base/R/Rprofile

# rjags:
RUN dnf -y install \
lapack* blas* atlas*
ADD https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/$JAGS.tar.gz/download /tmp/jags.tar.gz
WORKDIR /tmp/
RUN ls /tmp/
RUN tar -xf jags.tar.gz
WORKDIR /tmp/$JAGS
# RUN ./configure --libdir=/usr/local/lib64 && make && make install
RUN LD="llvm-ld" CC="/usr/bin/clang" CXX="/usr/bin/clang++ -std=gnu++17 -stdlib=libc++" ./configure --with-blas="-L/opt/R-devel/lib64/R/lib -lRblas" --with-lapack="-L/opt/R-devel/lib64/R/lib -lRlapack" --libdir=/usr/local/lib64 && make && make install
RUN ls /tmp/$JAGS
# ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
# RUN R -e "install.packages('rjags')"
RUN R -e "install.packages('rjags', configure.args = '--enable-rpath')"

# Get and install packages for local debugging
RUN R -e "install.packages('devtools')" \
&& R -e "install.packages('remotes')" \
Expand All @@ -36,19 +51,6 @@ RUN dnf -y install \
NLopt-devel
# RUN R -e "install.packages('lme4')"

# rjags:
RUN dnf -y install \
lapack* blas* atlas*
ADD https://sourceforge.net/projects/mcmc-jags/files/JAGS/4.x/Source/$JAGS.tar.gz/download /tmp/jags.tar.gz
WORKDIR /tmp/
RUN ls /tmp/
RUN tar -xf jags.tar.gz
WORKDIR /tmp/$JAGS
RUN LD="llvm-ld" CC="clang" CXX="clang++" ./configure --libdir=/usr/local/lib64 && make && make install
RUN ls /tmp/$JAGS
# ENV PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
RUN R -e "install.packages('rjags', configure.args = '--enable-rpath')"

# Graphviz
RUN R -e "install.packages('BiocManager')" \
&& R -e "BiocManager::install('Rgraphviz')"
Expand Down

0 comments on commit 3b67b35

Please sign in to comment.