Sunday, May 10, 2020

MethComp package on Fedora

Recently I needed to install MethComp package on my Fedora desktop. After shooting an install.packages command it complained about a nonzero exit status saying that "ERROR: dependency ‘rjags’ is not available for package ‘MethComp’".
I urged for rjags package in Fedora repos, and couldn't find one. Therefore it was the time to make my hands dirty. rjags has a sourceforge page from which I downloaded version 4.3.0 tarball and installed it. Now it was to install rjags package which is a dependency to MethComp. This took some time to understand my new problem which is the error when I try install.packages("rjags"). Now R was complaining that "pkg-config file for jags 4 unavailable, Consider adding the directory containing `jags.pc` to the PKG_CONFIG_PATH environment variable".
After some search I found out that the jags.pc file was under the folder "/usr/local/lib/pkgconfig/", but I didn't know how to show this file to pkg-config from within R. I also recognised that some other .pc files are located in the folder "/usr/lib64/pkgconfig" on my system. So I took a shortcut and copied jags.pc file into this default folder of pkconfig. Lastly, with a command like
install.packages("rjags",configure.args="--enable-rpath")
I was able to install rjags into my system and hence MethComp.