[Developers] tpl2rem -dll broken

Arni Magnusson arnima at hafro.is
Thu May 21 18:21:42 PDT 2009

On Thu, 21 May 2009, dave fournier wrote:

> Actually I gave up on the dll sutff as there seemed to be some kind of 
> subtle error and the R (and Gauss) people didn't seem to give a shit 
> about the effort anyway. So it was never extrended to tpl2rem.

Well, wasn't glmmADMB 
(http://otter-rsch.com/admbre/examples/nbmm/nbmm.dll) created with 
tpl2rem, though? And Microsoft Visual C++, as far as I can tell. Does 
anyone know whether seddf1b2dll and seddf1b3dll existed back then, or was 
the mechanism different?

I think DLLs are worthwhile. ADMB-IDE provides a GUI option to create DLL, 
and does so successfully for plain (non-RE) models in Windows. It loads 
and runs smoothly in R, so I haven't noticed the subtle error that Dave 
mentioned, but maybe that's because I'm only using the minimalistic 
simpdll.tpl example.

I have not been able to build a working simpdll.so in Linux, on the other 
hand. The current version of ADMB is not built with -fPIC, so the linker 
complains about libadmod.a:

$ g++ -s -shared -L$ADMB_HOME/lib simpdll.o -ldf1b2stub -ladmod -ladt 
-lado -ldf1b2stub -ladmod -ladt -lado -o simpdll.so
/usr/bin/ld: /home/arnima/admb/lib/libadmod.a(admodel.obj): relocation 
R_X86_64_32 against `a local symbol' can not be used when making a shared 
object; recompile with -fPIC
/home/arnima/admb/lib/libadmod.a: could not read symbols: Bad value 
collect2: ld returned 1 exit status

If I rebuild ADMB after inserting -fPIC into the makefiles, I can build 
the simpdll.so, but R can't load it:

> dyn.load("~/simpdll/simpdll.so")
Error in dyn.load("~/simpdll/simpdll.so") :
   unable to load shared library '/home/arnima/simpdll/simpdll.so':
   /home/arnima/simpdll/simpdll.so: undefined symbol: 

All the best,


More information about the Developers mailing list