Tagged: VC11, Visual Studio 2012
- This topic has 6 replies, 2 voices, and was last updated 4 years, 4 months ago by
Peter Caspers.
-
AuthorPosts
-
October 23, 2016 at 9:36 am #3692
Anonymous
Inactivehello
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 belowplease 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)October 23, 2016 at 10:25 am #3693Peter Caspers
KeymasterHi 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
PeterOctober 23, 2016 at 2:04 pm #3694Anonymous
InactiveHi 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
ChristosOctober 23, 2016 at 2:24 pm #3695Anonymous
InactiveHi 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
ChristosOctober 23, 2016 at 4:10 pm #3696Peter Caspers
KeymasterHi Christos,
first of all here is an overview of the C++11 support in the different Visual Studio versions
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 replacemake_shared<T>(...)
byboost::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 4 years, 4 months ago by
Peter Caspers.
-
This reply was modified 4 years, 4 months ago by
Peter Caspers.
-
This reply was modified 4 years, 4 months ago by
Peter Caspers.
-
This reply was modified 4 years, 4 months ago by
Peter Caspers.
October 23, 2016 at 6:28 pm #3701Anonymous
InactiveHi 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
ChristosOctober 23, 2016 at 6:43 pm #3702Peter Caspers
KeymasterHi 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 -
This reply was modified 4 years, 4 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.