1

I am trying to install the R library BRugs on my Ubuntu 12.04 desktop.

> sessionInfo()
R version 2.15.1 (2012-06-22)
Platform: x86_64-pc-linux-gnu (64-bit)

But I get the following error:

* installing *source* package ‘BRugs’ ...
** package ‘BRugs’ successfully unpacked and MD5 sums checked
checking for prefix by checking for OpenBUGS... /usr/bin/OpenBUGS
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/RtmpnNLTG1/R.INSTALL488b7635d4c0/BRugs':
configure: error: C compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘BRugs’
* removing ‘/home/myuser/lib/R/BRugs’
Warning in install.packages("BRugs") :
  installation of package ‘BRugs’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmp2ytOWn/downloaded_packages’

Here is a link to config.log. It is difficult to tell what the error is, except that the errors starts with gcc: error: unrecognized option '-V'.

How can I get around this error (and install BRugs)?

David LeBauer
  • 31,011
  • 31
  • 115
  • 189
  • 1) Probably in `/tmp/RtmpnNLTG1/R.INSTALL488b7635d4c0/BRugs`. 2) Did you follow the instructions in [Chapter 1: Creating R packages](http://cran.r-project.org/doc/manuals/R-exts.html#Creating-R-packages) of *Writing R Extensions*? – Joshua Ulrich Aug 22 '12 at 17:17
  • @JoshuaUlrich 1) `/tmp/RtmpnNLTG1/` does not exist 2) I am doing so now. – David LeBauer Aug 22 '12 at 17:25
  • Try `sudo apt-get install build-essential` in your shell before installing BRugs if you have not done before. Maybe this installs any missing dependency. – halex Aug 22 '12 at 17:28
  • @halex I already have the `build-essential` package – David LeBauer Aug 22 '12 at 17:29
  • @David: Paragraph 3 of my reference cites *R Installation and Administration*; be sure to read [Appendix A](http://cran.r-project.org/doc/manuals/R-admin.html#Essential-and-useful-other-programs-under-a-Unix_002dalike) of that manual. – Joshua Ulrich Aug 22 '12 at 17:31
  • @JoshuaUlrich all I can find is the [configure and cleanup](http://cran.r-project.org/doc/manuals/R-exts.html#Configure-and-cleanup) section, but I can't find the `configure.ac` file that it says I likely need to edit. – David LeBauer Aug 22 '12 at 17:32
  • `configure.ac` is in the package tarball: `tar -zxf BRugs_0.8-0.tar.gz && ls -l BRugs/configure.ac`. – Joshua Ulrich Aug 22 '12 at 17:39
  • @JoshuaUlrich thanks, even after making the suggested changes to `configure.ac` and then running build / install, I get the same error. – David LeBauer Aug 22 '12 at 17:53
  • Run `./configure` from `BRugs/` and add the relevant section from `configure.log` to your question. – Joshua Ulrich Aug 22 '12 at 18:01
  • @JoshuaUlrich I have updated the question with a [link to the entire config.log](http://dl.dropbox.com/u/18092793/config.log) since there were a lot of errors and it is not clear to me which are relevant. – David LeBauer Aug 22 '12 at 18:12
  • What happens if you change line 2204 in file `configure` from `for ac_option in --version -v -V -qversion; do` to `for ac_option in --version -v; do` and run ./configure? – halex Aug 22 '12 at 19:15
  • @halex this fixes errors related to `gcc -V` and `-qversion` but the next error "cannont find crt1.o` is still there, along with subsequent errors (`incompatable lgcc.a`, `cannont find -lgcc`, ...) – David LeBauer Aug 22 '12 at 19:38
  • Did you ever get it installed? I'm having the same error, Ubuntu 12.04 64 bit, R 3.0.2 – vitale232 Feb 25 '14 at 02:25
  • @vitale232 no, JAGS does what I need! – David LeBauer Feb 25 '14 at 21:09
  • @David Yeah, looks like there are some other good options out there. Unfortunately I need to force a code from my professor to run that's written in bugs. Guess I'll be booting up the old 32 bit machines. Thanks for your response! – vitale232 Feb 26 '14 at 00:44
  • @vitale232 "BUGS" is a language that is used by different software - WinBUGS, OpenBUGS, and JAGS. There are a few syntax differences, but most scripts will work in all three. – David LeBauer Feb 27 '14 at 10:11

1 Answers1

1

According to the package description:

Versions running on Linux and on 64-bit R under Windows are in "beta" status and less efficient.

And it looks like configure is trying to build the package using 32-bit executables (note the -m32 flags). It's probably best if you contact the package maintainer(s) and ask them how to build the 32-bit executable under 64-bit Ubuntu.

Joshua Ulrich
  • 173,410
  • 32
  • 338
  • 418
  • Thanks. Although this doesn't solve my problem, our discussion in the comments about building from source was a good learning experience for me. I am happy using JAGS, but just wanted to use BRugs to help figure out my core issue of trying to convert the mcmc.list produced by rjags to a coda object produced by rbugs described in my posts on [this site](http://stackoverflow.com/questions/12078152/how-can-i-convert-an-mcmc-list-to-a-bugs-object) and [stats.se](http://stats.stackexchange.com/q/32462/1381), which remain unanswered despite each having had bounties. – David LeBauer Sep 07 '12 at 13:39