[Rcpp-devel] no matching function for call in mzR on Mac after Rcpp 0.11.0 update

Kevin Ushey kevinushey at gmail.com
Fri Feb 7 19:50:03 CET 2014


Hi everyone,

I think I've gotten to the bottom of this. In Rcpp 0.10.6, the
Rcpp::Reference classes defined a default constructor; this default
constructor was left out in the reshuffle to Rcpp 0.11.0.

I'm not as sure why, but newer compilers are either 1) automatically
generating a default constructor, or 2) deciding one of the available
constructors is still suitable. This does not happen with
llvm-g++-4.2, hence the error.

I committed a hotfix to the installed version of Rcpp at BioC that
should fix build problems for now; but we can decide what the
appropriate solution in Rcpp is as well.

Cheers,
Kevin

On Fri, Feb 7, 2014 at 7:46 AM, Dan Tenenbaum <dtenenba at fhcrc.org> wrote:
>
>
> ----- Original Message -----
>> From: "Kevin Ushey" <kevinushey at gmail.com>
>> To: "Steffen Neumann" <sneumann at ipb-halle.de>
>> Cc: "rcpp-devel" <rcpp-devel at lists.r-forge.r-project.org>
>> Sent: Friday, February 7, 2014 2:40:12 AM
>> Subject: Re: [Rcpp-devel] no matching function for call in mzR on Mac after Rcpp 0.11.0 update
>>
>> I will see if I can take a deeper look at this soon, but
>> unfortunately, I do not have access to an older Mac machine. For
>> reference, I am able to successfully compile and check mzR 1.9.3
>> using
>> Apple clang; however, I had to modify the Boost source included in
>> the
>> package a bit to get it to work. Some information for the interested
>> follows...
>
>
> As I mentioned to Steffen a couple of times, the issue is that the compiler used on the Bioconductor and CRAN build Macs is g++ 4.2.1; mzR does not build with that compiler. It builds under clang but changing compilers to accomodate this one package is not going to happen (long-term, both CRAN and Bioconductor will switch to clang/clang++ on Mac; we're following CRAN's lead and they have not made this move yet).
>
> So the issue is figuring out what in mzR is too "new" for g++ 4.2.1.
>
> Dan
>
>
>>
>> In fact, Boost (that is, the subset packaged with mzR) is doing
>> something illegal by trying to forward declare standard library
>> containers in src/boost/detail/container_fwd.hpp, and this causes
>> things to blow up for compilers using libc++. I have to remove the
>> cruft and just keep the #include statements in order to successfully
>> install the package. Ie, on package build I get the error:
>>
>> clang++ -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG
>> -D_LARGEFILE_SOURCE -I./boost_aux/ -I. -DHAVE_PWIZ_MZML_LIB
>> -D_NODEBUG
>> -I/usr/local/include
>> -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include"
>>   -fPIC  -g -O3 -march=native -pipe -Wall -pedantic -c
>> boost/regex/src/posix_api.cpp -o boost/regex/src/posix_api.o
>> In file included from boost/regex/src/posix_api.cpp:22:
>> In file included from ./boost/regex.hpp:31:
>> In file included from ./boost/regex/v4/regex.hpp:67:
>> ./boost/regex/v4/basic_regex.hpp:149:9: error: too few template
>> arguments for class
>>       template 'vector'
>>    std::vector<name> m_sub_names;
>>         ^
>> with the packaged Boost as-is. Perhaps the define guard magic in
>> boost/detail/container_fwd.hpp is not as robust as it should be.
>>
>> Anyway, I'll see if there's something we can do to work around this
>> tomorrow.
>>
>> Cheers,
>> Kevin
>>
>> On Fri, Feb 7, 2014 at 12:42 AM, Steffen Neumann
>> <sneumann at ipb-halle.de> wrote:
>> > Hi list,
>> >
>> > sorry, it's me again.
>> >
>> > I am having issues to build mzR on Mac (to which I have no access)
>> > after the upgrade to Rcpp 0.11.0 on both
>> >
>> > http://bioconductor.org/checkResults/2.13/bioc-LATEST/mzR/perceval-buildsrc.html
>> > http://bioconductor.org/checkResults/2.14/bioc-LATEST/mzR/petty-buildsrc.html
>> >
>> > with the same error message on both machines. Other builds are
>> > fine.
>> > Those C++ error messages always scare the s**t out of me,
>> > But then, the 100s of lines when a Java program throws
>> > an exception are not better ...
>> >
>> > The following is what I understood. The problem occurs in the three
>> > copy constructors
>> > generated for the RcppRamp object in RcppRampModule.cpp[1]
>> >
>> >         Rcpp::S4_field<RcppRamp>::S4_field(const
>> >         Rcpp::S4_field<RcppRamp>&),
>> > and similar for
>> >         S4_CppOverloadedMethods(const
>> >         Rcpp::S4_CppOverloadedMethods<RcppRamp>&)
>> > and     S4_CppConstructor(const
>> > Rcpp::S4_CppConstructor<RcppRamp>&).
>> >
>> > In all cases, there is a call to
>> > Reference_Impl<Rcpp::PreserveStorage>::Reference_Impl()
>> > for which the compiler can't find a matching function. What it
>> > offers are
>> > implementations like Reference_Impl(const std::string&). The
>> > difference is
>> > that the requested Reference_Impl() comes with no arguments (?!).
>> >
>> > The call is made from Module.h:331 in the macro
>> > RCPP_CTOR_ASSIGN(S4_field)
>> > (Would it help to define RCPP_DEBUG for some additional output ?)
>> > Indeed, all three "no matching function"s seem to come from this
>> > macro:
>> >
>> >         grep RCPP_CTOR_ASSIGN ./include/Rcpp/*
>> >         ./include/Rcpp/Module.h:
>> >                RCPP_CTOR_ASSIGN(S4_CppConstructor)
>> >         ./include/Rcpp/Module.h:
>> >                RCPP_CTOR_ASSIGN(S4_CppOverloadedMethods)
>> >         ./include/Rcpp/Module.h:        RCPP_CTOR_ASSIGN(S4_field)
>> >
>> > But unfortunately this is where I get lost. Since it works on other
>> > architectures,
>> > <wildGuess>
>> > it could be that on Mac "something" is #defined to be an empty
>> > string,
>> > so that Reference_Impl() is called with an empty argument.
>> > </wildGuess>
>> >
>> > <disclaimer>
>> > Of course, my last ventures into C++-land is more than a decade
>> > ago, so I could be waay off.
>> > </disclaimer>
>> >
>> > Any ideas here ?
>> >
>> > Yours,
>> > Steffen
>> >
>> > [1]
>> > https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/mzR/src/RcppRampModule.cpp
>> >
>> > -----------------------------------------------
>> >
>> > llvm-g++-4.2 -arch x86_64
>> > -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG
>> > -D_LARGEFILE_SOURCE -I./boost_aux/ -I. -DHAVE_PWIZ_MZML_LIB
>> > -D_NODEBUG -I/usr/local/include
>> > -I"/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include"
>> >   -fPIC  -mtune=core2 -g -O2  -c RcppRampModule.cpp -o
>> > RcppRampModule.o
>> >
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Module.h:
>> > In copy constructor 'Rcpp::S4_field<Class>::S4_field(const
>> > Rcpp::S4_field<Class>&) [with Class = RcppRamp]':
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/module/class.h:416:
>> >   instantiated from 'Rcpp::List Rcpp::class_<Class>::fields(const
>> > Rcpp::XPtr<Rcpp::class_Base, Rcpp::PreserveStorage, void
>> > Rcpp::standard_delete_finalizer [with T = Rcpp::class_Base]>&)
>> > [with Class = RcppRamp]'
>> > RcppRampModule.cpp:22:   instantiated from here
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Module.h:331:
>> > error: no matching function for call to
>> > 'Rcpp::Reference_Impl<Rcpp::PreserveStorage>::Reference_Impl()'
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:56:
>> > note: candidates are:
>> > Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(const
>> > std::string&) [with StoragePolicy = Rcpp::PreserveStorage]
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:41:
>> > note:
>> >                 Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(SEXPREC*)
>> > [with StoragePolicy = Rcpp::PreserveStorage]
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:34:
>> > note:
>> >                 Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(const
>> > Rcpp::Reference_Impl<StoragePolicy>&) [with StoragePolicy =
>> > Rcpp::PreserveStorage]
>> >
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Module.h:
>> > In copy constructor
>> > 'Rcpp::S4_CppOverloadedMethods<Class>::S4_CppOverloadedMethods(const
>> > Rcpp::S4_CppOverloadedMethods<Class>&) [with Class = RcppRamp]':
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/module/class.h:435:
>> >   instantiated from 'Rcpp::List
>> > Rcpp::class_<Class>::getMethods(const Rcpp::XPtr<Rcpp::class_Base,
>> > Rcpp::PreserveStorage, void Rcpp::standard_delete_finalizer [with
>> > T = Rcpp::class_Base]>&, std::string&) [with Class = RcppRamp]'
>> > RcppRampModule.cpp:22:   instantiated from here
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Module.h:256:
>> > error: no matching function for call to
>> > 'Rcpp::Reference_Impl<Rcpp::PreserveStorage>::Reference_Impl()'
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:56:
>> > note: candidates are:
>> > Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(const
>> > std::string&) [with StoragePolicy = Rcpp::PreserveStorage]
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:41:
>> > note:
>> >                 Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(SEXPREC*)
>> > [with StoragePolicy = Rcpp::PreserveStorage]
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:34:
>> > note:
>> >                 Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(const
>> > Rcpp::Reference_Impl<StoragePolicy>&) [with StoragePolicy =
>> > Rcpp::PreserveStorage]
>> >
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Module.h:
>> > In copy constructor
>> > 'Rcpp::S4_CppConstructor<Class>::S4_CppConstructor(const
>> > Rcpp::S4_CppConstructor<Class>&) [with Class = RcppRamp]':
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/module/class.h:446:
>> >   instantiated from 'Rcpp::List
>> > Rcpp::class_<Class>::getConstructors(const
>> > Rcpp::XPtr<Rcpp::class_Base, Rcpp::PreserveStorage, void
>> > Rcpp::standard_delete_finalizer [with T = Rcpp::class_Base]>&,
>> > std::string&) [with Class = RcppRamp]'
>> > RcppRampModule.cpp:22:   instantiated from here
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Module.h:218:
>> > error: no matching function for call to
>> > 'Rcpp::Reference_Impl<Rcpp::PreserveStorage>::Reference_Impl()'
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:56:
>> > note: candidates are:
>> > Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(const
>> > std::string&) [with StoragePolicy = Rcpp::PreserveStorage]
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:41:
>> > note:
>> >                 Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(SEXPREC*)
>> > [with StoragePolicy = Rcpp::PreserveStorage]
>> > /Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp/include/Rcpp/Reference.h:34:
>> > note:
>> >                 Rcpp::Reference_Impl<StoragePolicy>::Reference_Impl(const
>> > Rcpp::Reference_Impl<StoragePolicy>&) [with StoragePolicy =
>> > Rcpp::PreserveStorage]
>> >
>> >
>> > --
>> > IPB Halle                    AG Massenspektrometrie & Bioinformatik
>> > Dr. Steffen Neumann          http://www.IPB-Halle.DE
>> > Weinberg 3                   http://msbi.bic-gh.de
>> > 06120 Halle                  Tel. +49 (0) 345 5582 - 1470
>> >                                   +49 (0) 345 5582 - 0
>> > sneumann(at)IPB-Halle.DE     Fax. +49 (0) 345 5582 - 1409
>> >
>> >
>> >
>> > _______________________________________________
>> > Rcpp-devel mailing list
>> > Rcpp-devel at lists.r-forge.r-project.org
>> > https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>> _______________________________________________
>> Rcpp-devel mailing list
>> Rcpp-devel at lists.r-forge.r-project.org
>> https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel
>>


More information about the Rcpp-devel mailing list