[Rd] Sligthly OT Re: Makefile for embedding OpenBUGS in R package

Tobias Verbeke tobias.verbeke at telenet.be
Tue Aug 14 21:58:07 CEST 2007

Hi Ben,

> Tobias Verbeke <tobias.verbeke <at> businessdecision.com> writes:
>> The resulting package now allows for using an embedded OpenBUGS
>> on GNU/Linux without relying on WINE. Thanks to all for their helpful 
>> comments.
>   woo-hoo!  this is great!  Any chance that this will propagate
> to the R2WinBUGS package at some point ... ??? 

A quick look at R2WinBUGS reveals that this package does not
embed the OpenBUGS distribution within the package. This is
not needed per se, but will then imply that the user has to
compile the C file that accesses the brugs.so shared library
(or a variant as the path to the bugs executable is an argument
to the bugs function in R2WinBUGS). When I worked on this (for
a specific application a client had in mind), I deliberately
chose to avoid any administration in addition to ordinary R
package installation.

The BRugs package, on the contrary, embeds a (previous) version
of OpenBUGS and could use what we found out in this thread, but
then the interface of BRugs is more designed for interactive use
of BUGS which currently still is possible only on Windows. It
might be an idea to modify the BRugsFit function (BRugs' meta function) 
to run a script file in one go when it runs on GNU/Linux. This
modification is needed as the current BRugsfit uses the "interactive"
commands modelCheck(), modelCompile() etc. in separate steps.

If the maintainer (in cc) would think this is a good idea, the
following things should then be assured within the BRugs package
in addition of changing BRugsFit function for it to work under

(1) all of the BUGS files (data, model, inits and script files)
	should have CR LF line endings

(2) the script file produced should end on modelQuit() without
	any additional character (no newline)

Alternatively, it could be put into (yet another) R <-> BUGS
package, but this would duplicate a lot of the BRugs code.

Kind regards,


Tobias Verbeke - Consultant
Business & Decision Benelux
Rue de la révolution 8
1000 Brussels - BELGIUM

+32 499 36 33 15
tobias.verbeke at businessdecision.com

More information about the R-devel mailing list