Re: [Rd] Linking With External Lapack: Segfault

2008-08-25 Thread Imanpreet
Hello Brian,

   I have been trying several options to configure and providing
"-lcblas" was just one of them. I added echos for the following variable
towards the configure. And with all of them I am getting the following


use_lapack is  unset
with lapack is **
Use_External_lapack_true  #
Lapack_libs  -L$(R_HOME)/lib$(R_ARCH) -lRlapack

I tried to overwrite the libRlapack.so in  $(R_HOME)/lib and lapack.so in
$(R_HOME)/modules/ both before and after doing make, *again, *but in either
case I am getting the same SIGSEGV as mentioned earlier.

FYI, we are using an in house developed lapack for our specific platform.
Could there be any specific issues in using the same?


Regards,

   Imanpreet Singh Arora

On Fri, Aug 22, 2008 at 8:39 PM, Prof Brian Ripley <[EMAIL PROTECTED]>wrote:

> On Fri, 22 Aug 2008, Imanpreet wrote:
>
>  Hello All,
>>
>> I have been trying to figure out on linking R with an external
>> lapack. Even though the R-admin recommends against doing so, our
>> requirements force us to link it to an external lapack. I am running
>> configure with the following parameter.
>>
>> *./configure --with-lapack="-L/usr/lib -llapack -lcblas" *
>>
>>
>> The above seems to be having NO effect. However, later I tried replacing
>> libRlapack, libblas and lapack.so from $(R_HOME)/lib and
>> $(R_HOME)/modules/
>> with external lapack. Firstly, is this good?
>>
>
> No, and the cause of your failure below.
>
> Why do you think '-lcblas' is correct? Please do follow the manual -- if
> you still have trouble when you do it is reasonable to ask for help, but not
> otherwise.
>
>  Secondly, after doing the above. When I do.
>>
>> When I do
>>
>>> example(svd)
>>>
>>
>> The following is the error that I am getting:
>>
>> *Error: segfault from C stack overflow*
>>
>> On debugging the error was in La_Init() at Line 61
>>
>> *if(!ptr->svd)*
>>
>> I am getting a SIGSEGV over here.
>>
>> Could anybody provide an pointers or and tips on how to link R with an
>> external lapack? And also possibly the cause of the above issues?
>>
>
> Follow the manual -- its instructions do work (they are used on Mac OS X,
> and will also work on Linux and Solaris).
>
>
>>
>> TIA.
>>
>> Regards,
>>
>>
>> --
>> Imanpreet Singh Arora
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-devel@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>
> --
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  
> http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>



Regards,

Imanpreet Singh Arora
IBM - System And Technology Group.

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Linking With External Lapack: Segfault

2008-08-25 Thread Imanpreet
Hello Brian,

  The following output was when I run .configure with no option.
When I run it with --with-lapack = " *-L/usr/lib -llapack" *option the
following is the output of the "echos" towards the EOF

use_lapack is  unset
with lapack is  *-L/usr/lib -llapack #Only change.
*Use_External_lapack_true  #
Lapack_libs  -L$(R_HOME)/lib$(R_ARCH) -lRlapack* # this is still the same.*

Any possible pointers or cause for the above ?

Regards,

On Mon, Aug 25, 2008 at 5:00 PM, Imanpreet <[EMAIL PROTECTED]> wrote:

>
> Hello Brian,
>
>I have been trying several options to configure and providing
> "-lcblas" was just one of them. I added echos for the following variable
> towards the configure. And with all of them I am getting the following
>
>
> use_lapack is  unset
> with lapack is **
> Use_External_lapack_true  #
> Lapack_libs  -L$(R_HOME)/lib$(R_ARCH) -lRlapack
>
> I tried to overwrite the libRlapack.so in  $(R_HOME)/lib and lapack.so in
> $(R_HOME)/modules/ both before and after doing make, *again, *but in
> either case I am getting the same SIGSEGV as mentioned earlier.
>
> FYI, we are using an in house developed lapack for our specific platform.
> Could there be any specific issues in using the same?
>
>
> Regards,
>
>Imanpreet Singh Arora
>
>
> On Fri, Aug 22, 2008 at 8:39 PM, Prof Brian Ripley <[EMAIL PROTECTED]>wrote:
>
>> On Fri, 22 Aug 2008, Imanpreet wrote:
>>
>>  Hello All,
>>>
>>> I have been trying to figure out on linking R with an external
>>> lapack. Even though the R-admin recommends against doing so, our
>>> requirements force us to link it to an external lapack. I am running
>>> configure with the following parameter.
>>>
>>> *./configure --with-lapack="-L/usr/lib -llapack -lcblas" *
>>>
>>>
>>> The above seems to be having NO effect. However, later I tried replacing
>>> libRlapack, libblas and lapack.so from $(R_HOME)/lib and
>>> $(R_HOME)/modules/
>>> with external lapack. Firstly, is this good?
>>>
>>
>> No, and the cause of your failure below.
>>
>> Why do you think '-lcblas' is correct? Please do follow the manual -- if
>> you still have trouble when you do it is reasonable to ask for help, but not
>> otherwise.
>>
>>  Secondly, after doing the above. When I do.
>>>
>>> When I do
>>>
 example(svd)

>>>
>>> The following is the error that I am getting:
>>>
>>> *Error: segfault from C stack overflow*
>>>
>>> On debugging the error was in La_Init() at Line 61
>>>
>>> *if(!ptr->svd)*
>>>
>>> I am getting a SIGSEGV over here.
>>>
>>> Could anybody provide an pointers or and tips on how to link R with an
>>> external lapack? And also possibly the cause of the above issues?
>>>
>>
>> Follow the manual -- its instructions do work (they are used on Mac OS X,
>> and will also work on Linux and Solaris).
>>
>>
>>>
>>> TIA.
>>>
>>> Regards,
>>>
>>>
>>> --
>>> Imanpreet Singh Arora
>>>
>>>[[alternative HTML version deleted]]
>>>
>>> __
>>> R-devel@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>>
>>>
>> --
>> Brian D. Ripley,  [EMAIL PROTECTED]
>> Professor of Applied Statistics,  
>> http://www.stats.ox.ac.uk/~ripley/
>> University of Oxford, Tel:  +44 1865 272861 (self)
>> 1 South Parks Road, +44 1865 272866 (PA)
>> Oxford OX1 3TG, UKFax:  +44 1865 272595
>>
>
>
>
> Regards,
>
> Imanpreet Singh Arora
> IBM - System And Technology Group.
>



-- 
Imanpreet Singh Arora
IBM - System and Technology Group

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] problem running dll in R

2008-08-25 Thread Duncan Murdoch

On 23/08/2008 8:44 PM, rcoder wrote:

Hi everyone,

I've created a dll for a fortran subroutine, and when I call the subroutine
in R (via a wrapped function) a standard program shutdown windows error
prompt immediately pops up: the program has encountered a problem and needs
to be shut down... send message / don't send message to MS... etc.

When I click "Don't send", the R consol does not then shut down, and appears
to continue to execute, and task manager does not indicate "not responding".
The problem is the execution takes too long, and I think the program is just
hanging rather than executing. I have tested with different fortran code,
and the same thing happens, so I don't think it is anything to do with that
side of things.

I created fortran code in a text editor, compiled using Plato3 IDE, then
converted the file into a dll using gFortran. I place the dll in the R
directory and it load in the console. The problem seems to occur when
defining the data types in R, for the variables in the fortran routine.

I was just wondering if anyone has experienced anything similar when trying
to call fortran subroutines in R?


I haven't seen that, and haven't used that particular compiler, but it 
has the symptoms of a mismatch in calling conventions.  Does your 
compiler pass arguments in registers?  R uses what Windows calls the 
cdecl calling convention in external calls.


Some old advice on using non-standard compilers is available here:

http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs

I haven't updated it in a few years, but I think it is still current.

Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] R CMD check problem

2008-08-25 Thread Duncan Murdoch

On 22/08/2008 11:21 AM, Giles Hooker wrote:

I have a query after finding an error running Rtools on a Windows machine.

I am trying to build an update to the R fda library using Rtools27 under 
Windows XP Pro. This is the current fda library on RForge:


http://r-forge.r-project.org/projects/fda

Following R CMD build,  R CMD check produces the following error in 
00Install.out:


installing R.css in F:/work/RForge/fda.Rcheck

make: *** [Rcode0] Error 53
make[2]: *** [zzzfirst] Error 53
make[1]: *** [all] Error 2
make: *** [pkg-fda] Error 2
*** Installation of fda failed ***


I believe this says that some command involved in making the Rcode0 
target returned error code 53.


Removing 'F:/work/RForge/fda.Rcheck/fda'


Any idea what the problem could be? Note the same procedure runs 
successfully on two other windows machines. For reference, the PATH 
environment variable is:


C:\Program Files\SSH Communications Security\SSH Secure 
Shell;C:\cygwin\bin;C:\Program Files\R\R-2.7.1\bin


The PATH System variable is:

c:\Rtools\bin;c:\Rtools\perl\bin;c:\Rtools\MinGW\bin;C:\watcom-1.3\binnt;C:\watcom-1.3\binw;
%GTK_BASEPATH%\bin;C:\Program Files\MiKTeX 
2.5\miktex\bin;%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;c:\program 
files\ati technologies\ati control panel;C:\Program 
Files\MATLAB\R2006a\bin\win32;C:\Program Files\ggobi;C:\Program 
Files\R\R-2.7.1\bin


If the first one is the active PATH, that's your problem:  someone has 
overridden the default PATH, and the Rtools aren't on it.  (You see the 
active PATH in the CMD shell by typing PATH at the command line.  It 
should look like your system PATH, but with the %systemroot% etc macros 
expanded.)


Duncan Murdoch


Many thanks,

Giles



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] problem running dll in R

2008-08-25 Thread rcoder

Hi Duncan,

Thanks for your reply. Would you know of a code + compiler combination that
works in R, so I can get a feel for the process?

Thanks,

rcoder



Duncan Murdoch-2 wrote:
> 
> On 23/08/2008 8:44 PM, rcoder wrote:
>> Hi everyone,
>> 
>> I've created a dll for a fortran subroutine, and when I call the
>> subroutine
>> in R (via a wrapped function) a standard program shutdown windows error
>> prompt immediately pops up: the program has encountered a problem and
>> needs
>> to be shut down... send message / don't send message to MS... etc.
>> 
>> When I click "Don't send", the R consol does not then shut down, and
>> appears
>> to continue to execute, and task manager does not indicate "not
>> responding".
>> The problem is the execution takes too long, and I think the program is
>> just
>> hanging rather than executing. I have tested with different fortran code,
>> and the same thing happens, so I don't think it is anything to do with
>> that
>> side of things.
>> 
>> I created fortran code in a text editor, compiled using Plato3 IDE, then
>> converted the file into a dll using gFortran. I place the dll in the R
>> directory and it load in the console. The problem seems to occur when
>> defining the data types in R, for the variables in the fortran routine.
>> 
>> I was just wondering if anyone has experienced anything similar when
>> trying
>> to call fortran subroutines in R?
> 
> I haven't seen that, and haven't used that particular compiler, but it 
> has the symptoms of a mismatch in calling conventions.  Does your 
> compiler pass arguments in registers?  R uses what Windows calls the 
> cdecl calling convention in external calls.
> 
> Some old advice on using non-standard compilers is available here:
> 
> http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs
> 
> I haven't updated it in a few years, but I think it is still current.
> 
> Duncan Murdoch
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 

-- 
View this message in context: 
http://www.nabble.com/problem-running-dll-in-R-tp19126733p19146333.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] problem running dll in R

2008-08-25 Thread Duncan Murdoch

On 8/25/2008 11:45 AM, rcoder wrote:

Hi Duncan,

Thanks for your reply. Would you know of a code + compiler combination that
works in R, so I can get a feel for the process?


Sure, the MinGW compilers in the Rtools should be fine.  You get them 
from www.murdoch-sutherland.com/Rtools.  With those, building a DLL is 
simply


R CMD SHLIB source.f

Duncan Murdoch



Thanks,

rcoder



Duncan Murdoch-2 wrote:


On 23/08/2008 8:44 PM, rcoder wrote:

Hi everyone,

I've created a dll for a fortran subroutine, and when I call the
subroutine
in R (via a wrapped function) a standard program shutdown windows error
prompt immediately pops up: the program has encountered a problem and
needs
to be shut down... send message / don't send message to MS... etc.

When I click "Don't send", the R consol does not then shut down, and
appears
to continue to execute, and task manager does not indicate "not
responding".
The problem is the execution takes too long, and I think the program is
just
hanging rather than executing. I have tested with different fortran code,
and the same thing happens, so I don't think it is anything to do with
that
side of things.

I created fortran code in a text editor, compiled using Plato3 IDE, then
converted the file into a dll using gFortran. I place the dll in the R
directory and it load in the console. The problem seems to occur when
defining the data types in R, for the variables in the fortran routine.

I was just wondering if anyone has experienced anything similar when
trying
to call fortran subroutines in R?


I haven't seen that, and haven't used that particular compiler, but it 
has the symptoms of a mismatch in calling conventions.  Does your 
compiler pass arguments in registers?  R uses what Windows calls the 
cdecl calling convention in external calls.


Some old advice on using non-standard compilers is available here:

http://www.stats.uwo.ca/faculty/murdoch/software/compilingDLLs

I haven't updated it in a few years, but I think it is still current.

Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel






__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] name conflicts

2008-08-25 Thread Max Kuhn
Everyone,

I've got code in my package that uses LogitBoost from the caTools
package. caTools does not have a namespace.

My package also uses loads RWeka, which has a namespace, and also has
a function called LogitBoost.

After loading both packages, how can I be specific about running the
version from caTools (since caTools:::LogitBoost won't work)?

Thanks,

Max

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] name conflicts

2008-08-25 Thread Gabor Grothendieck
Use two colons, not three.

On Mon, Aug 25, 2008 at 3:05 PM, Max Kuhn <[EMAIL PROTECTED]> wrote:
> Everyone,
>
> I've got code in my package that uses LogitBoost from the caTools
> package. caTools does not have a namespace.
>
> My package also uses loads RWeka, which has a namespace, and also has
> a function called LogitBoost.
>
> After loading both packages, how can I be specific about running the
> version from caTools (since caTools:::LogitBoost won't work)?
>
> Thanks,
>
> Max
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] name conflicts

2008-08-25 Thread Duncan Murdoch

On 8/25/2008 3:05 PM, Max Kuhn wrote:

Everyone,

I've got code in my package that uses LogitBoost from the caTools
package. caTools does not have a namespace.

My package also uses loads RWeka, which has a namespace, and also has
a function called LogitBoost.

After loading both packages, how can I be specific about running the
version from caTools (since caTools:::LogitBoost won't work)?


It's not easy.  Best would be to convince caTools to add a NAMESPACE.

But as a workaround:

library(caTools)
caToolsEnv <- as.environment("package:caTools")
LogitBoost <- caToolsEnv$LogitBoost

Note that there is no guarantee that LogitBoost will actually work. 
Because caTools doesn't have a NAMESPACE, there is a risk of other name 
clashes causing LogitBoost to behave unpredictably.


Duncan Murdoch

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] name conflicts

2008-08-25 Thread Henrique Dallazuanna
Try this also:

LogitBoost <- get("LogitBoost", envir =
as.environment("package:caTools"), mode = "function")

On Mon, Aug 25, 2008 at 4:05 PM, Max Kuhn <[EMAIL PROTECTED]> wrote:
> Everyone,
>
> I've got code in my package that uses LogitBoost from the caTools
> package. caTools does not have a namespace.
>
> My package also uses loads RWeka, which has a namespace, and also has
> a function called LogitBoost.
>
> After loading both packages, how can I be specific about running the
> version from caTools (since caTools:::LogitBoost won't work)?
>
> Thanks,
>
> Max
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] name conflicts

2008-08-25 Thread Duncan Murdoch

On 8/25/2008 3:19 PM, Gabor Grothendieck wrote:

Use two colons, not three.


Right, I forget about that possibility.  Still, my warnings about the 
fragility of using a package without a NAMESPACE apply here too.


Duncan Murdoch



On Mon, Aug 25, 2008 at 3:05 PM, Max Kuhn <[EMAIL PROTECTED]> wrote:

Everyone,

I've got code in my package that uses LogitBoost from the caTools
package. caTools does not have a namespace.

My package also uses loads RWeka, which has a namespace, and also has
a function called LogitBoost.

After loading both packages, how can I be specific about running the
version from caTools (since caTools:::LogitBoost won't work)?

Thanks,

Max

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel



__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] na.action does not return na.action element of lm object

2008-08-25 Thread Andrew Redd
I'm not sure if this is the official behavior but I would expect the
na.action function applied to a lm object to return the na.action.
Here is what I mean.

> x<-0:10
> y<-x+rnorm(10)
Warning message:
In x + rnorm(10) :
  longer object length is not a multiple of shorter object length
> y[5]<-NA
> m<-lm(y~x)
> m$na.action
5
5
attr(,"class")
[1] "omit"
> na.action(m)
NULL

I would expect na.action(m) to return m$na.action.  This is simple
enough to fix with
na.action.lm<-function(object,...)object$na.action
but I would expect that this would already be included in the base.
Is there a reason that it is not?  I did a search through the archives
but did not turn up anything relevant.

Thanks,
Andrew Redd

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] ifelse

2008-08-25 Thread Tim Hesterberg
Others have commented on why this holds.

There is an alternative, 'ifelse1', part of the splus2R package, that
does what you'd like here.

Tim Hesterberg

>I find it slightly surprising, that
>   ifelse(TRUE, character(0), "")
>returns NA instead of character(0). 
>
>-- 
>Heikki Kaskelma

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] bug in package chron (PR#12599)

2008-08-25 Thread zengzhenxing
Full_Name: Zeng, zhenxing
Version: 2.7.1 (2008-06-23)
OS: windows XP
Submission from: (NULL) (158.182.1.30)


Dear Author

I have run into a trouble in using chron package
The data frame: a
   date time_fut expiry_day   bid   ask trade_day
1 2004-09-01 09:45:002004-10 12860 1288938
2 2004-09-01 09:45:012004-10 12885 1289038
3 2004-09-01 09:45:042004-10 12883 1288738
4 2004-09-01 09:45:052004-10 12878 1288638
5 2004-09-01 09:45:062004-10 12881 1288738
6 2004-09-01 09:45:082004-10 12881 1288238
7 2004-09-01 09:45:112004-10 12881 1288438
8 2004-09-01 09:45:122004-10 12882 1288438
9 2004-09-01 09:45:142004-10 12882 1288338

I use the package chron

a$time_fut<-times(a$time_fut)
a$date<-as.Date(a$date)
a$expiry_day<-as.character(a$expiry_day)

any(am$time_fut[2]==(am$time_fut[1]+times("00:00:01")))
the answer: True
 any(a$time_fut[5]==(a$time_fut[4]+times("00:00:01")))
[1] TRUE
any(am$time_fut[4]==(am$time_fut[3]+times("00:00:01")))
the answer: False
But, the right answer should be true

I don't know why, I am using the R version: 2.7.1
attached please find the data.

Thank you

Best wishes

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel