[Rcpp-devel] R package: minqa (fwd)

Romain Francois romain at r-enthusiasts.com
Mon Mar 15 19:01:36 CET 2010


(promoted to Rcpp-devel)

Le 15/03/10 16:59, Douglas Bates a écrit :
> The answer is quite interesting.  I had carefully arranged the
> objective function passed to the C++ code so that it did not require
> any arguments.  That way, you can just evaluate it rather than needing
> to go through the complexities of arranging a function call with
> arguments in C code.  When the -std=c++0x flag is set the Rcpp package
> allows what are called varadic arguments to methods (an unspecified
> number of arguments that are handled recursively) but without it you
> can only specify 1, 2, ..., 5 arguments.  Strangely enough it doesn't
> allow zero arguments, which is the simplest case.

This is now hopefully fixed

> Romain: Do you want to add (Rcpp::Function)() to the code_bloat
> section or shall I?

Done. I added the script inst/codebloat/codebloat.R that one can call 
from the root of Rcpp source tree like this :

Rscript inst/codebloat/codebloat.R 20

and updated the number to 20 (is this enough ?)

not sure this is the best way to do it, so I'm open to suggestions, etc ...

I've tagged this as Rcpp version 0.7.9.3.

> In the short term I will rewrite the R and C++ code so that the R
> function takes one argument and check in a new version to the R-forge
> archive.
>
> On Mon, Mar 15, 2010 at 10:47 AM, Douglas Bates<bates at stat.wisc.edu>  wrote:
>> Interestingly, I discovered the same thing this morning when I tried
>> to install on my office computer.
>>
>> I was experimenting with some of the more sophisticated capabilities
>> in the Rcpp package, which require the -std=c++0x flag to the
>> compiler.  I had it set for the computer at home but not at work.
>> Certain methods in the Rcpp::Function class are not available without
>> the flag, as I realized this morning.
>>
>> I'll check how to call an R function without arguments in Rcpp if the
>> -std=c++0x flag is not set and commit a fix.
>>
>> 2010/3/15 Katharine Mullen<kmullen at nist.gov>:
>>> FYI
>>>
>>> ---------- Forwarded message ----------
>>> Date: Mon, 15 Mar 2010 11:13:33 -0400 (EDT)
>>> From: Katharine Mullen<kmullen at nist.gov>
>>> To: Arne Henningsen<arne.henningsen at googlemail.com>
>>> Subject: Re: R package: minqa
>>>
>>> Dear Arne,
>>>
>>> Interesting.  I get the same error.  Thanks to the efforts of Doug Bates the
>>> package is undergoing renovations; I expect that this problem will be
>>> possible to remove soon.
>>>
>>> Thank you for testing, and informing us of the issue.
>>>
>>> best regards,
>>> Kate
>>>
>>> --
>>> Katharine Mullen
>>> Structure Determination Methods Group, Ceramics Division
>>> National Institute of Standards and Technology (NIST)
>>> 100 Bureau Drive, M/S 8520
>>> Gaithersburg, MD, 20899, USA
>>> phone: 001 301 975 6890
>>> email: Katharine.Mullen at nist.gov
>>>
>>> On Mon, 15 Mar 2010, Arne Henningsen wrote:
>>>
>>>> Dear Katharine,
>>>>
>>>> I tried to install the "optimx" package from R-Forge. This requires
>>>> the installation of your "minqa" package but I was not able to install
>>>> it, because the compilation stops with the error message "no match for
>>>> call to ‘(Rcpp::Function) ()’" (the full output is attached below). My
>>>> operating system is Ubuntu 8.10 (32 bit) and I use R version 2.10.1
>>>> (2009-12-14). I can install the "stable" version of the package from
>>>> CRAN. Any ideas?
>>>>
>>>> Best wishes from Copenhagen,
>>>> Arne
>>>>
>>>> -------------------------------------------------------------------------
>>>> R>  install.packages("minqa", repos="http://R-Forge.R-project.org")
>>>> Warning in install.packages("minqa", repos =
>>>> "http://R-Forge.R-project.org") :
>>>>   argument 'lib' is missing: using '/usr/local/lib/R/site-library'
>>>> trying URL 'http://R-Forge.R-project.org/src/contrib/minqa_1.1.1.tar.gz'
>>>> Content type 'application/x-gzip' length 47202 bytes (46 Kb)
>>>> opened URL
>>>> ==================================================
>>>> downloaded 46 Kb
>>>>
>>>> * installing *source* package ‘minqa’ ...
>>>> ** libs
>>>> gfortran   -fpic  -g -O2 -c altmov.f -o altmov.o
>>>> gfortran   -fpic  -g -O2 -c bigden.f -o bigden.o
>>>> gfortran   -fpic  -g -O2 -c biglag.f -o biglag.o
>>>> gfortran   -fpic  -g -O2 -c bobyqa.f -o bobyqa.o
>>>> gfortran   -fpic  -g -O2 -c bobyqb.f -o bobyqb.o
>>>> gfortran   -fpic  -g -O2 -c lagmax.f -o lagmax.o
>>>> g++ -I/usr/share/R/include
>>>> -I/usr/local/lib/R/site-library/Rcpp/lib -fpic  -g -O2 -c minqa.cpp -o
>>>> minqa.o
>>>> minqa.cpp: In function ‘void calfun_(const int*, const double*, double*)’:
>>>> minqa.cpp:24: error: no match for call to ‘(Rcpp::Function) ()’
>>>> make: *** [minqa.o] Error 1
>>>> ERROR: compilation failed for package ‘minqa’
>>>> * removing ‘/usr/local/lib/R/site-library/minqa’
>>>> * restoring previous ‘/usr/local/lib/R/site-library/minqa’
>>>>
>>>> The downloaded packages are in
>>>>        ‘/tmp/RtmpljUfdY/downloaded_packages’
>>>> Warning message:
>>>> In install.packages("minqa", repos = "http://R-Forge.R-project.org") :
>>>>   installation of package 'minqa' had non-zero exit status
>>>> -------------------------------------------------------------------------
>>>>
>>>>
>>>> --
>>>> Arne Henningsen
>>>> http://www.arne-henningsen.name
>>
>


-- 
Romain Francois
Professional R Enthusiast
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr
|- http://tr.im/OIXN : raster images and RImageJ
|- http://tr.im/OcQe : Rcpp 0.7.7
`- http://tr.im/O1wO : highlight 0.1-5



More information about the Rcpp-devel mailing list