From tobias.verbeke at telenet.be  Mon Aug  6 13:09:28 2007
From: tobias.verbeke at telenet.be (Tobias Verbeke)
Date: Mon, 06 Aug 2007 11:09:28 +0000
Subject: [Rd] Makefile for embedding OpenBUGS in R package
Message-ID: <W98105532758441186398568@nocme1bl6.telenet-ops.be>

   Dear list, 

   I'm trying to embed OpenBUGS in an R package for use of it
   on 64-bit Linux. In order to get the CLI working one has to
   compile C code contained in $OpenBUGS/Manuals/CBugs.html
   (copied to say CBugs.c) using
 
   gcc -m32 -o bugs CBugs.c -ldl

   I put the OpenBUGS distribution in the ./inst subdirectory of
   the package root. Where should I now put the CBugs.c and how
   should the Makefile look like in order to be able to call
   $PKG_ROOT/OpenBUGS/bugs afterwards ?

   Naively putting the following Makefile in ./src does not work

   -%--------
   bugs: ../inst/OpenBUGS/CBugs.c
        gcc -m32 -o bugs ../inst/OpenBUGS/CBugs.c -ldl
   -%-------

   The objective is to use something along the following 

   execfile <- system.file("OpenBUGS", "bugs", package = mypkg)
   system(paste(execfile, "< somescript.script > somefile.out"))

   This system call to the CLI is currently the only (non-WINE) 
   way of using OpenBUGS on Linux in batch mode.    


   Many thanks in advance,
   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] Makefile for embedding OpenBUGS in R package
Tobias Verbeke