#!/bin/bash
export LD_ASSUME_KERNEL=2.4.1
DIR=$(dirname $0)
cd "$DIR"
if [ \! -e "$DIR/temp" ] ; then
mkdir "$DIR/temp"
fi
if [ -e bugs.so ] ; then
./cbugs "$DIR" "$DIR/temp" "/bugs.so"
else
./cbugs "$DIR" "$DIR/temp" "/brugs.so"
fi
gcc -o cbugs CBugs.c -ldl -m32
. The file includes the following codes
/* GNU General Public Licence
This small C program loads the bugs.so ELF shared library.
Save it as a .c file and then
compile it on Linux using gcc -o cbugs Cbugs.c -ldl
*/
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>
int main (int argc, char **argv)
{
void * handle;
handle = dlopen("./bugs.so", RTLD_LAZY);
if (handle)
{
dlclose(handle);
}
return 0;
}
./linbugs
in the OpenBUGS directory
OpenBUGS ClassicBUGS release 2.1.1 type 'modelQuit()' to quit Bugs>
Bugs> modelCheck("Examples/Airmodel.txt")
model is syntactically correct
Bugs> modelData("Examples/Airdata.txt")
data loaded
Bugs> modelCompile()
model compiled
Bugs> modelInits("Examples/Airinits.txt")
model is initialized
Bugs> modelUpdate(100000)
100000 updates took 4 s
Bugs> samplesSet("theta")
monitor set
Bugs> summarySet("theta")
monitor set
Bugs> modelUpdate(10000)
10000 updates took 0 s
Bugs> samplesStats("theta")
mean sd MC_error val2.5pc median val97.5pc start sample
theta[1] -1.1 1.332 0.1092 -5.243 -0.7288 0.2504 101001 10000
theta[2] 0.05332 0.05231 0.004327 0.002579 0.03949 0.2046 101001 10000
Bugs> samplesCoda("*","output")
CODA files written
Bugs> modelQuit()