Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

2017-12-19 Thread Duncan Murdoch

On 19/12/2017 5:20 PM, Georgi Boshnakov wrote:

Sure, but \dontrun's function is to prevent the R tools from running the 
enclosed code.

How it is rendered is a completely separate matter.  The code in \dontrun is  
not required to be executable (or even valid R code), so surely there should be 
some sort of visual clue in the rendered page. I don't argue whether it should 
be the one shown now or should be left entirely to the package author, although 
the current one seems reasonable to me.


What you say in no way contradicts what Hadley said.  He's complaining 
about your earlier message blaming roxygen for this.  He's right, this 
isn't a roxygen issue, it's a general R help page issue.  However:


I'm finding it quite amazing that this thread has gone on as long as it 
has.  I think you suggested that package authors should add comments to 
their code explaining why they asked not to run some lines.  That's such 
a sensible suggestion that it should have ended the thread.


Duncan Murdoch


Georgi


-Original Message-
From: Hadley Wickham [mailto:h.wick...@gmail.com]
Sent: 19 December 2017 19:22
To: Georgi Boshnakov
Cc: Tomas Hudik; r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings


This actually is not about Rd format. Indeed, you are using   'roxygen' syntax.


This is unrelated to roxygen. \dontrun{} is Rd formatting.

Hadley



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


Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

2017-12-19 Thread Georgi Boshnakov
Sure, but \dontrun's function is to prevent the R tools from running the 
enclosed code.

How it is rendered is a completely separate matter.  The code in \dontrun is  
not required to be executable (or even valid R code), so surely there should be 
some sort of visual clue in the rendered page. I don't argue whether it should 
be the one shown now or should be left entirely to the package author, although 
the current one seems reasonable to me.

Georgi


-Original Message-
From: Hadley Wickham [mailto:h.wick...@gmail.com] 
Sent: 19 December 2017 19:22
To: Georgi Boshnakov
Cc: Tomas Hudik; r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

> This actually is not about Rd format. Indeed, you are using   'roxygen' 
> syntax.

This is unrelated to roxygen. \dontrun{} is Rd formatting.

Hadley

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


Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

2017-12-19 Thread Hadley Wickham
> This actually is not about Rd format. Indeed, you are using   'roxygen' 
> syntax.

This is unrelated to roxygen. \dontrun{} is Rd formatting.

Hadley

-- 
http://hadley.nz

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


Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

2017-12-19 Thread Georgi Boshnakov
… and my point was that it is not a matter of syntax, but that the user would 
better be alerted.

A user would be more confused and even irritated if they run an example and get 
surprises (such as having to wait a long time) or not getting any wiser.

The example you cite falls into the category of ‘template examples’  - it is 
not really meant to be run as is.
You almost certainly will never encounter message 12345, for example.   In 
fact, it would probably give error.  This is a nice illustration of the 
usefulness of ‘Not run’ to give a sort of warning.
I bet that the package you have taken it from contains similar examples in 
other places, so a user will become aware of this.


Merry Christmas,
Georgi



From: Tomas Hudik [mailto:xhu...@gmail.com]
Sent: 19 December 2017 16:02
To: Georgi Boshnakov
Cc: r-package-devel@r-project.org
Subject: Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

Yes, I used oxygen. My point was that a majority of users is not familiar 
Rd/oxygen and if somebody sees something like:

```
Examples

## Not run:
modify_message(12345, add_labels='label_1')
modify_message(12345, remove_labels='label_1')
#add and remove at the same time
modify_message(12345, add_labels='label_2', remove_labels='label_1')

## End(Not run)
```
he will be pretty much confused and will not get that it is because of a 
special example that couldnt run for any reason.
Whether example run during package compilation might be important for package 
creator but not so much for a regular user.

Therefore I think the question is whether a standard user needs to know whether 
some code in help page run during the package compilation.

my 2c, Tomas


On Mon, Dec 18, 2017 at 8:07 PM, Georgi Boshnakov 
> 
wrote:
Hi,

This actually is not about Rd format. Indeed, you are using   'roxygen' syntax.

Examples are not run when there is a good reason (long time, internet 
connection required, specific local resources). This often means that the user 
needs to be made aware that something is not as straightforward as usual.

A better question would probably be "Is there a better way to alert the user 
that the example is somehow special?" Maybe, but it is difficult to beat "Not 
run" for brevity and native English speakers would probably have come forward 
with a better replacement.

Also, adding a note (in a comment before the example)  as to way an example is 
not run can be of benefit to both the user and the package author. Even if it 
is obvious at the time of writing, it may not be so months or years later.

Kind regards,
Georgi Boshnakov

-Original Message-
From: R-package-devel 
[mailto:r-package-devel-boun...@r-project.org]
 On Behalf Of Tomas Hudik
Sent: 18 December 2017 13:38
To: r-package-devel@r-project.org
Subject: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

Hi there,

If I write a function with documentation (notice `\dontrun` section)

#' Print a string.
#'
#' @examples
#' \dontrun{
#' str_length(letters)
#'}
print_str <- function(str) {
  print(string)
}

`roxygenize()` will create proper Rd file, however, `R CMD check .` will
generate:
```
...
## Not run:
str_length(letters)
## End(Not run)
```

If a person not familiar with Rd (majority of people) see such example, I do 
think he will be confused.
Question - wouldnt be good to remove `## NOT run` strings by default ( 
https://github.com/wch/r-source/blob/af7f52f70101960861e5d995d3a4be
c010bc89e6/src/library/tools/R/Rd2latex.R#L238
)

E.g. see https://cran.r-project.org/web/packages/gmailr/gmailr.pdf - and go 
through example sections. There is not many people who would know what those 
cryptic `## Not Run` strings mean.


thanks, Tomas
[[alternative HTML version deleted]]

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


[[alternative HTML version deleted]]

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

Re: [R-pkg-devel] nparACT package: "working directory was changed to...resetting"

2017-12-19 Thread Duncan Murdoch

On 19/12/2017 10:27 AM, Blume Christine wrote:

Hi Duncan,

Thanks a lot! Good to see that you had a similar idea, I did just 
that...in my example it looks like this, however, that does not help, 
i.e. that is the code that is associated with the warning…


data(sleepstudy)

wd <- getwd()

name <- "sleepstudy_example"

newdir <- paste(wd,name, sep="/")

if (dir.exists(newdir)){

setwd(newdir)

write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, 
col.names = FALSE)


r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

} else {

dir.create(newdir)


This is probably a bad idea.  You're creating a subdirectory in the 
user's current working directory; you might not have file system 
permission to do that, and you probably don't have authorization from 
the user to do that.  I don't remember if CRAN checks for this, but I 
wouldn't be surprised if they do, or will in the future.


Since you need to write a file, you want to be sure that it's going to a 
place that is harmless and will succeed.  That's what tempdir() is for. 
At the end of your session it will be cleaned up, so you won't leave 
behind junk for the user.


So I would set newdir using

newdir <- file.path(tempdir(), name)

The other change I would make is to unconditionally use 
dir.create(newdir, showWarnings = FALSE).  You can be almost 100% sure 
that any error creating newdir will be just that it already exists, and 
since it's just somewhere in tempdir(), you don't really care about 
that.  This will simplify your example quite a bit.


Putting these two and my earlier suggestion together, your example becomes

data(sleepstudy)

name <- "sleepstudy_example"

newdir <- file.path(tempdir(),name)

dir.create(newdir, showWarnings = FALSE)

olddir <- setwd(newdir)

write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, 
col.names = FALSE)


r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

setwd(olddir)

Duncan Murdoch





setwd(newdir)

write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, 
col.names = FALSE)


r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

}

setwd(wd)

}

Best,

Christine

-Ursprüngliche Nachricht-
Von: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Gesendet: Dienstag, 19. Dezember 2017 16:19
An: Blume Christine; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] nparACT package: "working directory was 
changed to...resetting"


On 19/12/2017 9:42 AM, Blume Christine wrote:

 > Dear Community,

 >

 >

 >

 > For Fedora my package now gives a warning message when running the 
example:


 >

 >

 >

 > "Warning: working directory was changed to 
'/data/gannet/ripley/R/packages/tests-clang/nparACT.Rcheck/sleepstudy_example', 
resetting"


 >

 >

 >

 > I do not really know how to approach/solve this, what has recently 
been changed in R devel so this error message started appearing?


Previously you were allowed to change directory in an example.  Now 
you're not.  This makes sense:  the user might not want to change the 
working directory.


To fix this, just save the old directory, and restore it at the end of 
your example.  For example,


    olddir <- setwd(tempdir())

    # Run the rest of the example code here

    setwd(olddir)

Duncan Murdoch

 >

 >

 >

 > The full message can be seen here:

 > https://CRAN.R-project.org/web/checks/check_results_nparACT.html

 >

 >

 >

 > Any help is appreciated and rewarded with gratitude.

 >

 >

 >

 > Best,

 >

 >

 >

 > Christine

 >

 >

 >

 >     [[alternative HTML version deleted]]

 >

 > __

R-package-devel@r-project.org 

mailing list


https://stat.ethz.ch/mailman/listinfo/r-package-devel


 >



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

Re: [R-pkg-devel] nparACT package: "working directory was changed to...resetting"

2017-12-19 Thread Blume Christine
Actually, the report I received refers to the old 0.7 version…for whatever 
reason? The version I had submitted  was 0.8 in which I had corrected this. 
Well, let’s see…



Another issue seems to be that the text file the example is supposed to read in 
is not read (properly) using Debian:



Warning in is.na(data$activity) :

 is.na() applied to non-(list or vector) of type 'NULL'

Error in 1:a : argument of length 0



I am reading in a text file with a numeric column (data$activity) and date or 
datetime (which is then converted using as.POSIXct. Subsequently, I check if 
there are NAs…



Any ideas what might be happening here?



Best,

Christine





-Ursprüngliche Nachricht-
Von: Iñaki Úcar [mailto:i.uca...@gmail.com]
Gesendet: Dienstag, 19. Dezember 2017 16:48
An: Blume Christine
Cc: r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] nparACT package: "working directory was changed 
to...resetting"



2017-12-19 16:27 GMT+01:00 Blume Christine 
>:

> Hi Duncan,

>

> Thanks a lot! Good to see that you had a similar idea, I did just that...in 
> my example it looks like this, however, that does not help, i.e. that is the 
> code that is associated with the warning…

>

> data(sleepstudy)

>

> wd <- getwd()

>

> name <- "sleepstudy_example"

>

> newdir <- paste(wd,name, sep="/")

>

> if (dir.exists(newdir)){

>

> setwd(newdir)

>

> write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = 
> FALSE)

>

> r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

>

> } else {

>

> dir.create(newdir)

>

> setwd(newdir)

>

> write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = 
> FALSE)

>

> r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

>

> }

>

> setwd(wd)

>

> }



I see:



$ wget https://cran.r-project.org/src/contrib/nparACT_0.7.tar.gz

$ tar xf nparACT_0.7.tar.gz

$ grep -r setwd nparACT

nparACT/man/nparACT_flex_loop.Rd:setwd(newdir)

nparACT/man/nparACT_base_loop.Rd:setwd(newdir)



so two examples don't restore the wd as Duncan was pointing out.



Iñaki



>

>

>

> Best,

>

> Christine

>

>

[[alternative HTML version deleted]]

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

Re: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings

2017-12-19 Thread Tomas Hudik
Yes, I used oxygen. My point was that a majority of users is not familiar
Rd/oxygen and if somebody sees something like:

```
Examples

## Not run:
modify_message(12345, add_labels='label_1')
modify_message(12345, remove_labels='label_1')
#add and remove at the same time
modify_message(12345, add_labels='label_2', remove_labels='label_1')

## End(Not run)
```

he will be pretty much confused and will not get that it is because of a
special example that couldnt run for any reason.
Whether example run during package compilation might be important for
package creator but not so much for a regular user.

Therefore I think the question is whether a standard user needs to know
whether some code in help page run during the package compilation.


my 2c, Tomas


On Mon, Dec 18, 2017 at 8:07 PM, Georgi Boshnakov <
georgi.boshna...@manchester.ac.uk> wrote:

> Hi,
>
> This actually is not about Rd format. Indeed, you are using   'roxygen'
> syntax.
>
> Examples are not run when there is a good reason (long time, internet
> connection required, specific local resources). This often means that the
> user needs to be made aware that something is not as straightforward as
> usual.
>
> A better question would probably be "Is there a better way to alert the
> user that the example is somehow special?" Maybe, but it is difficult to
> beat "Not run" for brevity and native English speakers would probably have
> come forward with a better replacement.
>
> Also, adding a note (in a comment before the example)  as to way an
> example is not run can be of benefit to both the user and the package
> author. Even if it is obvious at the time of writing, it may not be so
> months or years later.
>
> Kind regards,
> Georgi Boshnakov
>
> -Original Message-
> From: R-package-devel [mailto:r-package-devel-boun...@r-project.org] On
> Behalf Of Tomas Hudik
> Sent: 18 December 2017 13:38
> To: r-package-devel@r-project.org
> Subject: [R-pkg-devel] Fwd: R CMD check and strange ## Not run strings
>
> Hi there,
>
> If I write a function with documentation (notice `\dontrun` section)
>
> #' Print a string.
> #'
> #' @examples
> #' \dontrun{
> #' str_length(letters)
> #'}
> print_str <- function(str) {
>   print(string)
> }
>
> `roxygenize()` will create proper Rd file, however, `R CMD check .` will
> generate:
> ```
> ...
> ## Not run:
> str_length(letters)
> ## End(Not run)
> ```
>
> If a person not familiar with Rd (majority of people) see such example, I
> do think he will be confused.
> Question - wouldnt be good to remove `## NOT run` strings by default (
> https://github.com/wch/r-source/blob/af7f52f70101960861e5d995d3a4be
> c010bc89e6/src/library/tools/R/Rd2latex.R#L238
> )
>
> E.g. see https://cran.r-project.org/web/packages/gmailr/gmailr.pdf - and
> go through example sections. There is not many people who would know what
> those cryptic `## Not Run` strings mean.
>
>
> thanks, Tomas
>
> [[alternative HTML version deleted]]
>
> __
> R-package-devel@r-project.org mailing list https://stat.ethz.ch/mailman/
> listinfo/r-package-devel
>

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] nparACT package: "working directory was changed to...resetting"

2017-12-19 Thread Iñaki Úcar
2017-12-19 16:27 GMT+01:00 Blume Christine :
> Hi Duncan,
>
> Thanks a lot! Good to see that you had a similar idea, I did just that...in 
> my example it looks like this, however, that does not help, i.e. that is the 
> code that is associated with the warning…
>
> data(sleepstudy)
>
> wd <- getwd()
>
> name <- "sleepstudy_example"
>
> newdir <- paste(wd,name, sep="/")
>
> if (dir.exists(newdir)){
>
> setwd(newdir)
>
> write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = 
> FALSE)
>
> r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)
>
> } else {
>
> dir.create(newdir)
>
> setwd(newdir)
>
> write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = 
> FALSE)
>
> r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)
>
> }
>
> setwd(wd)
>
> }

I see:

$ wget https://cran.r-project.org/src/contrib/nparACT_0.7.tar.gz
$ tar xf nparACT_0.7.tar.gz
$ grep -r setwd nparACT
nparACT/man/nparACT_flex_loop.Rd:setwd(newdir)
nparACT/man/nparACT_base_loop.Rd:setwd(newdir)

so two examples don't restore the wd as Duncan was pointing out.

Iñaki

>
>
>
> Best,
>
> Christine
>
>

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

Re: [R-pkg-devel] nparACT package: "working directory was changed to...resetting"

2017-12-19 Thread Blume Christine
Hi Duncan,



Thanks a lot! Good to see that you had a similar idea, I did just that...in my 
example it looks like this, however, that does not help, i.e. that is the code 
that is associated with the warning…



data(sleepstudy)

wd <- getwd()

name <- "sleepstudy_example"

newdir <- paste(wd,name, sep="/")

if (dir.exists(newdir)){

setwd(newdir)

write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = 
FALSE)

r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

} else {

dir.create(newdir)

setwd(newdir)

write.table(sleepstudy, file = "sleepstudy.txt", row.names=FALSE, col.names = 
FALSE)

r <- nparACT_flex_loop(newdir, SR = 4/60, minutes = 435)

}

setwd(wd)

}



Best,

Christine





-Ursprüngliche Nachricht-
Von: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Gesendet: Dienstag, 19. Dezember 2017 16:19
An: Blume Christine; r-package-devel@r-project.org
Betreff: Re: [R-pkg-devel] nparACT package: "working directory was changed 
to...resetting"



On 19/12/2017 9:42 AM, Blume Christine wrote:

> Dear Community,

>

>

>

> For Fedora my package now gives a warning message when running the example:

>

>

>

> "Warning: working directory was changed to 
> '/data/gannet/ripley/R/packages/tests-clang/nparACT.Rcheck/sleepstudy_example',
>  resetting"

>

>

>

> I do not really know how to approach/solve this, what has recently been 
> changed in R devel so this error message started appearing?



Previously you were allowed to change directory in an example.  Now you're not. 
 This makes sense:  the user might not want to change the working directory.



To fix this, just save the old directory, and restore it at the end of your 
example.  For example,



   olddir <- setwd(tempdir())

   # Run the rest of the example code here

   setwd(olddir)



Duncan Murdoch



>

>

>

> The full message can be seen here:

> https://CRAN.R-project.org/web/checks/check_results_nparACT.html

>

>

>

> Any help is appreciated and rewarded with gratitude.

>

>

>

> Best,

>

>

>

> Christine

>

>

>

> [[alternative HTML version deleted]]

>

> __

> R-package-devel@r-project.org mailing 
> list

> https://stat.ethz.ch/mailman/listinfo/r-package-devel

>



[[alternative HTML version deleted]]

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

Re: [R-pkg-devel] "LoadLibrary failure" on Windows

2017-12-19 Thread Duncan Murdoch

On 19/12/2017 6:15 AM, Sarah Friedrich wrote:

Dear all,

the CRAN Package Check Results for my package GFD indicate an error on
windows (https://cran.r-project.org/web/checks/check_results_GFD.html),
which I am unable to fix. In my package, I'm using RGtk2 for creating a
GUI. Since this produced errors before, I first check if RGtk2 is
available via

requireNamespace("RGtk2", quietly = TRUE)
    if(!("package:RGtk2" %in% search())){attachNamespace("RGtk2")}


That code doesn't quite make sense.  Some background first:

A package can be "loaded" or "loaded and attached".  If your DESCRIPTION 
file has the package in the Imports list, it will be automatically 
loaded.  If it is in the Depends list, it will be automatically loaded 
and attached.  But if it is in the Suggests list, neither of these will 
happen automatically.


If a package is loaded but not attached, then it will not be on the 
search list.


You can load a package using requireNamespace().  Your first line of 
code does that.  If the package has already been loaded, nothing will 
happen.  You can load and attach it using require().  Both of these 
functions return a logical value to indicate success.


You almost never need to call attachNamespace.  If you really need to 
have the package on the search list (and this is rare), you should have 
called require().  Usually you just need code like this:


 if (!requireNamespace("RGtk2", quietly = TRUE))
   # Signal that RGtk2 is not available.

If the error didn't happen, then RGtk2 is now guaranteed to be loaded, 
and you can call functions from it using code like


RGtk2::foo()

If you don't want to always use the prefix RGtk2::, then you could have 
used require("RGtk2", quietly = TRUE) when you loaded it, but this is 
frowned upon, because the user might not want RGtk2 in their search 
list.  (It might have functions with the same names as functions from 
other packages, and that can mess up the user's code.)


Duncan Murdoch


It all works fine on linux (x86_64-suse-linux-gnu (64-bit)) and on R
version 3.2.5 on windows (x86_64-w64-mingw32/x64 (64-bit)), so I suspect
that it's not actually an error in my package but something between
RGtk2 and the new R version on windows. Anyway, a workaround would be
greatly appreciated! Do you have any suggestions?

Thanks a lot in advance and best regards,
Sarah

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



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

[R-pkg-devel] nparACT package: "working directory was changed to...resetting"

2017-12-19 Thread Blume Christine
Dear Community,



For Fedora my package now gives a warning message when running the example:



"Warning: working directory was changed to 
'/data/gannet/ripley/R/packages/tests-clang/nparACT.Rcheck/sleepstudy_example', 
resetting"



I do not really know how to approach/solve this, what has recently been changed 
in R devel so this error message started appearing?



The full message can be seen here: 
https://CRAN.R-project.org/web/checks/check_results_nparACT.html



Any help is appreciated and rewarded with gratitude.



Best,



Christine



[[alternative HTML version deleted]]

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


[R-pkg-devel] "LoadLibrary failure" on Windows

2017-12-19 Thread Sarah Friedrich

Dear all,

the CRAN Package Check Results for my package GFD indicate an error on 
windows (https://cran.r-project.org/web/checks/check_results_GFD.html), 
which I am unable to fix. In my package, I'm using RGtk2 for creating a 
GUI. Since this produced errors before, I first check if RGtk2 is 
available via


requireNamespace("RGtk2", quietly = TRUE)
  if(!("package:RGtk2" %in% search())){attachNamespace("RGtk2")}

It all works fine on linux (x86_64-suse-linux-gnu (64-bit)) and on R 
version 3.2.5 on windows (x86_64-w64-mingw32/x64 (64-bit)), so I suspect 
that it's not actually an error in my package but something between 
RGtk2 and the new R version on windows. Anyway, a workaround would be 
greatly appreciated! Do you have any suggestions?


Thanks a lot in advance and best regards,
Sarah

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

Re: [R-pkg-devel] Lapack: undefined symbol: zgbsv_

2017-12-19 Thread Dirk Eddelbuettel

On 19 December 2017 at 13:41, Ralf Stubner wrote:
| On 19.12.2017 09:38, Baptiste Auguie wrote:
| > Thanks for the pointer to `arma::solve_opts::no_band`, it sounds like a
| > good solution (assuming the compiler will then skip all the parts
| > related to banded inversion routines). I've been unable to test it so
| > far; I haven't managed to reproduce the error reported on CRAN on a mac.
| 
| Reproducing this error is not easy. I was able to do so using docker

Just work on Windows, or on any R built so that its internal BLAS are
used. You can force that via configure at build time.

| with
| 
https://github.com/rocker-org/rocker-versioned/blob/master/r-ver/3.4.3/Dockerfile
| as starting point. If you remove lines 30 and 97 (openblas-dev and
| --with-blas), you can build a docker image with R included that uses the
| BLAS and LAPACK supplied by R.
| 
| I have given this a try and installing 'cda' in such a image does indeed
| reproduce the error. Unfortunately adding 'arma::solve_opts::no_band' to
| the two places where arma::solve is used did not help in my tests :-(

:-(

Maybe Arma needs another patch.
 
| > The 'crippled Lapack' macro was useful as a workaround in the past but
| > I'm not sure of its exact mode of operation so I'm reluctant to set
| > something to "cripple" the code (does it target only those routines that
| > are found missing, or is it more of a blanket switch with no fine-tuning?).
| 
| I think it is a blanket switch that will affect also those methods that
| where already added in the past. So this would be only a temporary
| solution, but I think that's what you need right now.
| 
| BTW, setting ARMA_CRIPPLED_LAPACK is more difficult than I thought since
| it is #undefed in the RcppArmadillo-Config. Short of editing that file,
| you can add this to src/Makevars
| 
| PKG_CXXFLAGS=-DARMA_CRIPPLED_LAPACK
| -DRcppArmadillo__RcppArmadilloConfigGenerated__h
| 
| I hope there is a better way ...

Set the #define after the #include  ?

RcppArmadillo is just the man in the middle.  This is between Baptiste
relying on something that is now always available, and Conrad assuming it is.

I think Baptiste will need to decompose all these pieces and rearrange then.
Or just build his own solve() method based on older Armadillo code?

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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