Re: [Rd] unloading compiled code.

2010-11-18 Thread Andrew Redd
I thought I would update with what I did. Not liking overwriting the .Last function in case another package I decided to see if the reg.finalizer would work. This is what my .onLoad function look like. --- .onLoad<-function(libname, pkgname){ e<-emptyenv() library.dynam('gpuBayes'

Re: [Rd] unloading compiled code.

2010-11-16 Thread Charles C. Berry
On Tue, 16 Nov 2010, Andrew Redd wrote: so should I use reg.finalizer or overwrite .Last()? .Last Error: object '.Last' not found You create your own .Last - there is nothing to overwrite. Chuck If I use reg.finalizer, what should be the environment that I specify? The straight for

Re: [Rd] unloading compiled code.

2010-11-16 Thread Andrew Redd
so should I use reg.finalizer or overwrite .Last()? If I use reg.finalizer, what should be the environment that I specify? The straight forward solution would be to have a hook .onExit that a package could specify to make sure that the code was unloaded before the program terminates, that way I

Re: [Rd] unloading compiled code.

2010-11-16 Thread Charles C. Berry
On Tue, 16 Nov 2010, Andrew Redd wrote: Just found in the documentation for getHook that packages are not unloaded on quit. How should I force a package to unload on quit? See ?q HTH, Chuck -Andrew On Tue, Nov 16, 2010 at 10:25 AM, Andrew Redd wrote: Are packages unloaded on

Re: [Rd] unloading compiled code.

2010-11-16 Thread Andrew Redd
Just found in the documentation for getHook that packages are not unloaded on quit. How should I force a package to unload on quit? -Andrew On Tue, Nov 16, 2010 at 10:25 AM, Andrew Redd wrote: > Are packages unloaded on quit so that the .Last.lib or .onUnload are > called for packages? > > -And

Re: [Rd] unloading compiled code.

2010-11-16 Thread Andrew Redd
Are packages unloaded on quit so that the .Last.lib or .onUnload are called for packages? -Andrew On Fri, Nov 12, 2010 at 3:52 PM, Andrew Redd wrote: > Perhaps you could help me make some sense of this.  Here is a printout > of my sessions. > --- > toys$R -q >> library(test2) >> gpualloctest() >

Re: [Rd] unloading compiled code.

2010-11-12 Thread Andrew Redd
Perhaps you could help me make some sense of this. Here is a printout of my sessions. --- toys$R -q > library(test2) > gpualloctest() testing allocation on gpu C Finished Collecting Garbage done. > q() Save workspace image? [y/n/c]: n *** caught segfault *** address 0x7f12ec1add50, cause 'memory

Re: [Rd] unloading compiled code.

2010-11-12 Thread Prof Brian Ripley
On Fri, 12 Nov 2010, Andrew Redd wrote: I have a package that I'm developing that I need to unload the library. Long story short I figured out that the leaving the compiled code loaded lead to a segmentation fault, but unloading the code will fix it. I've read the documentation and it appears

[Rd] unloading compiled code.

2010-11-12 Thread Andrew Redd
I have a package that I'm developing that I need to unload the library. Long story short I figured out that the leaving the compiled code loaded lead to a segmentation fault, but unloading the code will fix it. I've read the documentation and it appears that there are several ways to do this? Wh