[ADMB Users] ABMD & DLLs
Laurie Kell
Laurie.Kell at iccat.int
Sun Feb 21 04:22:11 PST 2010
I have managed to compile windows MSVC9 DLLs, both on the command line
and using the IDE with debugging info. I will update the adlink.bat for
MSVC9
However, using the simple example to create the DLL there is a problem
when calling the DLL from R for versions compiled in MSVC9 and GCC
(windows and linux).
The MSVC9 dll crashes at line
mp.computations(argc,argv);
While under GCC (both windows and linux) although the DLL runs i.e.
.C("simpleDLL", ...)
it crashes R if you try to save the results i.e.
res<-.C("simpleDLL", ...)
I think this points to a memory allocation or a calling convention
problem in the ADMB code. I´ve had a quick look at the code on
http://code.google.com/p/admb-project
But think it might be easier if somebody who is more familar with the
source than me could have a look at this problem.
Laurie
Arni Magnusson wrote:
> I haven't been able to create working ADMB DLLs in Linux, but it may
> be possible in some ADMB releases. To make your R package run in
> Linux, you may have to include the model as an executable like the
> glmmADMB example, unless you can get the Linux DLL to work.
>
> I just remembered an additional positive entry in my DLL success
> table, with an old Borland-ADMB setup:
>
> Windows GCC: yes
> Windows BCC52: yes (old ADMB version 5.0.1 from 2000)
> Windows BCC55: no
> Windows MSVC6: yes (old ADMB version 5.0.1 from 2000)
> Windows MSVC8: ?
> Linux GCC: no
>
> The fact that Windows BCC52 could create working DLLs makes me believe
> that this capability can be revived for the current Windows BCC55.
> Likewise, I'm sure DLLs once worked for Linux GCC and can be fixed. I
> can create non-ADMB DLLs with Linux GCC that run fine in R, so the
> problem is in ADMB.
>
> Laurie, it sounds like you have the ambition and skills to contribute
> in this area. Please share your findings and improvements!
>
> Arni
>
>
>
> On Tue, 16 Feb 2010, Laurie Kell wrote:
>
>> Thanks Arni for your quick response.
>>
>> My interest is in running ADMB DLLs from R under Windows, Linux and
>> Mac operating systems,mainly using GCC. I also have both the full and
>> the free express version of MSVC and I have been able to compile ADMB
>> DLLs using these so I should be able to create a script. However, I
>> have had other problems in linking and in running with some versions
>> of the ADMB libraries . But as I can compile the DLLs then it should
>> be possible to track down runtime errors especially as we now have
>> access to the ADMB source.
>>
>> I have had a bit of experience in running ADMB DLLs, well at least I
>> know the problems and have found some solutions. Modifying the TPL
>> files is not too difficult and I can include my own C++ classes
>> within the ADMB C++ code. The main problem is that most of the work
>> is in modifying the C++ code not the TPL. Maybe if I can find some
>> generic solutions then it will be possible at a future date to make
>> these part of the TPL code.
>>
>> Thanks Laurie
>>
>
>
More information about the Users
mailing list