Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Rolf Turner
On 24/04/17 12:39, Duncan Murdoch wrote: On 23/04/2017 7:53 PM, Rolf Turner wrote: On 24/04/17 11:36, Duncan Murdoch wrote: On 23/04/2017 6:18 PM, Rolf Turner wrote: On 23/04/17 23:05, Duncan Murdoch wrote: Looks like extern void F77_NAME(mnnd)(double *, double *, int *, double *, double *

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Duncan Murdoch
On 23/04/2017 7:53 PM, Rolf Turner wrote: On 24/04/17 11:36, Duncan Murdoch wrote: On 23/04/2017 6:18 PM, Rolf Turner wrote: On 23/04/17 23:05, Duncan Murdoch wrote: Looks like extern void F77_NAME(mnnd)(double *, double *, int *, double *, double *); to me. One more (I hope it's the las

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Avraham Adler
On Sun, Apr 23, 2017 at 7:51 PM, Dirk Eddelbuettel wrote: > > On 24 April 2017 at 11:47, Rolf Turner wrote: > > And per Duncan's last (and his earlier emails) maybe you need to call from R > into C (for finer control over the interface) and only then call your Fortran > worker function. To hide i

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Rolf Turner
On 24/04/17 11:36, Duncan Murdoch wrote: On 23/04/2017 6:18 PM, Rolf Turner wrote: On 23/04/17 23:05, Duncan Murdoch wrote: Looks like extern void F77_NAME(mnnd)(double *, double *, int *, double *, double *); to me. One more (I hope it's the last!) question: One of my subroutines has an

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Dirk Eddelbuettel
On 24 April 2017 at 11:47, Rolf Turner wrote: | | On 24/04/17 11:22, Dirk Eddelbuettel wrote: | | > I would be surpised if init.c was Fortran. Anyway... | | It isn't of course. But it is the device used for "registering | routines" of all both flavours (i.e. both C and Fortran). And per Dunc

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Avraham Adler
On Sun, Apr 23, 2017 at 7:36 PM, Duncan Murdoch wrote: > On 23/04/2017 6:18 PM, Rolf Turner wrote: [SNIP] > This is important: *there is no way to pass a Fortran "LOGICAL" from R to > Fortran*. > > The issue is that different Fortran compilers store LOGICAL in different > ways. Some are equivale

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Rolf Turner
On 24/04/17 11:22, Dirk Eddelbuettel wrote: I would be surpised if init.c was Fortran. Anyway... It isn't of course. But it is the device used for "registering routines" of all both flavours (i.e. both C and Fortran). cheers, Rolf -- Technical Editor ANZJS Department of Statistics Univ

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Duncan Murdoch
On 23/04/2017 6:18 PM, Rolf Turner wrote: On 23/04/17 23:05, Duncan Murdoch wrote: Looks like extern void F77_NAME(mnnd)(double *, double *, int *, double *, double *); to me. One more (I hope it's the last!) question: One of my subroutines has an argument of type *logical*. There is no

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Dirk Eddelbuettel
On 24 April 2017 at 10:45, Rolf Turner wrote: | On 24/04/17 10:31, Dirk Eddelbuettel wrote: | > On 24 April 2017 at 10:18, Rolf Turner wrote: | > | One more (I hope it's the last!) question: | > | | > | One of my subroutines has an argument of type *logical*. There is no | > | logical type in C.

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Rolf Turner
On 24/04/17 10:31, Dirk Eddelbuettel wrote: On 24 April 2017 at 10:18, Rolf Turner wrote: | One more (I hope it's the last!) question: | | One of my subroutines has an argument of type *logical*. There is no | logical type in C. So, since I am perforce using C-speak, I cannot | change "void

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Dirk Eddelbuettel
On 24 April 2017 at 10:18, Rolf Turner wrote: | One more (I hope it's the last!) question: | | One of my subroutines has an argument of type *logical*. There is no | logical type in C. So, since I am perforce using C-speak, I cannot | change "void *" to "void logical". | | I have a (very vag

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Rolf Turner
On 23/04/17 23:05, Duncan Murdoch wrote: Looks like extern void F77_NAME(mnnd)(double *, double *, int *, double *, double *); to me. One more (I hope it's the last!) question: One of my subroutines has an argument of type *logical*. There is no logical type in C. So, since I am perforc

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Duncan Murdoch
On 23/04/2017 6:38 AM, Rolf Turner wrote: On 23/04/17 21:57, Duncan Murdoch wrote: On 22/04/2017 5:25 PM, Rolf Turner wrote: (1) I found that having an R function with the same name as that of a routine (Fortran subroutine in this case) that it called, causes all sorts of chaos. I had a fu

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Rolf Turner
On 23/04/17 21:57, Duncan Murdoch wrote: On 22/04/2017 5:25 PM, Rolf Turner wrote: (1) I found that having an R function with the same name as that of a routine (Fortran subroutine in this case) that it called, causes all sorts of chaos. I had a function "binsrt" that called a Fortran subro

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-23 Thread Duncan Murdoch
On 22/04/2017 5:25 PM, Rolf Turner wrote: I have, like many others it would appear, been struggling with the new-ish convention of requiring --- or quasi-requiring --- that "routines" be "registered" and the warning generated by R CMD check to the effect: Found no calls to: 'R_registerRoutines

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-22 Thread Rolf Turner
Thanks for trying, but your example blows me away completely. cheers, Rolf On 23/04/17 14:47, Avraham Adler wrote: On Sat, Apr 22, 2017 at 6:13 PM, Rolf Turner wrote: The foregoing "official" way would seem to apply to functions called by ".Call" (which I never use; it is way over my head)

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-22 Thread Avraham Adler
On Sat, Apr 22, 2017 at 6:13 PM, Rolf Turner wrote: > > The foregoing "official" way would seem to apply to functions called by > ".Call" (which I never use; it is way over my head). What about functions > called by ".Fortran()" or ".C()"? > >> | (b) For the sake of completeness, how *does* o

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-22 Thread Rolf Turner
On 23/04/17 09:44, Dirk Eddelbuettel wrote: On 23 April 2017 at 09:25, Rolf Turner wrote: | However I found a posting by Ege Rubak on this topic which sent me by a | slightly roundabout route to a posting by Dirk Eddelbuttel There is a transcribed Umlaut in there: Eddelbuettel (ie 'ue' no

Re: [R-pkg-devel] R_registerRoutines, etc.

2017-04-22 Thread Dirk Eddelbuettel
On 23 April 2017 at 09:25, Rolf Turner wrote: | I have, like many others it would appear, been struggling with | the new-ish convention of requiring --- or quasi-requiring --- that | "routines" be "registered" and the warning generated by R CMD check to | the effect: | | > Found no calls to: 'R

[R-pkg-devel] R_registerRoutines, etc.

2017-04-22 Thread Rolf Turner
I have, like many others it would appear, been struggling with the new-ish convention of requiring --- or quasi-requiring --- that "routines" be "registered" and the warning generated by R CMD check to the effect: Found no calls to: 'R_registerRoutines', 'R_useDynamicSymbols' It is good pra