[R-pkg-devel] How to retrieve a flag set in configure.ac (filled in Makevars.in) during package installation in an R or C++ script ?

2020-08-15 Thread Akshit Achara
Hi everyone,


The package rminizinc  provides
an interface to MiniZinc
 in R. The package
provides various functionalities to parse, solve and manipulate MiniZinc
models. This is done by using the MiniZinc C++ API (libminizinc

The installation requires linking of the library an including the header
files for which PKG_LIBS flag(-L/path/to/libminizinc -lmzn) , and
PKG_CPPFLAGS (-I/path/to/libminizinc/include) are filled in Makevars.in
which is set by configure based on the path of the library provided by the
user using --configure-args or if the user doesn't provide any arguments, a
default path is passed from configure (using configure.ac).


In one of my Rcpp functions mzn_parse() which is used to parse MiniZinc
models, I sometimes need to use the files in the subdirectories of the
libminizinc library. To access these files, I need to use the path of
libminizinc (which can change per installation). I want to extract this
path from either Makevars or configure to use it in my package. Is there
any way I could retrieve this path in my scripts?

Please let me know if this question is not relevant to the mailing list.

The Makevars.in looks like this:

OBJECTS.tests = cpp_tests/test-runner.o cpp_tests/test-mzn_parse.o
set_params.o cpp_tests/test-mzn_eval.o cpp_tests/test-sol_parse.o
OBJECTS.sources = RcppExports.o set_params.o mzn_parse.o mzn_eval.o sol_parse.o
OBJECTS.helpers = filetoString.o helper_parse.o expDetails.o pathStringcheck.o
OBJECTS = $(OBJECTS.sources) $(OBJECTS.tests) $(OBJECTS.helpers)
strippedLib: $(SHLIB)
if test -e "/usr/bin/strip"; then /usr/bin/strip --strip-debug
$(SHLIB); fi.phony: strippedLib
all: clean
rm -f $(OBJECTS.sources) $(OBJECTS.tests) $(OBJECTS.helpers)  *.so


[[alternative HTML version deleted]]

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

Re: [R-pkg-devel] Etiquette for package submissions that do not automatically pass checks?

2020-08-15 Thread Cesko Voeten

Duncan, Joshua,

Thanks for the feedback. I had indeed forgotten to increment the version 
number, so that may explain it. I'll give it until a few days after the 24th, 
and then just resubmit with a new version number.

Also, thanks for introducing me to the foghorn package, I wasn't aware of it 


Op 14-08-2020 om 22:31 schreef Joshua Ulrich:

On Fri, Aug 14, 2020 at 2:54 PM Duncan Murdoch  wrote:

On 14/08/2020 3:08 p.m., Cesko Voeten wrote:

A while ago, I submitted an update to my package 'buildmer' that does not pass 
R CMD check. This is deliberate. The package contains functionality to run on 
cluster nodes that were set up by the user and needs to access its own internal 
functions from there. In previous versions of the package, I had maintained a 
list of those functions and clusterExport()ed them, but that had the side 
effect of overwriting any same-named user objects on the user-provided cluster 
nodes, which I thought was poor form. The update therefore accesses these 
functions using ':::', which triggers a check warning.

I thought the etiquette was to explain this in the 'Comments' box when 
submitting, but this gave me the same automated message that the package does 
not pass checks and that I should fix it or reply-all and explain. This led me 
to believe that I should not have used the 'Comments' box for this purpose, 
hence I resubmitted the package leaving the comments box empty, and I 
replied-all to the subsequent e-mail I got with an explanation similar to the 

It seems to me that what you should have done is "reply-all and
explain", as the automated message said.

It has now been a while since I sent that e-mail (ten days), and I have yet to 
hear back. I was wondering if the message had gotten lost, if they simply 
haven't gotten around to it yet (I have no idea how much mail they receive on a 
daily basis, but I'd think it's a lot more than I do), or if I should have 
handled this differently. Only CRAN can answer the first two questions, but 
before I bother them: was this the correct procedure, or should I simply have 
done something differently?

You can see the state of your submission using the foghorn package.
cran_incoming("buildmer") currently shows your package is in the
"archive", which means "package rejected: it does not pass the checks
cleanly and the problems are unlikely to be false positives".

I only see version 1.7 there, which may indicate that you resubmitted
exactly the same package (down to the version number).  As the
instructions at
say, "Increasing the version number at each submission reduces confusion
so is preferred even when a previous submission was not accepted."

What I'd suggest now is that you do nothing more for a day or two,
because CRAN members who aren't on holiday might read and respond to
your message.  If you don't hear anything, then I'd start over again,
with a new version number, and an explanation in the comments, and
likely a followup reply-all.

You have more than a few days.  As it says on CRAN:
"CRAN submission is offline from Aug 14 to Aug 24, 2020 (CRAN team
vacation and maintainance work)"

Alternatively, you could export those troublesome functions from your
package but document them as for internal use only.  Renaming them with
a name starting with "." will make them harder for users to stumble
upon, but you can still access them using buildmer::.something, you
shouldn't need clusterExport(). Then you will meet the technical
requirement and not need any explanation.

Duncan Murdoch

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

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