Loading...
Home / Compilation error for OREData build

Home Forums Help Compilation error for OREData build

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #3692
    Anonymous
    Inactive

    hello
    Recently I have downloaded and try to build ore engine
    I have build successfully QuantLib and ORE-QuantExt with VC11 in release 64 mode
    When I tried to build OREData I am getting the following compilation errors attached below

    please advise
    Best
    Christos

    // Map form curveID to YieldCurveConfig
    using YieldCurveConfigMap = std::map<string, boost::shared_ptr<YieldCurveConfig> >;

    1>C:\GitHub\ORE_ENGINE1\ore_engine\OREData\ored/configuration/yieldcurveconfig.hpp(446): error C2143: syntax error : missing ‘;’ before ‘=’ (ored\configuration\yieldcurveconfig.cpp)
    1>C:\GitHub\ORE_ENGINE1\ore_engine\OREData\ored/configuration/yieldcurveconfig.hpp(446): error C2873: ‘YieldCurveConfigMap’ : symbol cannot be used in a using-declaration (ored\configuration\yieldcurveconfig.cpp)
    1>C:\GitHub\ORE_ENGINE1\ore_engine\OREData\ored/configuration/yieldcurveconfig.hpp(446): error C2513: ‘int’ : no variable declared before ‘=’ (ored\configuration\yieldcurveconfig.cpp)
    1>C:\GitHub\ORE_ENGINE1\ore_engine\OREData\ored/configuration/yieldcurveconfig.hpp(446): error C2143: syntax error : missing ‘;’ before ‘=’ (ored\configuration\curveconfigurations.cpp)
    1>C:\GitHub\ORE_ENGINE1\ore_engine\OREData\ored/configuration/yieldcurveconfig.hpp(446): error C2873: ‘YieldCurveConfigMap’ : symbol cannot be used in a using-declaration (ored\configuration\curveconfigurations.cpp)
    1>C:\GitHub\ORE_ENGINE1\ore_engine\OREData\ored/configuration/yieldcurveconfig.hpp(446): error C2513: ‘int’ : no variable declared before ‘=’ (ored\configuration\curveconfigurations.cpp)

    #3693
    Peter Caspers
    Keymaster

    Hi Christos,

    VC11 does not support C++11’s type aliases, the minimum requirement for building ORE is VC12. If you are tied to VC11 you can try to replace

    using YieldCurveConfigMap = std::map<string, boost::shared_ptr<YieldCurveConfig>>;

    by

    typedef std::map<string, boost::shared_ptr<YieldCurveConfig>> YieldCurveConfigMap;

    However note that there are more code lines like this where you will have to apply a similar patch. Please let us know if there are other problems showing up with VC11.

    Best Regards
    Peter

    #3694
    Anonymous
    Inactive

    Hi Peter
    I will try and revert
    Do you suggest to rebuild everything with VC14 MSVC 2015? (I don’t have MSVC 2013 VC12)
    Is there in VC a flag for C11 support?
    I will try to change the code as suggested (if I can manage and report back)
    Best
    Christos

    #3695
    Anonymous
    Inactive

    Hi Peter
    Maybe it seems to be hopeless
    I have tried and the next compilation error which comes about is at

    // Build the stripped caplet/floorlet surface
            // Hardcoded target volatility type to Normal - decision made to always work with a Normal optionlet surface
            boost::shared_ptr<OptionletStripper1> optionletStripper =
                boost::make_shared<OptionletStripper1>(capVol, iborIndex, Null<Rate>(), 1.0e-6, 100, discountCurve,
                                                       quoteVolatilityType, shift, false, Normal, 0.0);
    

    with error
    >ored\marketdata\capfloorvolcurve.cpp(154): error C2780: ‘boost::detail::sp_if_size_array<T>::type boost::make_shared(const boost::detail::array_inner<T>::type &)’ : expects 1 arguments – 11 provided
    1> C:\boost_1_58_0\boost/smart_ptr/make_shared_array.hpp(89) : see declaration of ‘boost::make_shared’

    Best
    Christos

    #3696
    Peter Caspers
    Keymaster

    Hi Christos,

    first of all here is an overview of the C++11 support in the different Visual Studio versions

    Support for C++11-14-17

    The first issue is related to the lack of “Alias Templates” support in VC11, the second to the lack of “Variadic Templates” support in VC11. Without variadic templates boost provides definitions of make_shared that take up to 10 parameters, in our case here we have 11. The workaround for this latter issue is to replace make_shared<T>(...) by boost::shared_ptr<T>(new T(...)).

    However if you have VC12 or VC14 available it would of course be much easier to use this instead, that should work out of the box.

    Best Regards
    Peter

    • This reply was modified 3 years, 11 months ago by Peter Caspers.
    • This reply was modified 3 years, 11 months ago by Peter Caspers.
    • This reply was modified 3 years, 11 months ago by Peter Caspers.
    • This reply was modified 3 years, 11 months ago by Peter Caspers.
    #3701
    Anonymous
    Inactive

    Hi Peter its indeed hopeless to correct the code!!!!!
    I will try to proceed by compiling all the libs boost included with VC 14 and revert back
    Thanks a lot for the advise
    Christos

    #3702
    Peter Caspers
    Keymaster

    Hi Christos,

    please do so and come back if there are any problems.

    I think it would not be too hard to backport the code so that it compiles with VC11 or even remove any of the C++11 features. But unless there is a serious demand for it we shouldn’t do it – note that this also affects what language features can be used in future extensions and contributions.

    Kind Regards
    Peter

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.