From ligges at statistik.uni-dortmund.de  Wed Aug  8 09:21:10 2007
From: ligges at statistik.uni-dortmund.de (Uwe Ligges)
Date: Wed, 08 Aug 2007 09:21:10 +0200
Subject: [Rd] Sligthly OT Re: Makefile for embedding OpenBUGS in
	R	package
In-Reply-To: <46B8D6AD.9040707@cimr.cam.ac.uk>
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>
Message-ID: <46B96EE6.2090606@statistik.uni-dortmund.de>



Hin-Tak Leung wrote:
> Prof Brian Ripley wrote:
>> OpenBUGS is distributed under GPL2, so this seems not to apply.
>> It is distributed as source and as binaries: the difficulty is that it 
>> is written in Object Pascal for which a compiler is not readily available.
> 
> Argh, I just thought of a proper technical reason, and I think I have 
> spotted a possible bug in the original poster's code! Some choose to do
> dlopen() when the DLL/so is in a non-standard/non-system location, as an
> alternative to setting LD_LIBRARY_PATH explicitly or other link-loader
> magics.
> 
> The line:
>     handle = dlopen("./brugs.so", RTLD_LAZY);
> 
> Seems to suggest this, However, the problem with this code, is that
> the current directory  (./) may not be where the user thinks it is.
> I think the user meant to prepend $R_HOME/library/<package>/inst/ 
> somehow to "brugs.so", and dlopen'ing 
> "$R_HOME/library/<package>/inst/brugs.so" instead.

No, it's fine if the executable is started in the same directory, and 
that can be assured by the calling R code. Otherwise it will only work 
if you have the package in the main library of R.
Anyway, it is still highly preferable to just load the Bugs lib into R, 
if we only could compile the stuff...

Uwe




> Hin-Tak
> 
> <snipped>
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] Sligthly OT Re: Makefile for embedding OpenBUGS in R package
Uwe Ligges