[R-pkg-devel] Conditional linking in Makevars

2020-08-11 Thread David Cortes
I am having issues with undefined compiler symbols in a package with C
code that I recently updated:
https://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian-clang/poismf-00install.html
The issue seems to be connected with usage of OpenMP, and happens only
when compiling with clang:
“Error: package or namespace load failed for 'poismf' in dyn.load(file,
DLLpath = DLLpath, ...):
 unable to load shared object '/home/hornik/tmp/R.check/r-devel-
clang/Work/build/Packages/00LOCK-poismf/00new/poismf/libs/poismf.so':
  /home/hornik/tmp/R.check/r-devel-clang/Work/build/Packages/00LOCK-
poismf/00new/poismf/libs/poismf.so: undefined symbol:
__atomic_compare_exchange”


Prof. Ripley left the following comment:
“I don't know what makes your use of OpenMP uniquely different but
when 
using clang you need to include -latomic in the link (where it exists, 
as it does on Linux and probably on FreeBSD).”

I am wondering if it is somehow possible to add conditional link
arguments in a Makevars file depending on the user’s operating system,
or if not possible, whether it would somehow hurt in windows/mac
installations to add a raw -latomic in there.


Best regards,
David Cortes

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


Re: [R-pkg-devel] WARNING: A complete check needs the 'checkbashisms' script.

2020-08-11 Thread brian knaus
Thank you Dirk "Eddelbuettel" (apologies for my spelling, it's your name,
so I should be able to spell it correctly, particularly if I'm asking you
for help) and Rodrigo Tobar for the responses! It sounds like I've gone
down a rabbit hole that I should not have.

When I omit ```configure``` (in my case it only includes this call to
```checkbashisms```) I build with no ERRORs or WARNINGs on Ubuntu 18.0.4
and R 4.0.2 with ```checkbashisms``` installed. When I build on macos
10.15.6 and R 4.0.2 without ```checkbashisms``` installed I throw the
previously reported WARNING (when using --as-cran but not when I omit this
flag). I feel I need to address this because it is a WARNING. It sounds
like I can assume that CRAN machines will have ```checkbashisms```
installed where necessary and handle this appropriately when not? And that
users will not try to use R CMD check --as-cran? Suspecting like I'm trying
too hard now. But also feeling like I've been down this path with CRAN
already and am trying to respect their time.

Thanks!
Brian

On Mon, Aug 10, 2020 at 8:41 PM Rodrigo Tobar  wrote:

> Hi Brian,
>
> The checkbashisms script is invoked by the R checks automatically:
>
>
> https://github.com/wch/r-source/blob/trunk/src/library/tools/R/check.R#L1216-L1267
>
> Thus there shouldn't be any need for you to invoke it manually in your
> configure script, even less so to worry about its presence. You can
> still install it locally so the R checks can proceed without the warning
> (or set _R_CHECK_BASHISMS_ to FALSE to skip that particular check, again
> locally), but that shouldn't be a problem in CRAN, as it should be
> installed there already.
>
> Cheers,
>
> Rodrigo
>
> On 11/8/20 10:54 am, brian knaus wrote:
> > Hi R-pkg-devel,
> >
> > My package
> >
> >
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fknausb%2FvcfR&data=02%7C01%7Crodrigo.tobarcarrizo%40uwa.edu.au%7C6f00588f63164cc6f8d208d83da1e836%7C05894af0cb2846d8871674cdb46e2226%7C1%7C0%7C637327112896039359&sdata=afGjqTjB%2B8lVCmXDWb8OhFNIYwIR%2BoIVX1QLFpLSfwA%3D&reserved=0
> >
> > has been archived on CRAN because I was asked by CRAN to address issues
> > that I was unable to address before the deadline I was given. The issue
> I'm
> > struggling with is that when I use
> >
> > ```
> > R CMD check --as-cran vcfR_1.12.0.tar.gz
> > ```
> >
> > I get
> >
> > ```
> > * checking top-level files ... WARNING
> > A complete check needs the 'checkbashisms' script.
> > See section ‘Configure and cleanup’ in the ‘Writing R Extensions’
> > manual..
> > ```
> > .
> >
> > Dirk Eddelbeuttel has proposed a solution on SO. (Thank you again Dirk!)
> >
> > ```
> >
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstackoverflow.com%2Fa%2F62721142&data=02%7C01%7Crodrigo.tobarcarrizo%40uwa.edu.au%7C6f00588f63164cc6f8d208d83da1e836%7C05894af0cb2846d8871674cdb46e2226%7C1%7C0%7C637327112896039359&sdata=G5BGCuyWMSItqbm0zwWbncrGapgNUldsuOIp6RvQlqs%3D&reserved=0
> > ```
> >
> > I've implemented this change, but I am concerned that it won't be
> accepted
> > by CRAN. My concern is that this works on my local machines (Ubuntu and
> > MacOS), where I can install checkbashisms, but I can't control whether
> > checkbashisms is installed on CRAN machines or on user machines. This
> means
> > it will generate a WARNING on machines where checkbashisms is not
> > installed. Most of me feels that I need to address this somehow. But I do
> > not know how. Part of me is wondering if I should expect users to manage
> > this. Any help would be appreciated!
> >
> > Thank you!
> > Brian (knausb)
> >
> >   [[alternative HTML version deleted]]
> >
> > __
> > R-package-devel@r-project.org mailing list
> >
> https://aus01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-package-devel&data=02%7C01%7Crodrigo.tobarcarrizo%40uwa.edu.au%7C6f00588f63164cc6f8d208d83da1e836%7C05894af0cb2846d8871674cdb46e2226%7C1%7C0%7C637327112896039359&sdata=7zy%2BLfU7WVDBzP0sP0axZpg8MF4AsD5wtrTu3plbF3o%3D&reserved=0
> >
>

[[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] WARNING: A complete check needs the 'checkbashisms' script.

2020-08-11 Thread Rodrigo Tobar

Hi Brian,

On 12/8/20 10:21 am, brian knaus wrote:
[...] It sounds like I can assume that CRAN machines will have 
```checkbashisms``` installed where necessary 


That's my reading, yes.


and handle this appropriately when not?


I don't think you need to handle this at all. As you experimented, 
simply removing your otherwise empty configure script should suffice.


And that users will not try to use R CMD check 
--as-cran?


Note that by default (i.e., without --as-cran) the check is not 
included. The documentation for _R_CHECK_BASHISMS_ reads "... Default: 
false (but true for CRAN submission checks except on Windows).". Adding 
--as-cran effectively turns that check on.


Having said that, users can still run checks with --as-cran, but they 
would need to be aware that it requires certain infrastructure to run 
those checks. That's true for all packages though, not only yours, so I 
don't think you need to specially worry about it.


Cheers,

Rodrigo

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