From tobias.verbeke at telenet.be  Tue Aug 14 21:58:07 2007
From: tobias.verbeke at telenet.be (Tobias Verbeke)
Date: Tue, 14 Aug 2007 21:58:07 +0200
Subject: [Rd] Sligthly OT Re: Makefile for embedding OpenBUGS in R
	package
In-Reply-To: <loom.20070814T203929-398@post.gmane.org>
References: <W906017980119021186410641@nocme1bl6.telenet-ops.be>	<Pine.LNX.4.64.0708062029410.27542@gannet.stats.ox.ac.uk>	<46B7B87C.1070808@cimr.cam.ac.uk>	<Pine.LNX.4.64.0708070340290.31210@gannet.stats.ox.ac.uk>	<46B8D6AD.9040707@cimr.cam.ac.uk>	<46B96EE6.2090606@statistik.uni-dortmund.de>	<46BA1863.6030609@telenet.be>
	<46BA2E65.7080301@cimr.cam.ac.uk>	<46C14875.5020008@businessdecision.com>
	<loom.20070814T203929-398@post.gmane.org>
Message-ID: <46C2094F.5000102@telenet.be>

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
Linux:

(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

-- 

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



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