Skip to content
Back to formatted view

Raw Message

Message-ID: <W98105532758441186398568@nocme1bl6.telenet-ops.be>
Date: 2007-08-06T11:09:28Z
From: Tobias Verbeke
Subject: Makefile for embedding OpenBUGS in R package

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