[Rd] ctrl-C aborts R when compiling package code with ICC+openMP

2010-02-03 Thread Ernest Turro
Hi all, I have some C++ code that I call from my package. In my main C++ loop, I check for user interrupts and return to the R shell after ensuring I've deallocated memory appropriately. This works fine when the code is compiled with gcc+openmp and with icc without openmp, but when I compile wi

[Rd] Fwd: ctrl-C aborts R when compiling package code with ICC+openMP

2010-02-03 Thread Ernest Turro
configuration info including native compiler and operating system versions. Faster response will be obtained by including all program sources. For information on submitting this issue, please see http://www.intel.com/software/products/support/. Thanks, Ernest Begin forwarded message: > From: Ernest Tu

[Rd] R/C++/memory leaks

2007-02-25 Thread Ernest Turro
Dear all, I have wrapped a C++ function in an R package. I allocate/deallocate memory using C++ 'new' and 'delete'. In order to allow user interrupts without memory leaks I've moved all the delete statements required after an interrupt to a separate C++ function freeMemory(), which is call

Re: [Rd] R/C++/memory leaks

2007-02-25 Thread Ernest Turro
On 25 Feb 2007, at 22:21, Ross Boylan wrote: > On Sun, Feb 25, 2007 at 05:37:24PM +0000, Ernest Turro wrote: >> Dear all, >> >> I have wrapped a C++ function in an R package. I allocate/deallocate >> memory using C++ 'new' and 'delete'. In order t

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ernest Turro
On 26 Feb 2007, at 10:51, Hin-Tak Leung wrote: > Ernest Turro wrote: >> Dear all, >> I have wrapped a C++ function in an R package. I allocate/ >> deallocate memory using C++ 'new' and 'delete'. In order to allow >> user interrupts

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ernest Turro
Thanks for your comments Ross. A couple more comments/queries below: On 26 Feb 2007, at 06:43, Ross Boylan wrote: > [details snipped] > > The use of the R api can be confined to a wrapper function. But I can > think of no reason that a change to the alternate approach I outlined > would solve th

Re: [Rd] R/C++/memory leaks

2007-02-26 Thread Ernest Turro
Hi Simon, On 26 Feb 2007, at 16:58, Simon Urbanek wrote: > Ernest, > > On Feb 25, 2007, at 12:37 PM, Ernest Turro wrote: > >> I have wrapped a C++ function in an R package. I allocate/ >> deallocate memory using C++ 'new' and 'delete'. In order to all

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Ernest Turro
Hi Ross, On 26 Feb 2007, at 22:34, Ross Boylan wrote: > On Mon, 2007-02-26 at 16:08 +0000, Ernest Turro wrote: >> Thanks for your comments Ross. A couple more comments/queries below: >> >> On 26 Feb 2007, at 06:43, Ross Boylan wrote: >> >>> [details snipped]

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Ernest Turro
[snip] Sorry. Small mistake fixed below: > > Leaving aside the HAVE_AQUA and Win32 cases, I would like to write > a new function: > > int R_CheckInterruptsPending(void) > { > R_CheckStack(); > return R_interrupts_pending; > } > > and then in my C++ code: > if(R_CheckInterruptsPending)

Re: [Rd] R/C++/memory leaks

2007-02-27 Thread Ernest Turro
On 27 Feb 2007, at 17:45, Luke Tierney wrote: > On Tue, 27 Feb 2007, Ernest Turro wrote: > >> Hi Ross, >> >> On 26 Feb 2007, at 22:34, Ross Boylan wrote: >> >>> On Mon, 2007-02-26 at 16:08 +, Ernest Turro wrote: >>>> Thanks for your comment

[Rd] Carriage returns and Sweave output

2007-03-19 Thread Ernest Turro
Dear all, I have a code chunk in my Rnw file that, when executed, outputs carriage return characters ('\r') to inform on the progress (e.g. "sweep 4 of 1024\r"). But Sweave interprets this as a newline character, and therefore I get countless pages of output in my vignette where I only rea

Re: [Rd] Carriage returns and Sweave output

2007-03-19 Thread Ernest Turro
t how about setting > "results=hide" in the options of your code chunk? > > Best wishes > Wolfgang > > -- > Wolfgang Huber EBI/EMBL Cambridge UK http://www.ebi.ac.uk/huber > > Ernest Turro wrote: >&

[Rd] Rinternals.h and undefined symbols

2007-03-19 Thread Ernest Turro
Hi, I'm trying to register my native routines using R_registerRoutines (...). I can compile the code, but the loader cannot resolve the symbol: undefined symbol: _Z18R_registerRoutinesP8_DllInfoPK12R_CMethodDefPK15R_CallMethodDefS3_S6 _ $ nm bgx.Rcheck/bgx/libs/bgx.so | grep R_registerRoutin

Re: [Rd] Rinternals.h and undefined symbols

2007-03-19 Thread Ernest Turro
On 19 Mar 2007, at 21:32, Duncan Murdoch wrote: > On 3/19/2007 5:23 PM, Ernest Turro wrote: >> Hi, >> I'm trying to register my native routines using R_registerRoutines >> (...). I can compile the code, but the loader cannot resolve the >

Re: [Rd] Rinternals.h and undefined symbols

2007-03-19 Thread Ernest Turro
On 20 Mar 2007, at 00:18, Duncan Murdoch wrote: > On 3/19/2007 7:41 PM, Ernest Turro wrote: >> On 19 Mar 2007, at 21:32, Duncan Murdoch wrote: >>> On 3/19/2007 5:23 PM, Ernest Turro wrote: >>>> Hi, >>>> I'm trying to register my native routine

Re: [Rd] Rinternals.h and undefined symbols

2007-03-19 Thread Ernest Turro
On 20 Mar 2007, at 00:50, Duncan Murdoch wrote: > On 3/19/2007 8:41 PM, Ernest Turro wrote: >> On 20 Mar 2007, at 00:18, Duncan Murdoch wrote: >>> On 3/19/2007 7:41 PM, Ernest Turro wrote: >>>> On 19 Mar 2007, at 21:32, Duncan Murdoch wrote: >>>>

Re: [Rd] Carriage returns and Sweave output

2007-03-20 Thread Ernest Turro
Here, I want to show the verbose output and print it onto the tex file using Sweave to give users a good idea of what happens. What I don't want is countless lines being printed because \r is being interpreted as \n ... Thanks, Ernest >>>> Ernest Turro wrote: >>>>>

[Rd] PKG_CFLAGS/CFLAGS and PKG_CXXFLAGS/CXXFLAGS

2007-03-20 Thread Ernest Turro
Why is it that R places CFLAGS after PKG_CFLAGS and not before when compiling a package (e.g. through R CMD build pkg)? This can be problematic if, for instance, you want to use -O3, but -O2 is in R_HOME/etc/Makeconf. If -O2 (in CFLAGS) appears after -O3 (in PKG_CFLAGS), you are left with w

Re: [Rd] Carriage returns and Sweave output

2007-03-20 Thread Ernest Turro
elpful. Thanks very much Douglas. Ernest > >> >>>> Ernest Turro wrote: >> >>>>> Dear all, >> >>>>> I have a code chunk in my Rnw file that, when executed, outputs >> >>>>> carriage return characters ('

Re: [Rd] PKG_CFLAGS/CFLAGS and PKG_CXXFLAGS/CXXFLAGS

2007-03-20 Thread Ernest Turro
On 20 Mar 2007, at 21:32, Kasper Daniel Hansen wrote: > > On Mar 20, 2007, at 7:58 PM, Ernest Turro wrote: > >> Why is it that R places CFLAGS after PKG_CFLAGS and not before when >> compiling a package (e.g. through R CMD build pkg)? This can be >> problematic if, fo

[Rd] R-2.5.0 and unlink/wildcards

2007-04-25 Thread Ernest Turro
It seems unlink doesn't work with wildcards in 2.5.0. I've tried R-2.5.0 under gnu/linux from source and the Mac binary from att research. Example: > dir() [1] "bgx.Rnw" "bgx.pdf" "run.1" > unlink("run.*",recursive=T) > dir() [1] "bgx.Rnw" "bgx.pdf" "run.1" > unlink("run.1",recursive=T) >

Re: [Rd] R-2.5.0 and unlink/wildcards

2007-04-25 Thread Ernest Turro
glob() should > work. So try > > unlink(Sys.glob("run.*"), recursive=TRUE) > > > On Wed, 25 Apr 2007, Ernest Turro wrote: > >> It seems unlink doesn't work with wildcards in 2.5.0. I've tried >> R-2.5.0 under gnu/linux from source and the Mac b

[Rd] path autocompletion in 2.5.0

2007-04-26 Thread Ernest Turro
Hi, R 2.5.0 isn't auto-completing paths properly as it used to. E.g. suppose I have: > dir("CEL/choe") [1] "chipC-rep1.CEL" "chipC-rep2.CEL" "chipC-rep3.CEL" "chipS-rep1.CEL" [5] "chipS-rep2.CEL" "chipS-rep3.CEL" Now if I do: ReadAffy("CEL/choe/ch # => ReadAffy("CEL/choe/chip ReadAffy("CEL/c

Re: [Rd] path autocompletion in 2.5.0

2007-04-26 Thread Ernest Turro
you posted such a comment about something > highlighted under USER-VISIBLE CHANGES as a configurable option. > > R-devel has an option to fine-tune this behaviour. > > > On Thu, 26 Apr 2007, Ernest Turro wrote: > >> Hi, >> >> R 2.5.0 isn't auto-completing paths pro

[Rd] file separator inconsistencies on windows?

2007-05-14 Thread Ernest Turro
tempdir() on windows returns the path using "\\" as file separator. But .Platform$file.sep returns "/". As a result, you get inconsistencies like: > file.path(tempdir(), "foo") [1] "C:\\WINDOWS\\Temp\\RtmpYEIXrb/foo" # Mix of \\ and / I'm not sure if this can cause problems but I thought I'

[Rd] Overriding optimisation flags

2007-09-13 Thread Ernest Turro
Dear all, If one specifies, say, "PKG_CXXFLAGS= -O3" in a Makevars file, it will not make a difference to how the code is compiled if -O2 is specified in $R_HOME/etc/Makeconf. This is because PKG_CXXFLAGS is prepended to the corresponding flags in $R_HOME/etc/Makeconf instead of being appe

[Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
Dear all, R on Macports relies on GCC 4.3 to build packages. I find that packages with shared objects that use C++ streams crash R if they're compiled using Macports' gcc43, but work fine if compiled in exactly the same way using Apple-supplied GCC 4.2. Has anyone here had the same issue/

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
On 30 Jul 2008, at 15:46, Simon Urbanek wrote: On Jul 30, 2008, at 9:45 , Ernest Turro wrote: Dear all, R on Macports relies on GCC 4.3 to build packages. I find that packages with shared objects that use C++ streams crash R if they're compiled using Macports' gcc43, but wo

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
he console, there is no indication that doing this may crash R (and this has never happened to me before). Certainly, the use of file streams (fstreams) should work just fine. Ernest Kjell On Jul 30, 2008, at 3:45 PM, Ernest Turro wrote: Dear all, R on Macports relies on GCC 4.3 to buil

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
On 30 Jul 2008, at 18:04, Simon Urbanek wrote: On Jul 30, 2008, at 12:32 , Ernest Turro wrote: On 30 Jul 2008, at 15:46, Simon Urbanek wrote: On Jul 30, 2008, at 9:45 , Ernest Turro wrote: Dear all, R on Macports relies on GCC 4.3 to build packages. I find that packages with shared

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
On 30 Jul 2008, at 17:58, Simon Urbanek wrote: On Jul 30, 2008, at 12:35 , Ernest Turro wrote: On 30 Jul 2008, at 15:18, Kjell Konis wrote: I found this in Writing R Extensions: "Using C++ iostreams, as in this example, is best avoided. There is no guarantee that the output

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
On 30 Jul 2008, at 19:23, Simon Urbanek wrote: On Jul 30, 2008, at 13:16 , Ernest Turro wrote: On 30 Jul 2008, at 18:04, Simon Urbanek wrote: On Jul 30, 2008, at 12:32 , Ernest Turro wrote: On 30 Jul 2008, at 15:46, Simon Urbanek wrote: On Jul 30, 2008, at 9:45 , Ernest Turro

Re: [Rd] R, Macports and C++ streams

2008-07-30 Thread Ernest Turro
On 30 Jul 2008, at 20:25, Simon Urbanek wrote: On Jul 30, 2008, at 15:13 , Ernest Turro wrote: On 30 Jul 2008, at 19:23, Simon Urbanek wrote: On Jul 30, 2008, at 13:16 , Ernest Turro wrote: On 30 Jul 2008, at 18:04, Simon Urbanek wrote: On Jul 30, 2008, at 12:32 , Ernest Turro

Re: [Rd] R, Macports and C++ streams

2008-07-31 Thread Ernest Turro
R --vanilla < foo.R # Don't crash: g++-4.2 -shared -fPIC foo.cc -o foo.so R --vanilla < foo.R Kjell On Jul 30, 2008, at 6:32 PM, Ernest Turro wrote: On 30 Jul 2008, at 15:46, Simon Urbanek wrote: On Jul 30, 2008, at 9:45 , Ernest Turro wrote: Dear all, R on Macports r

[Rd] Including data in package for use by C functions

2008-09-15 Thread Ernest Turro
How should one go about including data files for use by some C function in an R package? The data subdirectory is for additional data files the package makes available for loading from R, not C, and including the files in some other directory is no good because non- standard directories are