Login  Register

Re: Quantlib with Sunstudio 12.1 on Solaris 2.10/Sparc

Posted by Norbert Irmer on Apr 15, 2010; 9:47am
URL: http://quantlib.414.s1.nabble.com/Quantlib-with-Sunstudio-12-1-on-Solaris-2-10-Sparc-tp13400p13405.html

Hello,
I am checking your new version at the moment. Looks very good now,
but I still had 3 issues:

1.) There seems to be no "abs" for integral types in "ql/termstructures/inflation/seasonality.cpp".
The compiler complains:

Source:

Real MultiplicativePriceSeasonality::seasonalityFactor(const Date &to) const {

        Date from = seasonalityBaseDate();
        ....
            Integer diffDays = abs(to - from);  // in days

Error:

"/home/nir/tmp/unchecked/QuantLib-1.0.1/ql/termstructures/inflation/seasonality.cpp", line 151: Error: Overloading ambiguity between "std::abs(double)" and "std::abs(float)".
1 Error(s) detected.
*** Error code 1

I resolved this ambiguity by casting the operand to "double", so that it take std::abs(double):

            Integer diffDays = abs((double)(to - from));  // in days


2.) and 3.):

The compiler complains that the "operand--" must have a "lvalue" as an operand in
"ql/instruments/makecapfloor.cpp" and "ql/instruments/makeyoyinflationcapfloor.cpp".

Source (in "makecapfloor.cpp"):

      if (asOptionlet_ && leg.size() > 1)
                leg.erase(leg.begin(), --leg.end());
                 
Fix:

      if (asOptionlet_ && leg.size() > 1)
        {
                Leg::iterator tmp = leg.end();
                leg.erase(leg.begin(), --tmp);
        }




it looks very good now

-----Ursprüngliche Nachricht-----
Von: Luigi Ballabio [mailto:[hidden email]]
Gesendet: Mittwoch, 14. April 2010 17:55
An: Norbert Irmer
Betreff: ***UNCHECKED*** Re: AW: AW: AW: [Quantlib-dev] Quantlib with Sunstudio 12.1 on Solaris 2.10/Sparc

On Wed, 2010-04-14 at 17:48 +0200, Norbert Irmer wrote:
> Yes, would be nice.

Ok, please try the attached tarball.
Hopefully, it should compile without modifications.

Thanks,
        Luigi


--

Harrison's Postulate:
For every action, there is an equal and opposite criticism.

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev