Login  Register

Re: Compilation problems with SUN CC

Posted by Luigi Ballabio on Feb 19, 2009; 2:29pm
URL: http://quantlib.414.s1.nabble.com/Compilation-problems-with-SUN-CC-tp12581p12588.html

On Thu, 2009-02-19 at 11:10 +0100, Andreas Spengler wrote:

> removing the "-template=wholeclass" switch now takes me through to the
> experimental subdir and dies at fdmstepconditioncomposite.cpp:
>
> libtool: compile:  CC -DHAVE_CONFIG_H -I. -I. -I../../../ql -I../../..
> -I../../.. -I/home/spenglan/local/include/boost-1_38
> -erroff=wvarhidemem,hidevf,hidevfinvb,wbadinitl,badargtypel2w -errtags=yes
> -KPIC -features=rtti -instances=global -fast
> -library=Cstd,iostream,no%stlport4,Crun -xarch=v8plusa -fsimple=1 -mt
> -Drindex=rindex -Dindex=index -D__solaris_sparc__ -c
> fdmstepconditioncomposite.cpp  -KPIC -DPIC -o
> .libs/fdmstepconditioncomposite.o
> "fdmstepconditioncomposite.cpp", line 37: Error, nomatchoverin: Could not
> find a match for std::vector<double>::vector(__rwstd::__rb_tree<double,
> double, __rwstd::__ident<double, double>, std::less<double>,
> std::allocator<double>>::const_iterator, __rwstd::__rb_tree<double,
> double, __rwstd::__ident<double, double>, std::less<double>,
> std::allocator<double>>::const_iterator) needed in
> QuantLib::FdmStepConditionComposite::FdmStepConditionComposite(const
> std::list<std::vector<double> >&, const
> std::list<boost::shared_ptr<QuantLib::StepCondition<QuantLib::Array>> >&).
> 1 Error(s) and 4 Warning(s) detected.

std::vector is supposed to have a constructor taking two
iterators---which is called in the offending line, viz.

stoppingTimes_ = std::vector<Time>(allStoppingTimes.begin(),
                                   allStoppingTimes.end());

but your compiler's STL implementation, apparently, does not provide it.
(Which is a bit strange---how old is it?  May you check the <vector>
header?)  You can work around it by rewriting the above line, for
instance as:

stoppingTimes_ = std::vector<Time>();
std::copy(allStoppingTimes.begin(), allStoppingTimes.end(),
          std::back_inserter(stoppingTimes_));

or as an explicit loop that inserts into stoppingTimes_ all the elements
of allStoppingTimes---whatever you feel more comfortable with.

> I am a bit at my wits end here... Would it perhaps be possible to disable
> experimental code in the first place?

Possibly (it's might be a bit harder to disable it in the test-suite,
though) but you'll probably find calls to that constructor in the core
library, too.  You'll have to fix them in the same way.

Luigi


--

Poets have been mysteriously silent on the subject of cheese.
-- Gilbert K. Chesterton



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev