Linking and Executable
versions
The OpenBUGS software family is unusual in consisting of a large number of unlinked modules in a binary format .These modules can not be directly accessed by the operating system. A linker tool is used to link a number of binary modules into either an executable or a library. The BlackBox developement tools contain a special module the StdLoader which is able to load and link new modules into a running OpenBUGS application. There are two approaches to packageing the OpenBUGS software. In the first only a small number of modules are linked along with StdLoader in the second all the modules in the OpenBUGS software are linked into one large file. The first approach is more dynamic and flexible and is used in WinBUGS. However it has some disadvantages: it involves a large number of files in a particular directory structure which can become fragile when used with a library for interfacing to other software. For this reason we prefer to fully link the library versions of OpenBUGS.
There are various ways of running the OpenBUGS software on computers with the Microsoft Windows operating system. winbugs.exe is small Microsoft Windows program which loads code files (ocf) as needed. The classicbugs.exe program has a similar interface to the old "ClassicBUGS" software. A shortcut BackBUGS runs Winbugs with the file name specified on the command line, after the key word /PAR, used as a source of commands in a BUGS script. This allows another program to call OpenBUGS to do MCMC simulation. The BackBUGS shortcut has been set up so that no window opens while BUGS runs. This can be changed by editing the shortcut so that "/HEADLESS" is removed from the command line.
The brugs dynamic link library was designed for use from within Splus/R statistical programming enviroment and only uses modues that do not depend on Microsoft Windows. The pro cedures exported by the brugs library are specified in the module BugsBRugs . In particular the CLI procedure sets up a simple command line interpreter -- the ClassicBUGS interface. It is also possible to use the brugs dynamic link library from within a general C program (see BRugs header file for details).
In general the ocf files are not operating system dependent. In the make file those modules in black should be usable from both Windows and Linux, whereas the modules in red are only used in winbugs. With just a few changes the modules that are linked to form the brugs dynamic link library can also be linked to produce a shared object file for linux.
The R functions for interfacing to the brugs dynamic link library / shared object file are in the BRugs package on CRAN. The names of these R functions are the same as in the OpenBUGS scripting language and have the same function. Both the scripting language and the R functions use metaprogramming to communicate with OpenBUGS, see the module BugsStdInterpreter for details.
To make the executable versions of the OpenBUGS software a linker tool is used to pack several code (ocf) files into one exe or dynamic link library (shared object file on Linux). The linker is given a list of module names (in the form subsystem prefix followed by a file name). The linker searches for the ocf file in the code subdirectory of the subsystem with the appropiate file name. Note that this ocf might correspond to a module with a name different to the name given to the linker. Winows and Linux use different binary formats for executables and libraries. Therefore two linker tools are requires: DevLinker for Windows and DevElfLinker for Linux.
ClassicBUGS uses the Console module for input and output. There are two version of the the module Console one for the Windows platform and the other for the Linux platform. On Windows the Console module makes calls to the Windows API while on Linux it makes calls to the C runtime library.
How to link OpenBUGS
To create the winbugs.exe file click in the round .blob containing an ! mark with the mouse
DevLinker.Link
winbugs.exe := Kernel$ + Files HostFiles Console WinConsole StdLoader
1 Bugslogo.ico 2 Doclogo.ico 3 SFLogo.ico 4 CFLogo.ico 5 DtyLogo.ico
6 folderimg.ico 7 openimg.ico 8 leafimg.ico
1 Move.cur 2 Copy.cur 3 Link.cur 4 Pick.cur 5 Stop.cur 6 Hand.cur 7 Table.cur
To make a fully linked version of the brugs dynamic link library for Windows click in the round blob below
DevLinker.LinkDll
brugs.dll := Kernel$+ Files HostFiles Meta Console WinConsole BugsInterpreter
Math Strings Dialog Stores
BugsMappers BugsStrings BugsFiles BugsStdInterpreter
BugsMsg BugsRegistry
MathSort MathMatrix MathSparsematrix MathFunc MathRandnum MathODE MathFunctional MathRungeKutta MathRungeKutta45 MathBulirschStoer MathAESolver MathIntegrate
MathLincon MathTT800 MathDiagmatrix MathBGR MathSmooth
GraphRules GraphNodes GraphLogical GraphStochastic GraphScalar GraphVector GraphUnivariate GraphMultivariate GraphConjugateMV GraphChain GraphBlock
MonitorsSamples MonitorsSummary MonitorsDeviance
UpdaterUpdaters UpdaterResample UpdaterMethods UpdaterUnivariate UpdaterMultivariate UpdaterContinuous UpdaterActions UpdaterMetmonitor
GraphConstant GraphMixture GraphStack GraphFlat GraphGeneric GraphClock
LindevCPM LindevCPT LindevCPB LindevCPS LindevCPP LindevCPE LindevCPH LindevCPL486 LindevCPC486 LindevCPV486
BugsVersion BugsGrammar BugsNames BugsIndex BugsVariables BugsParser BugsEvaluate BugsNodes BugsOptimize BugsChaingraph BugsCodegen BugsCPCompiler BugsData BugsDeviance BugsRobjects BugsInterface BugsInfo
Services
BugsScripting
BugsEmbed
BugsRectData BugsSplusData
SamplesMonitors SamplesIndex SamplesInterface SamplesFormatted SamplesEmbed
SummaryMonitors SummaryIndex SummaryInterface SummaryFormatted SummaryEmbed
RanksMonitors RanksIndex RanksInterface RanksFormatted RanksEmbed
DevianceMonitors DevianceIndex DeviancePlugin DevianceInterface DevianceFormatted DevianceEmbed
CorrelInterface CorrelFormatted CorrelEmbed
GraphCloglog GraphCut GraphDensity GraphEigenvals GraphGammap GraphInprod GraphInverse GraphKepler GraphLog GraphLogdet GraphLogit GraphProbit GraphProduct GraphRanks GraphSumation GraphTable GraphFunctional GraphODEmath GraphODElang
GraphPValue GraphReplicate GraphItermap
GraphBern GraphBinomial GraphCat GraphFounder GraphGeometric GraphHypergeometric GraphMendelian GraphNegbin GraphPoisson GraphRecessive
GraphMultinom
GraphBeta GraphChisqr GraphDbexp GraphExp GraphF GraphGEV GraphGPD GraphGamma GraphGengamma GraphLogistic GraphLognorm GraphNormal GraphPareto GraphPolygene GraphStable GraphT GraphTrapezium GraphUniform GraphWeibull GraphWeibullShifted
GraphDirichlet GraphMVNormal GraphMVT GraphRENormal GraphStochtrend
GraphWishart
GraphScalarT GraphVectorT GraphUnivariateT GraphScalartemp1 GraphVectortemp1
GraphUnivariatetemp1
UpdaterHybrid1D UpdaterAM UpdaterDE UpdaterHybrid
UpdaterForward
UpdaterBeta UpdaterCatagorical UpdaterDFreeARS UpdaterDescreteSlice UpdaterEmpty
UpdaterGriddy UpdaterGamma UpdaterMetover UpdaterDFreeHybrid1D UpdaterMetbinomial UpdaterMetnormal UpdaterNormal UpdaterPareto UpdaterPoisson UpdaterRejection UpdaterSCAM UpdaterSCDE UpdaterSlice UpdaterNaivemet
UpdaterAMblock UpdaterAMNLLS UpdaterChain UpdaterDEBlock UpdaterDirichlet
UpdaterDirichletprior UpdaterDFreeHybrid UpdaterGLM UpdaterGMRF UpdaterHybridnormal UpdaterHybridglm UpdaterMultinomial UpdaterMVNormal UpdaterMVNLinear UpdaterWishart
UpdaterUnivariateT UpdaterMultivariateT
SpatialBound SpatialPWDPrior SpatialCARl1 SpatialCARNormal SpatialCARProper SpatialStrucMVN SpatialDiscKrig SpatialExpKrig SpatialMaternKrig SpatialPoissconv UpdaterKrigparam
BugsExternal BugsMessages BugsScripts CorrelMessages DevianceMessages
GraphMessages RanksMessages SamplesMessages SpatialExternal SummaryMessages
UpdaterMessages UpdaterExternal MapsMessages
BugsResources CorrelResources DevianceResources GraphResources RanksResources
SamplesResources SpatialResources SummaryResources UpdaterResources MapsResources
Startup BugsCLI
BugsC#
To use brugs.dll to make classicbugs.exe the version of ClassicBUGS for Windows click in the round blob
DevLinker.Link dos classicbugs.exe := BugsClassic$ 1 Bugslogo.ico
To create a fully linked brugs.so click in the round blob
DevElfLinker.LinkDll
brugs.so := LinKernel$+ Files LinHostFiles Meta Console LinConsole BugsInterpreter
Math Strings Dialog Stores
BugsMappers BugsStrings BugsFiles BugsStdInterpreter
BugsMsg BugsRegistry
MathSort MathMatrix MathSparsematrix MathFunc MathRandnum MathODE MathFunctional MathRungeKutta MathRungeKutta45 MathBulirschStoer MathAESolver MathIntegrate
MathLincon MathTT800 MathDiagmatrix MathBGR MathSmooth
GraphRules GraphNodes GraphLogical GraphStochastic GraphScalar GraphVector GraphUnivariate GraphMultivariate GraphConjugateMV GraphChain GraphBlock
MonitorsSamples MonitorsSummary MonitorsDeviance
UpdaterUpdaters UpdaterResample UpdaterMethods UpdaterUnivariate UpdaterMultivariate UpdaterContinuous UpdaterActions UpdaterMetmonitor
GraphConstant GraphMixture GraphStack GraphFlat GraphGeneric GraphClock
LindevCPM LindevCPT LindevCPB LindevCPS LindevCPP LindevCPE LindevCPH LindevCPL486 LindevCPC486 LindevCPV486
BugsVersion BugsGrammar BugsNames BugsIndex BugsVariables BugsParser BugsEvaluate BugsNodes BugsOptimize BugsChaingraph BugsCodegen BugsCPCompiler BugsData BugsDeviance BugsRobjects BugsInterface BugsInfo
Services
BugsScripting
BugsEmbed
BugsRectData BugsSplusData
SamplesMonitors SamplesIndex SamplesInterface SamplesFormatted SamplesEmbed
SummaryMonitors SummaryIndex SummaryInterface SummaryFormatted SummaryEmbed
RanksMonitors RanksIndex RanksInterface RanksFormatted RanksEmbed
DevianceMonitors DevianceIndex DeviancePlugin DevianceInterface DevianceFormatted DevianceEmbed
CorrelInterface CorrelFormatted CorrelEmbed
GraphCloglog GraphCut GraphDensity GraphEigenvals GraphGammap GraphInprod GraphInverse GraphKepler GraphLog GraphLogdet GraphLogit GraphProbit GraphProduct GraphRanks GraphSumation GraphTable GraphFunctional GraphODEmath GraphODElang
GraphPValue GraphReplicate GraphItermap
GraphBern GraphBinomial GraphCat GraphFounder GraphGeometric GraphHypergeometric GraphMendelian GraphNegbin GraphPoisson GraphRecessive
GraphMultinom
GraphBeta GraphChisqr GraphDbexp GraphExp GraphF GraphGEV GraphGPD GraphGamma GraphGengamma GraphLogistic GraphLognorm GraphNormal GraphPareto GraphPolygene GraphStable GraphT GraphTrapezium GraphUniform GraphWeibull GraphWeibullShifted
GraphDirichlet GraphMVNormal GraphMVT GraphRENormal GraphStochtrend
GraphWishart
GraphScalarT GraphVectorT GraphUnivariateT GraphScalartemp1 GraphVectortemp1
GraphUnivariatetemp1
UpdaterHybrid1D UpdaterAM UpdaterDE UpdaterHybrid
UpdaterForward
UpdaterBeta UpdaterCatagorical UpdaterDFreeARS UpdaterDescreteSlice UpdaterEmpty
UpdaterGriddy UpdaterGamma UpdaterMetover UpdaterDFreeHybrid1D UpdaterMetbinomial UpdaterMetnormal UpdaterNormal UpdaterPareto UpdaterPoisson UpdaterRejection UpdaterSCAM UpdaterSCDE UpdaterSlice UpdaterNaivemet
UpdaterAMblock UpdaterAMNLLS UpdaterChain UpdaterDEBlock UpdaterDirichlet
UpdaterDirichletprior UpdaterDFreeHybrid UpdaterGLM UpdaterGMRF UpdaterHybridnormal UpdaterHybridglm UpdaterMultinomial UpdaterMVNormal UpdaterMVNLinear UpdaterWishart
UpdaterUnivariateT UpdaterMultivariateT
SpatialBound SpatialPWDPrior SpatialCARl1 SpatialCARNormal SpatialCARProper SpatialStrucMVN SpatialDiscKrig SpatialExpKrig SpatialMaternKrig SpatialPoissconv UpdaterKrigparam
BugsExternal BugsMessages BugsScripts CorrelMessages DevianceMessages GraphMessages RanksMessages SamplesMessages SpatialExternal SummaryMessages
UpdaterMessages UpdaterExternal MapsMessages
BugsResources CorrelResources DevianceResources GraphResources RanksResources
SamplesResources SpatialResources SummaryResources UpdaterResources MapsResources
Startup BugsCLI
BugsC#