You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(18) |
Feb
(4) |
Mar
(6) |
Apr
(2) |
May
|
Jun
(12) |
Jul
(48) |
Aug
(6) |
Sep
(3) |
Oct
(24) |
Nov
(15) |
Dec
(18) |
| 2002 |
Jan
(39) |
Feb
(12) |
Mar
(80) |
Apr
(72) |
May
(46) |
Jun
(27) |
Jul
(23) |
Aug
(34) |
Sep
(65) |
Oct
(71) |
Nov
(19) |
Dec
(14) |
| 2003 |
Jan
(44) |
Feb
(59) |
Mar
(18) |
Apr
(62) |
May
(54) |
Jun
(27) |
Jul
(46) |
Aug
(15) |
Sep
(44) |
Oct
(36) |
Nov
(19) |
Dec
(12) |
| 2004 |
Jan
(26) |
Feb
(33) |
Mar
(47) |
Apr
(63) |
May
(36) |
Jun
(65) |
Jul
(80) |
Aug
(163) |
Sep
(65) |
Oct
(39) |
Nov
(36) |
Dec
(39) |
| 2005 |
Jan
(97) |
Feb
(78) |
Mar
(64) |
Apr
(64) |
May
(48) |
Jun
(55) |
Jul
(89) |
Aug
(57) |
Sep
(51) |
Oct
(111) |
Nov
(86) |
Dec
(76) |
| 2006 |
Jan
(84) |
Feb
(103) |
Mar
(143) |
Apr
(92) |
May
(55) |
Jun
(58) |
Jul
(71) |
Aug
(57) |
Sep
(74) |
Oct
(59) |
Nov
(8) |
Dec
(32) |
| 2007 |
Jan
(60) |
Feb
(40) |
Mar
(50) |
Apr
(26) |
May
(61) |
Jun
(120) |
Jul
(119) |
Aug
(48) |
Sep
(121) |
Oct
(66) |
Nov
(103) |
Dec
(43) |
| 2008 |
Jan
(60) |
Feb
(109) |
Mar
(92) |
Apr
(106) |
May
(82) |
Jun
(59) |
Jul
(67) |
Aug
(118) |
Sep
(131) |
Oct
(56) |
Nov
(37) |
Dec
(69) |
| 2009 |
Jan
(75) |
Feb
(76) |
Mar
(103) |
Apr
(78) |
May
(61) |
Jun
(35) |
Jul
(66) |
Aug
(69) |
Sep
(166) |
Oct
(46) |
Nov
(72) |
Dec
(65) |
| 2010 |
Jan
(48) |
Feb
(57) |
Mar
(93) |
Apr
(85) |
May
(123) |
Jun
(82) |
Jul
(98) |
Aug
(121) |
Sep
(146) |
Oct
(86) |
Nov
(72) |
Dec
(34) |
| 2011 |
Jan
(96) |
Feb
(55) |
Mar
(73) |
Apr
(57) |
May
(33) |
Jun
(74) |
Jul
(89) |
Aug
(71) |
Sep
(103) |
Oct
(76) |
Nov
(52) |
Dec
(61) |
| 2012 |
Jan
(48) |
Feb
(54) |
Mar
(78) |
Apr
(60) |
May
(75) |
Jun
(59) |
Jul
(33) |
Aug
(66) |
Sep
(43) |
Oct
(46) |
Nov
(75) |
Dec
(51) |
| 2013 |
Jan
(112) |
Feb
(72) |
Mar
(49) |
Apr
(48) |
May
(42) |
Jun
(44) |
Jul
(80) |
Aug
(19) |
Sep
(33) |
Oct
(37) |
Nov
(38) |
Dec
(98) |
| 2014 |
Jan
(113) |
Feb
(93) |
Mar
(49) |
Apr
(106) |
May
(97) |
Jun
(155) |
Jul
(87) |
Aug
(127) |
Sep
(85) |
Oct
(48) |
Nov
(41) |
Dec
(37) |
| 2015 |
Jan
(34) |
Feb
(50) |
Mar
(104) |
Apr
(80) |
May
(82) |
Jun
(66) |
Jul
(41) |
Aug
(84) |
Sep
(37) |
Oct
(65) |
Nov
(83) |
Dec
(52) |
| 2016 |
Jan
(68) |
Feb
(35) |
Mar
(42) |
Apr
(35) |
May
(54) |
Jun
(75) |
Jul
(45) |
Aug
(52) |
Sep
(60) |
Oct
(52) |
Nov
(36) |
Dec
(64) |
| 2017 |
Jan
(92) |
Feb
(59) |
Mar
(35) |
Apr
(53) |
May
(83) |
Jun
(43) |
Jul
(65) |
Aug
(68) |
Sep
(46) |
Oct
(75) |
Nov
(40) |
Dec
(49) |
| 2018 |
Jan
(68) |
Feb
(54) |
Mar
(48) |
Apr
(58) |
May
(51) |
Jun
(44) |
Jul
(40) |
Aug
(68) |
Sep
(35) |
Oct
(15) |
Nov
(7) |
Dec
(37) |
| 2019 |
Jan
(43) |
Feb
(7) |
Mar
(22) |
Apr
(21) |
May
(31) |
Jun
(39) |
Jul
(73) |
Aug
(45) |
Sep
(47) |
Oct
(89) |
Nov
(19) |
Dec
(69) |
| 2020 |
Jan
(52) |
Feb
(63) |
Mar
(45) |
Apr
(59) |
May
(42) |
Jun
(57) |
Jul
(30) |
Aug
(29) |
Sep
(75) |
Oct
(64) |
Nov
(96) |
Dec
(22) |
| 2021 |
Jan
(14) |
Feb
(24) |
Mar
(35) |
Apr
(58) |
May
(36) |
Jun
(15) |
Jul
(18) |
Aug
(31) |
Sep
(30) |
Oct
(33) |
Nov
(27) |
Dec
(16) |
| 2022 |
Jan
(35) |
Feb
(22) |
Mar
(14) |
Apr
(20) |
May
(44) |
Jun
(53) |
Jul
(25) |
Aug
(56) |
Sep
(11) |
Oct
(47) |
Nov
(22) |
Dec
(36) |
| 2023 |
Jan
(30) |
Feb
(17) |
Mar
(31) |
Apr
(48) |
May
(31) |
Jun
(7) |
Jul
(25) |
Aug
(26) |
Sep
(61) |
Oct
(66) |
Nov
(19) |
Dec
(21) |
| 2024 |
Jan
(37) |
Feb
(29) |
Mar
(26) |
Apr
(26) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(13) |
Sep
(15) |
Oct
(25) |
Nov
(13) |
Dec
(8) |
| 2025 |
Jan
(13) |
Feb
(1) |
Mar
(16) |
Apr
(17) |
May
(8) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(6) |
Oct
(15) |
Nov
(6) |
Dec
|
| 2026 |
Jan
(6) |
Feb
(4) |
Mar
(20) |
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Ashish B. <ash...@gm...> - 2022-05-30 14:09:25
|
Thanks for the responses. I am trying various papers to find the moment matching for the asian options. I did find the calculation based on Turnbull-Wakeman model here: https://osf.io/efq6a/download I tried this but did not get good results for options expiring in a few months. I will try some other source probably. One last question, does QL's FdBlackScholesAsianengine with DiscreteAveragingAsianOption adjust the valuation for trade which are in between the averaging period; as mentioned on slide # 9 and 10 of this deck? Regards, Ashish On Thu, 26 May 2022 at 13:24, Luigi Ballabio <lui...@gm...> wrote: > I mean that the two engines give the same price, i.e. 6.09. I don't have > info on moment matching. > > On Wed, May 25, 2022 at 6:51 PM Ashish Bansal <ash...@gm...> > wrote: > >> By same price, you mean same as exchange i.e. 4.57. or same as aRA >> parameter i.e. 6.09? >> >> Any guidance on moment matching? I could not find anything online about >> it. >> >> Regards >> Ashish >> >> On Wed, May 25, 2022, 7:02 PM Luigi Ballabio <lui...@gm...> >> wrote: >> >>> Hi, >>> no, the engine doesn't do moment matching. I don't think we have >>> something ready to use for that in the library. >>> As for the accumulator: I confirm it's the sum. If you create a virtual >>> Python environment and install the latest QuantLib in it, you can try your >>> shortened code with the other constructor for the Asian option (the one >>> taking the list of fixings). It returns the same price. >>> >>> Luigi >>> >>> >>> On Wed, May 25, 2022 at 2:46 PM Ashish Bansal <ash...@gm...> >>> wrote: >>> >>>> Hi Luigi, >>>> >>>> One question about the QL calculation: Does QL code for the Asian >>>> option include *moment matching *of the volatility or do we need to do >>>> that before passing to the DiscAvAsOption? >>>> >>>> Regarding the code, I had attached the full code from our system in my >>>> previous email, attaching here too. The shortened version of the code, >>>> containing only the QL interaction and excluding excess processing, is also >>>> attached here. It includes the trade parameters we are using to evaluate >>>> the Asian option. Strangely, the value is coming zero with short-code but >>>> with full code in our system, we are getting the values. >>>> >>>> Following is the NPV that we are getting in our system (using full >>>> code) for our trade which has averaging period from 1st March to 31st March >>>> 2022 and the market traded premium of 4.56: >>>> arithmeticRunningAccumulator NPV >>>> 0 4.5711 >>>> 1302.88 6.09 >>>> >>>> Thanks in advance for help. >>>> >>>> PS: We are using QL1.17 and the vols are sourced from Reuters could be >>>> different from implied in the market traded premium. >>>> >>>> Regards, >>>> Ashish >>>> >>>> On Mon, 23 May 2022 at 22:26, Luigi Ballabio <lui...@gm...> >>>> wrote: >>>> >>>>> May you send sample code and the value of the fixings for one of those >>>>> options? Thanks! >>>>> >>>>> Luigi >>>>> >>>>> >>>>> On Mon, May 23, 2022 at 8:32 AM Ashish Bansal <ash...@gm...> >>>>> wrote: >>>>> >>>>>> Luigi, >>>>>> >>>>>> We ran the asian code, which i sent earlier for a couple of asian >>>>>> options traded on exchange. We got prices very close to traded prices when >>>>>> we used the value of running accumulator as 1 for march option being valued >>>>>> on 17th with past fixing count as 12. But when we used the sum of past >>>>>> fixing prices i.e. 1302.88 we got a very different number like 6.09 against >>>>>> 4.57 earlier and 14.11 against 12.39 earlier. >>>>>> >>>>>> Just want to confirm if i am missing something about running >>>>>> accumulator and should it be really the sum of all past fixings? >>>>>> >>>>>> Thanks for help in advance. >>>>>> Ashish >>>>>> >>>>>> On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...> >>>>>> wrote: >>>>>> >>>>>>> Ok understood. thanks. >>>>>>> >>>>>>> On Fri, 20 May 2022 at 14:46, Luigi Ballabio < >>>>>>> lui...@gm...> wrote: >>>>>>> >>>>>>>> It would be the sum of past fixings; for three past fixings of >>>>>>>> 100.2, 101.3 and 94.6 it would be 296.1. >>>>>>>> >>>>>>>> Luigi >>>>>>>> >>>>>>>> >>>>>>>> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal < >>>>>>>> ash...@gm...> wrote: >>>>>>>> >>>>>>>>> Thanks, Luigi for the suggestion. After taking the running >>>>>>>>> accumulator, we are able to generate the numbers. What exactly should be >>>>>>>>> passed here? The average price of past fixings or just 1 when the trade is >>>>>>>>> priced during averaging period? >>>>>>>>> >>>>>>>>> Thanks for help. >>>>>>>>> >>>>>>>>> Ashish >>>>>>>>> >>>>>>>>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio < >>>>>>>>> lui...@gm...> wrote: >>>>>>>>> >>>>>>>>>> I don't have a 1.7 version to try it, but the check is the one at >>>>>>>>>> < >>>>>>>>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>>>>>>>>> suggesting that your running accumulator should be 0 (which makes sense, >>>>>>>>>> because you're using arithmetic average, i.e., a sum, and if you don't have >>>>>>>>>> any fixings yet the sum should be 0.) >>>>>>>>>> Your default seems to be 1 instead. >>>>>>>>>> >>>>>>>>>> Luigi >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal < >>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>> >>>>>>>>>>> Luigi, >>>>>>>>>>> >>>>>>>>>>> Our code is not too much but we are using deprecated functions >>>>>>>>>>> like FDEuropeanEngine and FDAmericanEngine. Not sure if using >>>>>>>>>>> new function called FdBlackScholesVanillaEngine has any change >>>>>>>>>>> in the calculation that our code will have an impact. >>>>>>>>>>> >>>>>>>>>>> Can we use the DiscreteAveragingAsianOption without the >>>>>>>>>>> overloaded parameter of pastfixings under 1.7? >>>>>>>>>>> >>>>>>>>>>> Ashish >>>>>>>>>>> >>>>>>>>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio < >>>>>>>>>>> lui...@gm...> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi — it could be. Any particular reason you're still using a >>>>>>>>>>>> version from 4 years ago? If you have a substantial amount of code that >>>>>>>>>>>> depends on QuantLib, it might require some work to update because some >>>>>>>>>>>> methods were deprecated and then removed in the meantime; and of course >>>>>>>>>>>> you'll probably have some validation process in place when updating, so >>>>>>>>>>>> that's work too. But on the other hand, you're missing 4 years worth of >>>>>>>>>>>> bug fixings... >>>>>>>>>>>> >>>>>>>>>>>> Luigi >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal < >>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> We tried again and got the same error. >>>>>>>>>>>>> >>>>>>>>>>>>> Could it be due to the old version (1.7) we are using? I see >>>>>>>>>>>>> in the release notes of Apr-2021 that the overload for past fixing was >>>>>>>>>>>>> added: >>>>>>>>>>>>> >>>>>>>>>>>>> - Added an overloaded constructor for Asian options that >>>>>>>>>>>>> takes all past fixings and thus allows to reprice them correctly when the >>>>>>>>>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>>>>>>>>> >>>>>>>>>>>>> Ashish >>>>>>>>>>>>> >>>>>>>>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>>>>>>>>> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>>>> >>>>>>>>>>>>>> I have a better answer for you with a screenshot awaiting >>>>>>>>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your >>>>>>>>>>>>>> code without problems using the python at the bottom of this email >>>>>>>>>>>>>> (although I didn't check the numbers). >>>>>>>>>>>>>> >>>>>>>>>>>>>> If there is something you're doing specifically to generate >>>>>>>>>>>>>> the error, could you please attach a minimal reproduction of it? >>>>>>>>>>>>>> >>>>>>>>>>>>>> Best, >>>>>>>>>>>>>> Jack >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> import QuantLib as ql >>>>>>>>>>>>>> from copy import deepcopy >>>>>>>>>>>>>> from datetime import datetime >>>>>>>>>>>>>> from datetime import timedelta >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>>>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>>>>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>>>>>>>>> DEFAULT_tGRID = 100 >>>>>>>>>>>>>> DEFAULT_xGRID = 100 >>>>>>>>>>>>>> DEFAULT_aGRID = 50 >>>>>>>>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>>>>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> class AsianOptionPrice: >>>>>>>>>>>>>> def __init__(self, **x): >>>>>>>>>>>>>> for k, v in x.items(): >>>>>>>>>>>>>> setattr(self, k, v) >>>>>>>>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>>>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>>>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>>>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>>>>>>>>> self.pastFixings = x.get("pastFixings", >>>>>>>>>>>>>> DEFAULT_PASTFIXINGS) >>>>>>>>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", >>>>>>>>>>>>>> DEFAULT_aRA) >>>>>>>>>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>>>>>>>>> self.dist = 10**(-2) >>>>>>>>>>>>>> self.date_format = "%d-%m-%Y" >>>>>>>>>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>>>>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>>>>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>>>>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>>>>>>>>> ql.Settings.instance().evaluationDate = >>>>>>>>>>>>>> self.value_date >>>>>>>>>>>>>> self.exDay = >>>>>>>>>>>>>> ql.DateParser.parseFormatted(self.expiryDate, '%d-%m-%Y') >>>>>>>>>>>>>> # Volatility input is required for running the >>>>>>>>>>>>>> computing implied volatility function. This volatility is NOT used in the >>>>>>>>>>>>>> implied volatility calculation. >>>>>>>>>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>>>>>>>>> self.IV = None >>>>>>>>>>>>>> >>>>>>>>>>>>>> def >>>>>>>>>>>>>> generate_fixture_dates(self,start_date,end_date,period): >>>>>>>>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, >>>>>>>>>>>>>> period) >>>>>>>>>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>>>>>>>>> _date.weekday() not in [1,7]] >>>>>>>>>>>>>> return fixture_dates >>>>>>>>>>>>>> def asian(self): >>>>>>>>>>>>>> """ >>>>>>>>>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>>>>>>>>> """ >>>>>>>>>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>>>>>>>>> pastFixings = self.pastFixings >>>>>>>>>>>>>> print(pastFixings) >>>>>>>>>>>>>> option_type = self.optionType.lower() >>>>>>>>>>>>>> if option_type not in ["call", "put"]: >>>>>>>>>>>>>> raise Exception( >>>>>>>>>>>>>> f"Option Type is Neither Call nor Put, Option >>>>>>>>>>>>>> type is {option_type}") >>>>>>>>>>>>>> option_type = ql.Option.Call if option_type == "call" >>>>>>>>>>>>>> else ql.Option.Put >>>>>>>>>>>>>> strike = self.strikePrice >>>>>>>>>>>>>> today = self.value_date >>>>>>>>>>>>>> print(today) >>>>>>>>>>>>>> fixingStartDate >>>>>>>>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>>>>>>>>> print("#"*40,fixingStartDate) >>>>>>>>>>>>>> periods = self.periods >>>>>>>>>>>>>> asianFutureFixingDates = >>>>>>>>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>>>>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>>>>>>>>> asianExpiryDate = self.expiry_date >>>>>>>>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, >>>>>>>>>>>>>> strike) >>>>>>>>>>>>>> europeanExercise = >>>>>>>>>>>>>> ql.EuropeanExercise(asianExpiryDate) >>>>>>>>>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>>>>>>>>> discreteArithmeticAsianOption = >>>>>>>>>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>>>>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>>>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>>>>>>>>> return discreteArithmeticAsianOption >>>>>>>>>>>>>> >>>>>>>>>>>>>> def create_arg_list(self, Option=None, >>>>>>>>>>>>>> compute_implied_vol=None, implied_vol_am_put=None): >>>>>>>>>>>>>> ''' >>>>>>>>>>>>>> The arguments with disturbances added. Will be >>>>>>>>>>>>>> used for calculation of Greeks >>>>>>>>>>>>>> using numerical differentiation. >>>>>>>>>>>>>> Creating a dictionary of arguments that will be >>>>>>>>>>>>>> used for option price and greeks calculation. >>>>>>>>>>>>>> ''' >>>>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>>>>>> originalDict_ = {k: getattr(self, k) for k in >>>>>>>>>>>>>> self.keyList} >>>>>>>>>>>>>> ListDict = [] >>>>>>>>>>>>>> for i in range(4): >>>>>>>>>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>>>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + >>>>>>>>>>>>>> self.dist >>>>>>>>>>>>>> ListDict[2]['volatility'] = self.volatility + >>>>>>>>>>>>>> self.dist >>>>>>>>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>>>>>>>>> self.expiryDate, self.date_format) - >>>>>>>>>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>>>>>>>>> print(ListDict) >>>>>>>>>>>>>> return(ListDict) >>>>>>>>>>>>>> >>>>>>>>>>>>>> def bs_process(self, create_process_for_iv=None, >>>>>>>>>>>>>> use_IV=None): >>>>>>>>>>>>>> """ >>>>>>>>>>>>>> Creating the Black-Scholes process for option >>>>>>>>>>>>>> valuation. >>>>>>>>>>>>>> """ >>>>>>>>>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>>>>>>>>> ql.FlatForward(self.value_date, >>>>>>>>>>>>>> self.riskFreeRate, ql.Actual365Fixed())) >>>>>>>>>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>>>>>>>>> ql.FlatForward(self.value_date, 0, >>>>>>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>>>>>> volatility = >>>>>>>>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>>>>>>>>> self.value_date, ql.NullCalendar(), >>>>>>>>>>>>>> self.volatility, ql.Actual365Fixed())) >>>>>>>>>>>>>> initialValue = >>>>>>>>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>>>>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>>>>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>>>>>>>>> return(process) >>>>>>>>>>>>>> >>>>>>>>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>>>>>>>>> """ >>>>>>>>>>>>>> Call the relevant option based on the input. >>>>>>>>>>>>>> """ >>>>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>>>>>> res = None >>>>>>>>>>>>>> option = AsianOptionPrice.asian(self) >>>>>>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>>>>>> # create Black Scholes process using IV. >>>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>>> self, create_process_for_iv=False, >>>>>>>>>>>>>> use_IV=True) >>>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>>>>>> res = {'value': option.NPV(), >>>>>>>>>>>>>> 'impliedVolatility': self.IV} >>>>>>>>>>>>>> else: >>>>>>>>>>>>>> # Create Black Scholes process using HV. >>>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>>> self, create_process_for_iv=False, >>>>>>>>>>>>>> use_IV=False) >>>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>>>>>> res = {'value': option.NPV()} >>>>>>>>>>>>>> return res >>>>>>>>>>>>>> >>>>>>>>>>>>>> def evaluate_asian_npv(self): >>>>>>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>>>>>> res = Option.NPV() >>>>>>>>>>>>>> return(res) >>>>>>>>>>>>>> >>>>>>>>>>>>>> def calculate_greeks(self, Option=None, >>>>>>>>>>>>>> compute_implied_vol=None): >>>>>>>>>>>>>> today = self.value_date >>>>>>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>>> self, create_process_for_iv=False, >>>>>>>>>>>>>> use_IV=True) >>>>>>>>>>>>>> else: >>>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>>> self, create_process_for_iv=False, >>>>>>>>>>>>>> use_IV=False) >>>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>>>>>>>>> Option.gamma( >>>>>>>>>>>>>> )} >>>>>>>>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>>>>>>>>> self, Option, compute_implied_vol=True, >>>>>>>>>>>>>> implied_vol_am_put=self.volatility) >>>>>>>>>>>>>> DisturbedPrices = [] >>>>>>>>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>>>>>>>>> for i in range(4): >>>>>>>>>>>>>> DisturbedPrices.append(eval( >>>>>>>>>>>>>> >>>>>>>>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>>>>>>>>> print(DisturbedPrices) >>>>>>>>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>>>>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>>>>>> thetaDay = (PricesDistrbd['PTup'] - >>>>>>>>>>>>>> PricesDistrbd['Price']) >>>>>>>>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, >>>>>>>>>>>>>> 'theta': thetaDay}) >>>>>>>>>>>>>> return option_greeks_ >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> settings = { >>>>>>>>>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>>>>>>>>> "tenantId": "380", >>>>>>>>>>>>>> "gridPoints": 149, >>>>>>>>>>>>>> "computeImpliedVolatiltiy": False, >>>>>>>>>>>>>> "runId": 3735, >>>>>>>>>>>>>> "timeSteps": 150, >>>>>>>>>>>>>> "optionTrades": [ >>>>>>>>>>>>>> { >>>>>>>>>>>>>> "underlyingPrice": 98.69, >>>>>>>>>>>>>> "refNo": "OPT-1135-GVA", >>>>>>>>>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>>>>>>>>> "valueDate": "17-03-2022", >>>>>>>>>>>>>> "fixingStartDate":"01-05-2022", >>>>>>>>>>>>>> "pastFixings":0, >>>>>>>>>>>>>> "volatility": 0.6015, >>>>>>>>>>>>>> "openQuantity": 1, >>>>>>>>>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>>>>>>>>> "optionType": "Call", >>>>>>>>>>>>>> "expiryDate": "31-05-2022", >>>>>>>>>>>>>> "exType": "asian", >>>>>>>>>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>>>>>>>>> "premium": 1, >>>>>>>>>>>>>> "portfolioId": 18209, >>>>>>>>>>>>>> "marketPremium": 11.42, >>>>>>>>>>>>>> "longShort": "Long", >>>>>>>>>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>>>>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>>>>>>>>> "portfolioName": "Option Trades", >>>>>>>>>>>>>> "scenarioId": 8356, >>>>>>>>>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>>>>>>>>> "strikePrice": 95, >>>>>>>>>>>>>> "maturityInYears": 0.205479452 >>>>>>>>>>>>>> } >>>>>>>>>>>>>> ], >>>>>>>>>>>>>> "userId": "5263", >>>>>>>>>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>>>>>>>>> } >>>>>>>>>>>>>> >>>>>>>>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>>>>>>>>> opt.evaluate_asian_npv() >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Hi Jack, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Please find attached the Asian option python code and the >>>>>>>>>>>>>>> option trade payload. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Thanks for your help, >>>>>>>>>>>>>>> Regards, >>>>>>>>>>>>>>> Ashish >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G < >>>>>>>>>>>>>>> jac...@gm...> wrote: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> I've just lifted the examples from your references directly >>>>>>>>>>>>>>>> for a discrete arithmetic Asian using the FD Asian engine and it is working >>>>>>>>>>>>>>>> for me - can you share the code you are using that breaks please? >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Best, >>>>>>>>>>>>>>>> Jack >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, < >>>>>>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Hi all, >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>>>>>>>>> "QuantLib Error - Running average requires at least one >>>>>>>>>>>>>>>>> past fixing" >>>>>>>>>>>>>>>>> ref: >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Queries: >>>>>>>>>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>>>>>>>>> 2. For trade which is mid of averaging and has few past >>>>>>>>>>>>>>>>> fixings, do we need to pass the count of past fixing or the actual rates of >>>>>>>>>>>>>>>>> the pastfixing as an array? >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Any help will be appreciated. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> Thanks in advance >>>>>>>>>>>>>>>>> Ashish >>>>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>>>>>>> Qua...@li... >>>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>>> Qua...@li... >>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>>> >>>>>>>>>>>> |
|
From: Luigi B. <lui...@gm...> - 2022-05-26 07:54:16
|
I mean that the two engines give the same price, i.e. 6.09. I don't have info on moment matching. On Wed, May 25, 2022 at 6:51 PM Ashish Bansal <ash...@gm...> wrote: > By same price, you mean same as exchange i.e. 4.57. or same as aRA > parameter i.e. 6.09? > > Any guidance on moment matching? I could not find anything online about it. > > Regards > Ashish > > On Wed, May 25, 2022, 7:02 PM Luigi Ballabio <lui...@gm...> > wrote: > >> Hi, >> no, the engine doesn't do moment matching. I don't think we have >> something ready to use for that in the library. >> As for the accumulator: I confirm it's the sum. If you create a virtual >> Python environment and install the latest QuantLib in it, you can try your >> shortened code with the other constructor for the Asian option (the one >> taking the list of fixings). It returns the same price. >> >> Luigi >> >> >> On Wed, May 25, 2022 at 2:46 PM Ashish Bansal <ash...@gm...> >> wrote: >> >>> Hi Luigi, >>> >>> One question about the QL calculation: Does QL code for the Asian option >>> include *moment matching *of the volatility or do we need to do that >>> before passing to the DiscAvAsOption? >>> >>> Regarding the code, I had attached the full code from our system in my >>> previous email, attaching here too. The shortened version of the code, >>> containing only the QL interaction and excluding excess processing, is also >>> attached here. It includes the trade parameters we are using to evaluate >>> the Asian option. Strangely, the value is coming zero with short-code but >>> with full code in our system, we are getting the values. >>> >>> Following is the NPV that we are getting in our system (using full code) >>> for our trade which has averaging period from 1st March to 31st March 2022 >>> and the market traded premium of 4.56: >>> arithmeticRunningAccumulator NPV >>> 0 4.5711 >>> 1302.88 6.09 >>> >>> Thanks in advance for help. >>> >>> PS: We are using QL1.17 and the vols are sourced from Reuters could be >>> different from implied in the market traded premium. >>> >>> Regards, >>> Ashish >>> >>> On Mon, 23 May 2022 at 22:26, Luigi Ballabio <lui...@gm...> >>> wrote: >>> >>>> May you send sample code and the value of the fixings for one of those >>>> options? Thanks! >>>> >>>> Luigi >>>> >>>> >>>> On Mon, May 23, 2022 at 8:32 AM Ashish Bansal <ash...@gm...> >>>> wrote: >>>> >>>>> Luigi, >>>>> >>>>> We ran the asian code, which i sent earlier for a couple of asian >>>>> options traded on exchange. We got prices very close to traded prices when >>>>> we used the value of running accumulator as 1 for march option being valued >>>>> on 17th with past fixing count as 12. But when we used the sum of past >>>>> fixing prices i.e. 1302.88 we got a very different number like 6.09 against >>>>> 4.57 earlier and 14.11 against 12.39 earlier. >>>>> >>>>> Just want to confirm if i am missing something about running >>>>> accumulator and should it be really the sum of all past fixings? >>>>> >>>>> Thanks for help in advance. >>>>> Ashish >>>>> >>>>> On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...> >>>>> wrote: >>>>> >>>>>> Ok understood. thanks. >>>>>> >>>>>> On Fri, 20 May 2022 at 14:46, Luigi Ballabio < >>>>>> lui...@gm...> wrote: >>>>>> >>>>>>> It would be the sum of past fixings; for three past fixings of >>>>>>> 100.2, 101.3 and 94.6 it would be 296.1. >>>>>>> >>>>>>> Luigi >>>>>>> >>>>>>> >>>>>>> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal < >>>>>>> ash...@gm...> wrote: >>>>>>> >>>>>>>> Thanks, Luigi for the suggestion. After taking the running >>>>>>>> accumulator, we are able to generate the numbers. What exactly should be >>>>>>>> passed here? The average price of past fixings or just 1 when the trade is >>>>>>>> priced during averaging period? >>>>>>>> >>>>>>>> Thanks for help. >>>>>>>> >>>>>>>> Ashish >>>>>>>> >>>>>>>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio < >>>>>>>> lui...@gm...> wrote: >>>>>>>> >>>>>>>>> I don't have a 1.7 version to try it, but the check is the one at < >>>>>>>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>>>>>>>> suggesting that your running accumulator should be 0 (which makes sense, >>>>>>>>> because you're using arithmetic average, i.e., a sum, and if you don't have >>>>>>>>> any fixings yet the sum should be 0.) >>>>>>>>> Your default seems to be 1 instead. >>>>>>>>> >>>>>>>>> Luigi >>>>>>>>> >>>>>>>>> >>>>>>>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal < >>>>>>>>> ash...@gm...> wrote: >>>>>>>>> >>>>>>>>>> Luigi, >>>>>>>>>> >>>>>>>>>> Our code is not too much but we are using deprecated functions >>>>>>>>>> like FDEuropeanEngine and FDAmericanEngine. Not sure if using >>>>>>>>>> new function called FdBlackScholesVanillaEngine has any change >>>>>>>>>> in the calculation that our code will have an impact. >>>>>>>>>> >>>>>>>>>> Can we use the DiscreteAveragingAsianOption without the >>>>>>>>>> overloaded parameter of pastfixings under 1.7? >>>>>>>>>> >>>>>>>>>> Ashish >>>>>>>>>> >>>>>>>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio < >>>>>>>>>> lui...@gm...> wrote: >>>>>>>>>> >>>>>>>>>>> Hi — it could be. Any particular reason you're still using a >>>>>>>>>>> version from 4 years ago? If you have a substantial amount of code that >>>>>>>>>>> depends on QuantLib, it might require some work to update because some >>>>>>>>>>> methods were deprecated and then removed in the meantime; and of course >>>>>>>>>>> you'll probably have some validation process in place when updating, so >>>>>>>>>>> that's work too. But on the other hand, you're missing 4 years worth of >>>>>>>>>>> bug fixings... >>>>>>>>>>> >>>>>>>>>>> Luigi >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal < >>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>> >>>>>>>>>>>> We tried again and got the same error. >>>>>>>>>>>> >>>>>>>>>>>> Could it be due to the old version (1.7) we are using? I see in >>>>>>>>>>>> the release notes of Apr-2021 that the overload for past fixing was added: >>>>>>>>>>>> >>>>>>>>>>>> - Added an overloaded constructor for Asian options that >>>>>>>>>>>> takes all past fixings and thus allows to reprice them correctly when the >>>>>>>>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>>>>>>>> >>>>>>>>>>>> Ashish >>>>>>>>>>>> >>>>>>>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>>>>>>>> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>>> >>>>>>>>>>>>> I have a better answer for you with a screenshot awaiting >>>>>>>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your >>>>>>>>>>>>> code without problems using the python at the bottom of this email >>>>>>>>>>>>> (although I didn't check the numbers). >>>>>>>>>>>>> >>>>>>>>>>>>> If there is something you're doing specifically to generate >>>>>>>>>>>>> the error, could you please attach a minimal reproduction of it? >>>>>>>>>>>>> >>>>>>>>>>>>> Best, >>>>>>>>>>>>> Jack >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> import QuantLib as ql >>>>>>>>>>>>> from copy import deepcopy >>>>>>>>>>>>> from datetime import datetime >>>>>>>>>>>>> from datetime import timedelta >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>>>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>>>>>>>> DEFAULT_tGRID = 100 >>>>>>>>>>>>> DEFAULT_xGRID = 100 >>>>>>>>>>>>> DEFAULT_aGRID = 50 >>>>>>>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>>>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> class AsianOptionPrice: >>>>>>>>>>>>> def __init__(self, **x): >>>>>>>>>>>>> for k, v in x.items(): >>>>>>>>>>>>> setattr(self, k, v) >>>>>>>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>>>>>>>> self.pastFixings = x.get("pastFixings", >>>>>>>>>>>>> DEFAULT_PASTFIXINGS) >>>>>>>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", >>>>>>>>>>>>> DEFAULT_aRA) >>>>>>>>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>>>>>>>> self.dist = 10**(-2) >>>>>>>>>>>>> self.date_format = "%d-%m-%Y" >>>>>>>>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>>>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>>>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>>>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>>>>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>>>>>>>>> self.exDay = >>>>>>>>>>>>> ql.DateParser.parseFormatted(self.expiryDate, '%d-%m-%Y') >>>>>>>>>>>>> # Volatility input is required for running the >>>>>>>>>>>>> computing implied volatility function. This volatility is NOT used in the >>>>>>>>>>>>> implied volatility calculation. >>>>>>>>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>>>>>>>> self.IV = None >>>>>>>>>>>>> >>>>>>>>>>>>> def >>>>>>>>>>>>> generate_fixture_dates(self,start_date,end_date,period): >>>>>>>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, >>>>>>>>>>>>> period) >>>>>>>>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>>>>>>>> _date.weekday() not in [1,7]] >>>>>>>>>>>>> return fixture_dates >>>>>>>>>>>>> def asian(self): >>>>>>>>>>>>> """ >>>>>>>>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>>>>>>>> """ >>>>>>>>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>>>>>>>> pastFixings = self.pastFixings >>>>>>>>>>>>> print(pastFixings) >>>>>>>>>>>>> option_type = self.optionType.lower() >>>>>>>>>>>>> if option_type not in ["call", "put"]: >>>>>>>>>>>>> raise Exception( >>>>>>>>>>>>> f"Option Type is Neither Call nor Put, Option >>>>>>>>>>>>> type is {option_type}") >>>>>>>>>>>>> option_type = ql.Option.Call if option_type == "call" >>>>>>>>>>>>> else ql.Option.Put >>>>>>>>>>>>> strike = self.strikePrice >>>>>>>>>>>>> today = self.value_date >>>>>>>>>>>>> print(today) >>>>>>>>>>>>> fixingStartDate >>>>>>>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>>>>>>>> print("#"*40,fixingStartDate) >>>>>>>>>>>>> periods = self.periods >>>>>>>>>>>>> asianFutureFixingDates = >>>>>>>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>>>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>>>>>>>> asianExpiryDate = self.expiry_date >>>>>>>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, >>>>>>>>>>>>> strike) >>>>>>>>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>>>>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>>>>>>>> discreteArithmeticAsianOption = >>>>>>>>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>>>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>>>>>>>> return discreteArithmeticAsianOption >>>>>>>>>>>>> >>>>>>>>>>>>> def create_arg_list(self, Option=None, >>>>>>>>>>>>> compute_implied_vol=None, implied_vol_am_put=None): >>>>>>>>>>>>> ''' >>>>>>>>>>>>> The arguments with disturbances added. Will be >>>>>>>>>>>>> used for calculation of Greeks >>>>>>>>>>>>> using numerical differentiation. >>>>>>>>>>>>> Creating a dictionary of arguments that will be >>>>>>>>>>>>> used for option price and greeks calculation. >>>>>>>>>>>>> ''' >>>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>>>>> originalDict_ = {k: getattr(self, k) for k in >>>>>>>>>>>>> self.keyList} >>>>>>>>>>>>> ListDict = [] >>>>>>>>>>>>> for i in range(4): >>>>>>>>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + >>>>>>>>>>>>> self.dist >>>>>>>>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>>>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>>>>>>>> self.expiryDate, self.date_format) - >>>>>>>>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>>>>>>>> print(ListDict) >>>>>>>>>>>>> return(ListDict) >>>>>>>>>>>>> >>>>>>>>>>>>> def bs_process(self, create_process_for_iv=None, >>>>>>>>>>>>> use_IV=None): >>>>>>>>>>>>> """ >>>>>>>>>>>>> Creating the Black-Scholes process for option >>>>>>>>>>>>> valuation. >>>>>>>>>>>>> """ >>>>>>>>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>>>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>>>>>>>> ql.FlatForward(self.value_date, 0, >>>>>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>>>>> volatility = >>>>>>>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>>>>>>>> self.value_date, ql.NullCalendar(), >>>>>>>>>>>>> self.volatility, ql.Actual365Fixed())) >>>>>>>>>>>>> initialValue = >>>>>>>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>>>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>>>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>>>>>>>> return(process) >>>>>>>>>>>>> >>>>>>>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>>>>>>>> """ >>>>>>>>>>>>> Call the relevant option based on the input. >>>>>>>>>>>>> """ >>>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>>>>> res = None >>>>>>>>>>>>> option = AsianOptionPrice.asian(self) >>>>>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>>>>> # create Black Scholes process using IV. >>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>>>>>>>>> self.IV} >>>>>>>>>>>>> else: >>>>>>>>>>>>> # Create Black Scholes process using HV. >>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>> self, create_process_for_iv=False, >>>>>>>>>>>>> use_IV=False) >>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>>>>> res = {'value': option.NPV()} >>>>>>>>>>>>> return res >>>>>>>>>>>>> >>>>>>>>>>>>> def evaluate_asian_npv(self): >>>>>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>>>>> res = Option.NPV() >>>>>>>>>>>>> return(res) >>>>>>>>>>>>> >>>>>>>>>>>>> def calculate_greeks(self, Option=None, >>>>>>>>>>>>> compute_implied_vol=None): >>>>>>>>>>>>> today = self.value_date >>>>>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>>>>>> else: >>>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>>> self, create_process_for_iv=False, >>>>>>>>>>>>> use_IV=False) >>>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>>>>>>>> Option.gamma( >>>>>>>>>>>>> )} >>>>>>>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>>>>>>>> self, Option, compute_implied_vol=True, >>>>>>>>>>>>> implied_vol_am_put=self.volatility) >>>>>>>>>>>>> DisturbedPrices = [] >>>>>>>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>>>>>>>> for i in range(4): >>>>>>>>>>>>> DisturbedPrices.append(eval( >>>>>>>>>>>>> >>>>>>>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>>>>>>>> print(DisturbedPrices) >>>>>>>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>>>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>>>>> thetaDay = (PricesDistrbd['PTup'] - >>>>>>>>>>>>> PricesDistrbd['Price']) >>>>>>>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, >>>>>>>>>>>>> 'theta': thetaDay}) >>>>>>>>>>>>> return option_greeks_ >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> settings = { >>>>>>>>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>>>>>>>> "tenantId": "380", >>>>>>>>>>>>> "gridPoints": 149, >>>>>>>>>>>>> "computeImpliedVolatiltiy": False, >>>>>>>>>>>>> "runId": 3735, >>>>>>>>>>>>> "timeSteps": 150, >>>>>>>>>>>>> "optionTrades": [ >>>>>>>>>>>>> { >>>>>>>>>>>>> "underlyingPrice": 98.69, >>>>>>>>>>>>> "refNo": "OPT-1135-GVA", >>>>>>>>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>>>>>>>> "valueDate": "17-03-2022", >>>>>>>>>>>>> "fixingStartDate":"01-05-2022", >>>>>>>>>>>>> "pastFixings":0, >>>>>>>>>>>>> "volatility": 0.6015, >>>>>>>>>>>>> "openQuantity": 1, >>>>>>>>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>>>>>>>> "optionType": "Call", >>>>>>>>>>>>> "expiryDate": "31-05-2022", >>>>>>>>>>>>> "exType": "asian", >>>>>>>>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>>>>>>>> "premium": 1, >>>>>>>>>>>>> "portfolioId": 18209, >>>>>>>>>>>>> "marketPremium": 11.42, >>>>>>>>>>>>> "longShort": "Long", >>>>>>>>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>>>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>>>>>>>> "portfolioName": "Option Trades", >>>>>>>>>>>>> "scenarioId": 8356, >>>>>>>>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>>>>>>>> "strikePrice": 95, >>>>>>>>>>>>> "maturityInYears": 0.205479452 >>>>>>>>>>>>> } >>>>>>>>>>>>> ], >>>>>>>>>>>>> "userId": "5263", >>>>>>>>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>>>>>>>> } >>>>>>>>>>>>> >>>>>>>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>>>>>>>> opt.evaluate_asian_npv() >>>>>>>>>>>>> >>>>>>>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hi Jack, >>>>>>>>>>>>>> >>>>>>>>>>>>>> Please find attached the Asian option python code and the >>>>>>>>>>>>>> option trade payload. >>>>>>>>>>>>>> >>>>>>>>>>>>>> Thanks for your help, >>>>>>>>>>>>>> Regards, >>>>>>>>>>>>>> Ashish >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G < >>>>>>>>>>>>>> jac...@gm...> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> I've just lifted the examples from your references directly >>>>>>>>>>>>>>> for a discrete arithmetic Asian using the FD Asian engine and it is working >>>>>>>>>>>>>>> for me - can you share the code you are using that breaks please? >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Best, >>>>>>>>>>>>>>> Jack >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, < >>>>>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Hi all, >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>>>>>>>> "QuantLib Error - Running average requires at least one >>>>>>>>>>>>>>>> past fixing" >>>>>>>>>>>>>>>> ref: >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Queries: >>>>>>>>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>>>>>>>> 2. For trade which is mid of averaging and has few past >>>>>>>>>>>>>>>> fixings, do we need to pass the count of past fixing or the actual rates of >>>>>>>>>>>>>>>> the pastfixing as an array? >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Any help will be appreciated. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> Thanks in advance >>>>>>>>>>>>>>>> Ashish >>>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>>>>>> Qua...@li... >>>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>> Qua...@li... >>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>> >>>>>>>>>>> |
|
From: Ashish B. <ash...@gm...> - 2022-05-25 16:52:00
|
By same price, you mean same as exchange i.e. 4.57. or same as aRA parameter i.e. 6.09? Any guidance on moment matching? I could not find anything online about it. Regards Ashish On Wed, May 25, 2022, 7:02 PM Luigi Ballabio <lui...@gm...> wrote: > Hi, > no, the engine doesn't do moment matching. I don't think we have > something ready to use for that in the library. > As for the accumulator: I confirm it's the sum. If you create a virtual > Python environment and install the latest QuantLib in it, you can try your > shortened code with the other constructor for the Asian option (the one > taking the list of fixings). It returns the same price. > > Luigi > > > On Wed, May 25, 2022 at 2:46 PM Ashish Bansal <ash...@gm...> > wrote: > >> Hi Luigi, >> >> One question about the QL calculation: Does QL code for the Asian option >> include *moment matching *of the volatility or do we need to do that >> before passing to the DiscAvAsOption? >> >> Regarding the code, I had attached the full code from our system in my >> previous email, attaching here too. The shortened version of the code, >> containing only the QL interaction and excluding excess processing, is also >> attached here. It includes the trade parameters we are using to evaluate >> the Asian option. Strangely, the value is coming zero with short-code but >> with full code in our system, we are getting the values. >> >> Following is the NPV that we are getting in our system (using full code) >> for our trade which has averaging period from 1st March to 31st March 2022 >> and the market traded premium of 4.56: >> arithmeticRunningAccumulator NPV >> 0 4.5711 >> 1302.88 6.09 >> >> Thanks in advance for help. >> >> PS: We are using QL1.17 and the vols are sourced from Reuters could be >> different from implied in the market traded premium. >> >> Regards, >> Ashish >> >> On Mon, 23 May 2022 at 22:26, Luigi Ballabio <lui...@gm...> >> wrote: >> >>> May you send sample code and the value of the fixings for one of those >>> options? Thanks! >>> >>> Luigi >>> >>> >>> On Mon, May 23, 2022 at 8:32 AM Ashish Bansal <ash...@gm...> >>> wrote: >>> >>>> Luigi, >>>> >>>> We ran the asian code, which i sent earlier for a couple of asian >>>> options traded on exchange. We got prices very close to traded prices when >>>> we used the value of running accumulator as 1 for march option being valued >>>> on 17th with past fixing count as 12. But when we used the sum of past >>>> fixing prices i.e. 1302.88 we got a very different number like 6.09 against >>>> 4.57 earlier and 14.11 against 12.39 earlier. >>>> >>>> Just want to confirm if i am missing something about running >>>> accumulator and should it be really the sum of all past fixings? >>>> >>>> Thanks for help in advance. >>>> Ashish >>>> >>>> On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...> >>>> wrote: >>>> >>>>> Ok understood. thanks. >>>>> >>>>> On Fri, 20 May 2022 at 14:46, Luigi Ballabio <lui...@gm...> >>>>> wrote: >>>>> >>>>>> It would be the sum of past fixings; for three past fixings of 100.2, >>>>>> 101.3 and 94.6 it would be 296.1. >>>>>> >>>>>> Luigi >>>>>> >>>>>> >>>>>> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal < >>>>>> ash...@gm...> wrote: >>>>>> >>>>>>> Thanks, Luigi for the suggestion. After taking the running >>>>>>> accumulator, we are able to generate the numbers. What exactly should be >>>>>>> passed here? The average price of past fixings or just 1 when the trade is >>>>>>> priced during averaging period? >>>>>>> >>>>>>> Thanks for help. >>>>>>> >>>>>>> Ashish >>>>>>> >>>>>>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio < >>>>>>> lui...@gm...> wrote: >>>>>>> >>>>>>>> I don't have a 1.7 version to try it, but the check is the one at < >>>>>>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>>>>>>> suggesting that your running accumulator should be 0 (which makes sense, >>>>>>>> because you're using arithmetic average, i.e., a sum, and if you don't have >>>>>>>> any fixings yet the sum should be 0.) >>>>>>>> Your default seems to be 1 instead. >>>>>>>> >>>>>>>> Luigi >>>>>>>> >>>>>>>> >>>>>>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal < >>>>>>>> ash...@gm...> wrote: >>>>>>>> >>>>>>>>> Luigi, >>>>>>>>> >>>>>>>>> Our code is not too much but we are using deprecated functions >>>>>>>>> like FDEuropeanEngine and FDAmericanEngine. Not sure if using >>>>>>>>> new function called FdBlackScholesVanillaEngine has any change in >>>>>>>>> the calculation that our code will have an impact. >>>>>>>>> >>>>>>>>> Can we use the DiscreteAveragingAsianOption without the >>>>>>>>> overloaded parameter of pastfixings under 1.7? >>>>>>>>> >>>>>>>>> Ashish >>>>>>>>> >>>>>>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio < >>>>>>>>> lui...@gm...> wrote: >>>>>>>>> >>>>>>>>>> Hi — it could be. Any particular reason you're still using a >>>>>>>>>> version from 4 years ago? If you have a substantial amount of code that >>>>>>>>>> depends on QuantLib, it might require some work to update because some >>>>>>>>>> methods were deprecated and then removed in the meantime; and of course >>>>>>>>>> you'll probably have some validation process in place when updating, so >>>>>>>>>> that's work too. But on the other hand, you're missing 4 years worth of >>>>>>>>>> bug fixings... >>>>>>>>>> >>>>>>>>>> Luigi >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal < >>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>> >>>>>>>>>>> We tried again and got the same error. >>>>>>>>>>> >>>>>>>>>>> Could it be due to the old version (1.7) we are using? I see in >>>>>>>>>>> the release notes of Apr-2021 that the overload for past fixing was added: >>>>>>>>>>> >>>>>>>>>>> - Added an overloaded constructor for Asian options that >>>>>>>>>>> takes all past fixings and thus allows to reprice them correctly when the >>>>>>>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>>>>>>> >>>>>>>>>>> Ashish >>>>>>>>>>> >>>>>>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>> >>>>>>>>>>>> I have a better answer for you with a screenshot awaiting >>>>>>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your >>>>>>>>>>>> code without problems using the python at the bottom of this email >>>>>>>>>>>> (although I didn't check the numbers). >>>>>>>>>>>> >>>>>>>>>>>> If there is something you're doing specifically to generate the >>>>>>>>>>>> error, could you please attach a minimal reproduction of it? >>>>>>>>>>>> >>>>>>>>>>>> Best, >>>>>>>>>>>> Jack >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> import QuantLib as ql >>>>>>>>>>>> from copy import deepcopy >>>>>>>>>>>> from datetime import datetime >>>>>>>>>>>> from datetime import timedelta >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>>>>>>> DEFAULT_tGRID = 100 >>>>>>>>>>>> DEFAULT_xGRID = 100 >>>>>>>>>>>> DEFAULT_aGRID = 50 >>>>>>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> class AsianOptionPrice: >>>>>>>>>>>> def __init__(self, **x): >>>>>>>>>>>> for k, v in x.items(): >>>>>>>>>>>> setattr(self, k, v) >>>>>>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>>>>>>> self.pastFixings = x.get("pastFixings", >>>>>>>>>>>> DEFAULT_PASTFIXINGS) >>>>>>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", >>>>>>>>>>>> DEFAULT_aRA) >>>>>>>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>>>>>>> self.dist = 10**(-2) >>>>>>>>>>>> self.date_format = "%d-%m-%Y" >>>>>>>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>>>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>>>>>>>> self.exDay = >>>>>>>>>>>> ql.DateParser.parseFormatted(self.expiryDate, '%d-%m-%Y') >>>>>>>>>>>> # Volatility input is required for running the >>>>>>>>>>>> computing implied volatility function. This volatility is NOT used in the >>>>>>>>>>>> implied volatility calculation. >>>>>>>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>>>>>>> self.IV = None >>>>>>>>>>>> >>>>>>>>>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>>>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>>>>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>>>>>>> _date.weekday() not in [1,7]] >>>>>>>>>>>> return fixture_dates >>>>>>>>>>>> def asian(self): >>>>>>>>>>>> """ >>>>>>>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>>>>>>> """ >>>>>>>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>>>>>>> pastFixings = self.pastFixings >>>>>>>>>>>> print(pastFixings) >>>>>>>>>>>> option_type = self.optionType.lower() >>>>>>>>>>>> if option_type not in ["call", "put"]: >>>>>>>>>>>> raise Exception( >>>>>>>>>>>> f"Option Type is Neither Call nor Put, Option >>>>>>>>>>>> type is {option_type}") >>>>>>>>>>>> option_type = ql.Option.Call if option_type == "call" >>>>>>>>>>>> else ql.Option.Put >>>>>>>>>>>> strike = self.strikePrice >>>>>>>>>>>> today = self.value_date >>>>>>>>>>>> print(today) >>>>>>>>>>>> fixingStartDate >>>>>>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>>>>>>> print("#"*40,fixingStartDate) >>>>>>>>>>>> periods = self.periods >>>>>>>>>>>> asianFutureFixingDates = >>>>>>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>>>>>>> asianExpiryDate = self.expiry_date >>>>>>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, >>>>>>>>>>>> strike) >>>>>>>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>>>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>>>>>>> discreteArithmeticAsianOption = >>>>>>>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>>>>>>> return discreteArithmeticAsianOption >>>>>>>>>>>> >>>>>>>>>>>> def create_arg_list(self, Option=None, >>>>>>>>>>>> compute_implied_vol=None, implied_vol_am_put=None): >>>>>>>>>>>> ''' >>>>>>>>>>>> The arguments with disturbances added. Will be used >>>>>>>>>>>> for calculation of Greeks >>>>>>>>>>>> using numerical differentiation. >>>>>>>>>>>> Creating a dictionary of arguments that will be >>>>>>>>>>>> used for option price and greeks calculation. >>>>>>>>>>>> ''' >>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>>>> originalDict_ = {k: getattr(self, k) for k in >>>>>>>>>>>> self.keyList} >>>>>>>>>>>> ListDict = [] >>>>>>>>>>>> for i in range(4): >>>>>>>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + >>>>>>>>>>>> self.dist >>>>>>>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>>>>>>> self.expiryDate, self.date_format) - >>>>>>>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>>>>>>> print(ListDict) >>>>>>>>>>>> return(ListDict) >>>>>>>>>>>> >>>>>>>>>>>> def bs_process(self, create_process_for_iv=None, >>>>>>>>>>>> use_IV=None): >>>>>>>>>>>> """ >>>>>>>>>>>> Creating the Black-Scholes process for option valuation. >>>>>>>>>>>> """ >>>>>>>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>>>>>>> ql.FlatForward(self.value_date, 0, >>>>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>>>> volatility = >>>>>>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>>>>>>> self.value_date, ql.NullCalendar(), >>>>>>>>>>>> self.volatility, ql.Actual365Fixed())) >>>>>>>>>>>> initialValue = >>>>>>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>>>>>>> return(process) >>>>>>>>>>>> >>>>>>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>>>>>>> """ >>>>>>>>>>>> Call the relevant option based on the input. >>>>>>>>>>>> """ >>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>>>> res = None >>>>>>>>>>>> option = AsianOptionPrice.asian(self) >>>>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>>>> # create Black Scholes process using IV. >>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>>>>>>>> self.IV} >>>>>>>>>>>> else: >>>>>>>>>>>> # Create Black Scholes process using HV. >>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>>>> res = {'value': option.NPV()} >>>>>>>>>>>> return res >>>>>>>>>>>> >>>>>>>>>>>> def evaluate_asian_npv(self): >>>>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>>>> res = Option.NPV() >>>>>>>>>>>> return(res) >>>>>>>>>>>> >>>>>>>>>>>> def calculate_greeks(self, Option=None, >>>>>>>>>>>> compute_implied_vol=None): >>>>>>>>>>>> today = self.value_date >>>>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>>>>> else: >>>>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>>>>>>> Option.gamma( >>>>>>>>>>>> )} >>>>>>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>>>>>>> self, Option, compute_implied_vol=True, >>>>>>>>>>>> implied_vol_am_put=self.volatility) >>>>>>>>>>>> DisturbedPrices = [] >>>>>>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>>>>>>> for i in range(4): >>>>>>>>>>>> DisturbedPrices.append(eval( >>>>>>>>>>>> >>>>>>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>>>>>>> print(DisturbedPrices) >>>>>>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>>>> thetaDay = (PricesDistrbd['PTup'] - >>>>>>>>>>>> PricesDistrbd['Price']) >>>>>>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, >>>>>>>>>>>> 'theta': thetaDay}) >>>>>>>>>>>> return option_greeks_ >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> settings = { >>>>>>>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>>>>>>> "tenantId": "380", >>>>>>>>>>>> "gridPoints": 149, >>>>>>>>>>>> "computeImpliedVolatiltiy": False, >>>>>>>>>>>> "runId": 3735, >>>>>>>>>>>> "timeSteps": 150, >>>>>>>>>>>> "optionTrades": [ >>>>>>>>>>>> { >>>>>>>>>>>> "underlyingPrice": 98.69, >>>>>>>>>>>> "refNo": "OPT-1135-GVA", >>>>>>>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>>>>>>> "valueDate": "17-03-2022", >>>>>>>>>>>> "fixingStartDate":"01-05-2022", >>>>>>>>>>>> "pastFixings":0, >>>>>>>>>>>> "volatility": 0.6015, >>>>>>>>>>>> "openQuantity": 1, >>>>>>>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>>>>>>> "optionType": "Call", >>>>>>>>>>>> "expiryDate": "31-05-2022", >>>>>>>>>>>> "exType": "asian", >>>>>>>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>>>>>>> "premium": 1, >>>>>>>>>>>> "portfolioId": 18209, >>>>>>>>>>>> "marketPremium": 11.42, >>>>>>>>>>>> "longShort": "Long", >>>>>>>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>>>>>>> "portfolioName": "Option Trades", >>>>>>>>>>>> "scenarioId": 8356, >>>>>>>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>>>>>>> "strikePrice": 95, >>>>>>>>>>>> "maturityInYears": 0.205479452 >>>>>>>>>>>> } >>>>>>>>>>>> ], >>>>>>>>>>>> "userId": "5263", >>>>>>>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>>>>>>> } >>>>>>>>>>>> >>>>>>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>>>>>>> opt.evaluate_asian_npv() >>>>>>>>>>>> >>>>>>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Hi Jack, >>>>>>>>>>>>> >>>>>>>>>>>>> Please find attached the Asian option python code and the >>>>>>>>>>>>> option trade payload. >>>>>>>>>>>>> >>>>>>>>>>>>> Thanks for your help, >>>>>>>>>>>>> Regards, >>>>>>>>>>>>> Ashish >>>>>>>>>>>>> >>>>>>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>>>>>>>>> wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>>>> >>>>>>>>>>>>>> I've just lifted the examples from your references directly >>>>>>>>>>>>>> for a discrete arithmetic Asian using the FD Asian engine and it is working >>>>>>>>>>>>>> for me - can you share the code you are using that breaks please? >>>>>>>>>>>>>> >>>>>>>>>>>>>> Best, >>>>>>>>>>>>>> Jack >>>>>>>>>>>>>> >>>>>>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, < >>>>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>>>> >>>>>>>>>>>>>>> Hi all, >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>>>>>>>>> fixing" >>>>>>>>>>>>>>> ref: >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Queries: >>>>>>>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>>>>>>> 2. For trade which is mid of averaging and has few past >>>>>>>>>>>>>>> fixings, do we need to pass the count of past fixing or the actual rates of >>>>>>>>>>>>>>> the pastfixing as an array? >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Any help will be appreciated. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Thanks in advance >>>>>>>>>>>>>>> Ashish >>>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>>>>> Qua...@li... >>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>>>>> >>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>> Qua...@li... >>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>> >>>>>>>>>> |
|
From: Luigi B. <lui...@gm...> - 2022-05-25 13:32:24
|
Hi,
no, the engine doesn't do moment matching. I don't think we have
something ready to use for that in the library.
As for the accumulator: I confirm it's the sum. If you create a virtual
Python environment and install the latest QuantLib in it, you can try your
shortened code with the other constructor for the Asian option (the one
taking the list of fixings). It returns the same price.
Luigi
On Wed, May 25, 2022 at 2:46 PM Ashish Bansal <ash...@gm...>
wrote:
> Hi Luigi,
>
> One question about the QL calculation: Does QL code for the Asian option
> include *moment matching *of the volatility or do we need to do that
> before passing to the DiscAvAsOption?
>
> Regarding the code, I had attached the full code from our system in my
> previous email, attaching here too. The shortened version of the code,
> containing only the QL interaction and excluding excess processing, is also
> attached here. It includes the trade parameters we are using to evaluate
> the Asian option. Strangely, the value is coming zero with short-code but
> with full code in our system, we are getting the values.
>
> Following is the NPV that we are getting in our system (using full code)
> for our trade which has averaging period from 1st March to 31st March 2022
> and the market traded premium of 4.56:
> arithmeticRunningAccumulator NPV
> 0 4.5711
> 1302.88 6.09
>
> Thanks in advance for help.
>
> PS: We are using QL1.17 and the vols are sourced from Reuters could be
> different from implied in the market traded premium.
>
> Regards,
> Ashish
>
> On Mon, 23 May 2022 at 22:26, Luigi Ballabio <lui...@gm...>
> wrote:
>
>> May you send sample code and the value of the fixings for one of those
>> options? Thanks!
>>
>> Luigi
>>
>>
>> On Mon, May 23, 2022 at 8:32 AM Ashish Bansal <ash...@gm...>
>> wrote:
>>
>>> Luigi,
>>>
>>> We ran the asian code, which i sent earlier for a couple of asian
>>> options traded on exchange. We got prices very close to traded prices when
>>> we used the value of running accumulator as 1 for march option being valued
>>> on 17th with past fixing count as 12. But when we used the sum of past
>>> fixing prices i.e. 1302.88 we got a very different number like 6.09 against
>>> 4.57 earlier and 14.11 against 12.39 earlier.
>>>
>>> Just want to confirm if i am missing something about running accumulator
>>> and should it be really the sum of all past fixings?
>>>
>>> Thanks for help in advance.
>>> Ashish
>>>
>>> On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...>
>>> wrote:
>>>
>>>> Ok understood. thanks.
>>>>
>>>> On Fri, 20 May 2022 at 14:46, Luigi Ballabio <lui...@gm...>
>>>> wrote:
>>>>
>>>>> It would be the sum of past fixings; for three past fixings of 100.2,
>>>>> 101.3 and 94.6 it would be 296.1.
>>>>>
>>>>> Luigi
>>>>>
>>>>>
>>>>> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal <
>>>>> ash...@gm...> wrote:
>>>>>
>>>>>> Thanks, Luigi for the suggestion. After taking the running
>>>>>> accumulator, we are able to generate the numbers. What exactly should be
>>>>>> passed here? The average price of past fixings or just 1 when the trade is
>>>>>> priced during averaging period?
>>>>>>
>>>>>> Thanks for help.
>>>>>>
>>>>>> Ashish
>>>>>>
>>>>>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio <
>>>>>> lui...@gm...> wrote:
>>>>>>
>>>>>>> I don't have a 1.7 version to try it, but the check is the one at <
>>>>>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>,
>>>>>>> suggesting that your running accumulator should be 0 (which makes sense,
>>>>>>> because you're using arithmetic average, i.e., a sum, and if you don't have
>>>>>>> any fixings yet the sum should be 0.)
>>>>>>> Your default seems to be 1 instead.
>>>>>>>
>>>>>>> Luigi
>>>>>>>
>>>>>>>
>>>>>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <
>>>>>>> ash...@gm...> wrote:
>>>>>>>
>>>>>>>> Luigi,
>>>>>>>>
>>>>>>>> Our code is not too much but we are using deprecated functions
>>>>>>>> like FDEuropeanEngine and FDAmericanEngine. Not sure if using new
>>>>>>>> function called FdBlackScholesVanillaEngine has any change in the
>>>>>>>> calculation that our code will have an impact.
>>>>>>>>
>>>>>>>> Can we use the DiscreteAveragingAsianOption without the overloaded
>>>>>>>> parameter of pastfixings under 1.7?
>>>>>>>>
>>>>>>>> Ashish
>>>>>>>>
>>>>>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio <
>>>>>>>> lui...@gm...> wrote:
>>>>>>>>
>>>>>>>>> Hi — it could be. Any particular reason you're still using a
>>>>>>>>> version from 4 years ago? If you have a substantial amount of code that
>>>>>>>>> depends on QuantLib, it might require some work to update because some
>>>>>>>>> methods were deprecated and then removed in the meantime; and of course
>>>>>>>>> you'll probably have some validation process in place when updating, so
>>>>>>>>> that's work too. But on the other hand, you're missing 4 years worth of
>>>>>>>>> bug fixings...
>>>>>>>>>
>>>>>>>>> Luigi
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <
>>>>>>>>> ash...@gm...> wrote:
>>>>>>>>>
>>>>>>>>>> We tried again and got the same error.
>>>>>>>>>>
>>>>>>>>>> Could it be due to the old version (1.7) we are using? I see in
>>>>>>>>>> the release notes of Apr-2021 that the overload for past fixing was added:
>>>>>>>>>>
>>>>>>>>>> - Added an overloaded constructor for Asian options that
>>>>>>>>>> takes all past fixings and thus allows to reprice them correctly when the
>>>>>>>>>> evaluation date changes (thanks to Jack Gillett).
>>>>>>>>>>
>>>>>>>>>> Ashish
>>>>>>>>>>
>>>>>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...>
>>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>>> Hi Ashish,
>>>>>>>>>>>
>>>>>>>>>>> I have a better answer for you with a screenshot awaiting
>>>>>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your
>>>>>>>>>>> code without problems using the python at the bottom of this email
>>>>>>>>>>> (although I didn't check the numbers).
>>>>>>>>>>>
>>>>>>>>>>> If there is something you're doing specifically to generate the
>>>>>>>>>>> error, could you please attach a minimal reproduction of it?
>>>>>>>>>>>
>>>>>>>>>>> Best,
>>>>>>>>>>> Jack
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> import QuantLib as ql
>>>>>>>>>>> from copy import deepcopy
>>>>>>>>>>> from datetime import datetime
>>>>>>>>>>> from datetime import timedelta
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)]
>>>>>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"),
>>>>>>>>>>> ql.Period("18M"), ql.Period("24M")]
>>>>>>>>>>> DEFAULT_tGRID = 100
>>>>>>>>>>> DEFAULT_xGRID = 100
>>>>>>>>>>> DEFAULT_aGRID = 50
>>>>>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator
>>>>>>>>>>> DEFAULT_PASTFIXINGS = 1
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> class AsianOptionPrice:
>>>>>>>>>>> def __init__(self, **x):
>>>>>>>>>>> for k, v in x.items():
>>>>>>>>>>> setattr(self, k, v)
>>>>>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID)
>>>>>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID)
>>>>>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID)
>>>>>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS)
>>>>>>>>>>> self.pastFixings = x.get("pastFixings",
>>>>>>>>>>> DEFAULT_PASTFIXINGS)
>>>>>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator",
>>>>>>>>>>> DEFAULT_aRA)
>>>>>>>>>>> self.keyList = [k for k, v in x.items()]
>>>>>>>>>>> self.dist = 10**(-2)
>>>>>>>>>>> self.date_format = "%d-%m-%Y"
>>>>>>>>>>> self.value_date = ql.DateParser.parseFormatted(
>>>>>>>>>>> self.valueDate, '%d-%m-%Y')
>>>>>>>>>>> self.expiry_date = ql.DateParser.parseFormatted(
>>>>>>>>>>> self.expiryDate, '%d-%m-%Y')
>>>>>>>>>>> ql.Settings.instance().evaluationDate = self.value_date
>>>>>>>>>>> self.exDay =
>>>>>>>>>>> ql.DateParser.parseFormatted(self.expiryDate, '%d-%m-%Y')
>>>>>>>>>>> # Volatility input is required for running the computing
>>>>>>>>>>> implied volatility function. This volatility is NOT used in the implied
>>>>>>>>>>> volatility calculation.
>>>>>>>>>>> self.vol_for_iv_calc = 0.10
>>>>>>>>>>> self.IV = None
>>>>>>>>>>>
>>>>>>>>>>> def generate_fixture_dates(self,start_date,end_date,period):
>>>>>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, period)
>>>>>>>>>>> fixture_dates = [_date for _date in schedule if
>>>>>>>>>>> _date.weekday() not in [1,7]]
>>>>>>>>>>> return fixture_dates
>>>>>>>>>>> def asian(self):
>>>>>>>>>>> """
>>>>>>>>>>> arithmeticRunningAccumulator(aRA)
>>>>>>>>>>> """
>>>>>>>>>>> arithmeticRunningAccumulator = self.aRA
>>>>>>>>>>> pastFixings = self.pastFixings
>>>>>>>>>>> print(pastFixings)
>>>>>>>>>>> option_type = self.optionType.lower()
>>>>>>>>>>> if option_type not in ["call", "put"]:
>>>>>>>>>>> raise Exception(
>>>>>>>>>>> f"Option Type is Neither Call nor Put, Option
>>>>>>>>>>> type is {option_type}")
>>>>>>>>>>> option_type = ql.Option.Call if option_type == "call"
>>>>>>>>>>> else ql.Option.Put
>>>>>>>>>>> strike = self.strikePrice
>>>>>>>>>>> today = self.value_date
>>>>>>>>>>> print(today)
>>>>>>>>>>> fixingStartDate
>>>>>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y')
>>>>>>>>>>> print("#"*40,fixingStartDate)
>>>>>>>>>>> periods = self.periods
>>>>>>>>>>> asianFutureFixingDates =
>>>>>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d"))
>>>>>>>>>>> print("#"*40,asianFutureFixingDates)
>>>>>>>>>>> asianExpiryDate = self.expiry_date
>>>>>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type,
>>>>>>>>>>> strike)
>>>>>>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate)
>>>>>>>>>>> arithmeticAverage = ql.Average().Arithmetic
>>>>>>>>>>> discreteArithmeticAsianOption =
>>>>>>>>>>> ql.DiscreteAveragingAsianOption(
>>>>>>>>>>> arithmeticAverage, arithmeticRunningAccumulator,
>>>>>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise)
>>>>>>>>>>> return discreteArithmeticAsianOption
>>>>>>>>>>>
>>>>>>>>>>> def create_arg_list(self, Option=None,
>>>>>>>>>>> compute_implied_vol=None, implied_vol_am_put=None):
>>>>>>>>>>> '''
>>>>>>>>>>> The arguments with disturbances added. Will be used
>>>>>>>>>>> for calculation of Greeks
>>>>>>>>>>> using numerical differentiation.
>>>>>>>>>>> Creating a dictionary of arguments that will be used
>>>>>>>>>>> for option price and greeks calculation.
>>>>>>>>>>> '''
>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100
>>>>>>>>>>> originalDict_ = {k: getattr(self, k) for k in
>>>>>>>>>>> self.keyList}
>>>>>>>>>>> ListDict = []
>>>>>>>>>>> for i in range(4):
>>>>>>>>>>> ListDict.append(deepcopy(originalDict_))
>>>>>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate +
>>>>>>>>>>> self.dist
>>>>>>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist
>>>>>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime(
>>>>>>>>>>> self.expiryDate, self.date_format) -
>>>>>>>>>>> timedelta(days=1)).strftime(self.date_format)
>>>>>>>>>>> print(ListDict)
>>>>>>>>>>> return(ListDict)
>>>>>>>>>>>
>>>>>>>>>>> def bs_process(self, create_process_for_iv=None,
>>>>>>>>>>> use_IV=None):
>>>>>>>>>>> """
>>>>>>>>>>> Creating the Black-Scholes process for option valuation.
>>>>>>>>>>> """
>>>>>>>>>>> riskFreeTS = ql.YieldTermStructureHandle(
>>>>>>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate,
>>>>>>>>>>> ql.Actual365Fixed()))
>>>>>>>>>>> dividendTS = ql.YieldTermStructureHandle(
>>>>>>>>>>> ql.FlatForward(self.value_date, 0,
>>>>>>>>>>> ql.Actual365Fixed()))
>>>>>>>>>>> volatility =
>>>>>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol(
>>>>>>>>>>> self.value_date, ql.NullCalendar(), self.volatility,
>>>>>>>>>>> ql.Actual365Fixed()))
>>>>>>>>>>> initialValue =
>>>>>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice))
>>>>>>>>>>> process = ql.BlackScholesMertonProcess(
>>>>>>>>>>> initialValue, dividendTS, riskFreeTS, volatility)
>>>>>>>>>>> return(process)
>>>>>>>>>>>
>>>>>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None):
>>>>>>>>>>> """
>>>>>>>>>>> Call the relevant option based on the input.
>>>>>>>>>>> """
>>>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100
>>>>>>>>>>> res = None
>>>>>>>>>>> option = AsianOptionPrice.asian(self)
>>>>>>>>>>> if compute_implied_vol == True:
>>>>>>>>>>> # create Black Scholes process using IV.
>>>>>>>>>>> process = AsianOptionPrice.bs_process(
>>>>>>>>>>> self, create_process_for_iv=False, use_IV=True)
>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine(
>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>>>>>>>>>> aGrid=self.aGrid)
>>>>>>>>>>> option.setPricingEngine(engine)
>>>>>>>>>>> res = {'value': option.NPV(), 'impliedVolatility':
>>>>>>>>>>> self.IV}
>>>>>>>>>>> else:
>>>>>>>>>>> # Create Black Scholes process using HV.
>>>>>>>>>>> process = AsianOptionPrice.bs_process(
>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False)
>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine(
>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>>>>>>>>>> aGrid=self.aGrid)
>>>>>>>>>>> option.setPricingEngine(engine)
>>>>>>>>>>> res = {'value': option.NPV()}
>>>>>>>>>>> return res
>>>>>>>>>>>
>>>>>>>>>>> def evaluate_asian_npv(self):
>>>>>>>>>>> Option = AsianOptionPrice.asian(self)
>>>>>>>>>>> process = AsianOptionPrice.bs_process(
>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False)
>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine(
>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>>>>>>>>>> aGrid=self.aGrid)
>>>>>>>>>>> Option.setPricingEngine(engine)
>>>>>>>>>>> res = Option.NPV()
>>>>>>>>>>> return(res)
>>>>>>>>>>>
>>>>>>>>>>> def calculate_greeks(self, Option=None,
>>>>>>>>>>> compute_implied_vol=None):
>>>>>>>>>>> today = self.value_date
>>>>>>>>>>> Option = AsianOptionPrice.asian(self)
>>>>>>>>>>> if compute_implied_vol == True:
>>>>>>>>>>> process = AsianOptionPrice.bs_process(
>>>>>>>>>>> self, create_process_for_iv=False, use_IV=True)
>>>>>>>>>>> else:
>>>>>>>>>>> process = AsianOptionPrice.bs_process(
>>>>>>>>>>> self, create_process_for_iv=False, use_IV=False)
>>>>>>>>>>> engine = ql.FdBlackScholesAsianEngine(
>>>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>>>>>>>>>> aGrid=self.aGrid)
>>>>>>>>>>> Option.setPricingEngine(engine)
>>>>>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma":
>>>>>>>>>>> Option.gamma(
>>>>>>>>>>> )}
>>>>>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list(
>>>>>>>>>>> self, Option, compute_implied_vol=True,
>>>>>>>>>>> implied_vol_am_put=self.volatility)
>>>>>>>>>>> DisturbedPrices = []
>>>>>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup']
>>>>>>>>>>> for i in range(4):
>>>>>>>>>>> DisturbedPrices.append(eval(
>>>>>>>>>>>
>>>>>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()"))
>>>>>>>>>>> print(DisturbedPrices)
>>>>>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices))
>>>>>>>>>>> Rho = (PricesDistrbd['PRup'] -
>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100)
>>>>>>>>>>> vega = (PricesDistrbd['PVup'] -
>>>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100)
>>>>>>>>>>> thetaDay = (PricesDistrbd['PTup'] -
>>>>>>>>>>> PricesDistrbd['Price'])
>>>>>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega,
>>>>>>>>>>> 'theta': thetaDay})
>>>>>>>>>>> return option_greeks_
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> settings = {
>>>>>>>>>>> "computeHistoricalVolatiltiy": False,
>>>>>>>>>>> "tenantId": "380",
>>>>>>>>>>> "gridPoints": 149,
>>>>>>>>>>> "computeImpliedVolatiltiy": False,
>>>>>>>>>>> "runId": 3735,
>>>>>>>>>>> "timeSteps": 150,
>>>>>>>>>>> "optionTrades": [
>>>>>>>>>>> {
>>>>>>>>>>> "underlyingPrice": 98.69,
>>>>>>>>>>> "refNo": "OPT-1135-GVA",
>>>>>>>>>>> "underlyingPriceUnit": "US cents/LB",
>>>>>>>>>>> "valueDate": "17-03-2022",
>>>>>>>>>>> "fixingStartDate":"01-05-2022",
>>>>>>>>>>> "pastFixings":0,
>>>>>>>>>>> "volatility": 0.6015,
>>>>>>>>>>> "openQuantity": 1,
>>>>>>>>>>> "strikePriceUnit": "US cents/LB",
>>>>>>>>>>> "optionType": "Call",
>>>>>>>>>>> "expiryDate": "31-05-2022",
>>>>>>>>>>> "exType": "asian",
>>>>>>>>>>> "riskFreeRate": 0.8080374999999999,
>>>>>>>>>>> "premium": 1,
>>>>>>>>>>> "portfolioId": 18209,
>>>>>>>>>>> "marketPremium": 11.42,
>>>>>>>>>>> "longShort": "Long",
>>>>>>>>>>> "optionInstrument": "EURO USD 1.105 Call",
>>>>>>>>>>> "asset": "EURO USD 1.105 Call",
>>>>>>>>>>> "portfolioName": "Option Trades",
>>>>>>>>>>> "scenarioId": 8356,
>>>>>>>>>>> "scenarioName": "Option Valuation - Greeks",
>>>>>>>>>>> "strikePrice": 95,
>>>>>>>>>>> "maturityInYears": 0.205479452
>>>>>>>>>>> }
>>>>>>>>>>> ],
>>>>>>>>>>> "userId": "5263",
>>>>>>>>>>> "americanOptionsEngine": "CrankNicolson"
>>>>>>>>>>> }
>>>>>>>>>>>
>>>>>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0])
>>>>>>>>>>> opt.evaluate_asian_npv()
>>>>>>>>>>>
>>>>>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <
>>>>>>>>>>> ash...@gm...> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi Jack,
>>>>>>>>>>>>
>>>>>>>>>>>> Please find attached the Asian option python code and the
>>>>>>>>>>>> option trade payload.
>>>>>>>>>>>>
>>>>>>>>>>>> Thanks for your help,
>>>>>>>>>>>> Regards,
>>>>>>>>>>>> Ashish
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...>
>>>>>>>>>>>> wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi Ashish,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I've just lifted the examples from your references directly
>>>>>>>>>>>>> for a discrete arithmetic Asian using the FD Asian engine and it is working
>>>>>>>>>>>>> for me - can you share the code you are using that breaks please?
>>>>>>>>>>>>>
>>>>>>>>>>>>> Best,
>>>>>>>>>>>>> Jack
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <
>>>>>>>>>>>>> ash...@gm...> wrote:
>>>>>>>>>>>>>
>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Could somebody help with the asian options? We are using
>>>>>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online
>>>>>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to
>>>>>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when
>>>>>>>>>>>>>> we are passing it as 0, we are getting the following error:
>>>>>>>>>>>>>> "QuantLib Error - Running average requires at least one past
>>>>>>>>>>>>>> fixing"
>>>>>>>>>>>>>> ref:
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine
>>>>>>>>>>>>>>
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Queries:
>>>>>>>>>>>>>> 1. What is to be passed here for new trade if not 0?
>>>>>>>>>>>>>> 2. For trade which is mid of averaging and has few past
>>>>>>>>>>>>>> fixings, do we need to pass the count of past fixing or the actual rates of
>>>>>>>>>>>>>> the pastfixing as an array?
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Any help will be appreciated.
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks in advance
>>>>>>>>>>>>>> Ashish
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> QuantLib-users mailing list
>>>>>>>>>>>>>> Qua...@li...
>>>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>>>>>>>>>>>
>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>> QuantLib-users mailing list
>>>>>>>>>> Qua...@li...
>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>>>>>>>
>>>>>>>>>
|
|
From: Ashish B. <ash...@gm...> - 2022-05-25 12:46:12
|
Hi Luigi, One question about the QL calculation: Does QL code for the Asian option include *moment matching *of the volatility or do we need to do that before passing to the DiscAvAsOption? Regarding the code, I had attached the full code from our system in my previous email, attaching here too. The shortened version of the code, containing only the QL interaction and excluding excess processing, is also attached here. It includes the trade parameters we are using to evaluate the Asian option. Strangely, the value is coming zero with short-code but with full code in our system, we are getting the values. Following is the NPV that we are getting in our system (using full code) for our trade which has averaging period from 1st March to 31st March 2022 and the market traded premium of 4.56: arithmeticRunningAccumulator NPV 0 4.5711 1302.88 6.09 Thanks in advance for help. PS: We are using QL1.17 and the vols are sourced from Reuters could be different from implied in the market traded premium. Regards, Ashish On Mon, 23 May 2022 at 22:26, Luigi Ballabio <lui...@gm...> wrote: > May you send sample code and the value of the fixings for one of those > options? Thanks! > > Luigi > > > On Mon, May 23, 2022 at 8:32 AM Ashish Bansal <ash...@gm...> > wrote: > >> Luigi, >> >> We ran the asian code, which i sent earlier for a couple of asian options >> traded on exchange. We got prices very close to traded prices when we used >> the value of running accumulator as 1 for march option being valued on 17th >> with past fixing count as 12. But when we used the sum of past fixing >> prices i.e. 1302.88 we got a very different number like 6.09 against 4.57 >> earlier and 14.11 against 12.39 earlier. >> >> Just want to confirm if i am missing something about running accumulator >> and should it be really the sum of all past fixings? >> >> Thanks for help in advance. >> Ashish >> >> On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...> >> wrote: >> >>> Ok understood. thanks. >>> >>> On Fri, 20 May 2022 at 14:46, Luigi Ballabio <lui...@gm...> >>> wrote: >>> >>>> It would be the sum of past fixings; for three past fixings of 100.2, >>>> 101.3 and 94.6 it would be 296.1. >>>> >>>> Luigi >>>> >>>> >>>> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal <ash...@gm...> >>>> wrote: >>>> >>>>> Thanks, Luigi for the suggestion. After taking the running >>>>> accumulator, we are able to generate the numbers. What exactly should be >>>>> passed here? The average price of past fixings or just 1 when the trade is >>>>> priced during averaging period? >>>>> >>>>> Thanks for help. >>>>> >>>>> Ashish >>>>> >>>>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio <lui...@gm...> >>>>> wrote: >>>>> >>>>>> I don't have a 1.7 version to try it, but the check is the one at < >>>>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>>>>> suggesting that your running accumulator should be 0 (which makes sense, >>>>>> because you're using arithmetic average, i.e., a sum, and if you don't have >>>>>> any fixings yet the sum should be 0.) >>>>>> Your default seems to be 1 instead. >>>>>> >>>>>> Luigi >>>>>> >>>>>> >>>>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal < >>>>>> ash...@gm...> wrote: >>>>>> >>>>>>> Luigi, >>>>>>> >>>>>>> Our code is not too much but we are using deprecated functions like >>>>>>> FDEuropeanEngine and FDAmericanEngine. Not sure if using new >>>>>>> function called FdBlackScholesVanillaEngine has any change in the >>>>>>> calculation that our code will have an impact. >>>>>>> >>>>>>> Can we use the DiscreteAveragingAsianOption without the overloaded >>>>>>> parameter of pastfixings under 1.7? >>>>>>> >>>>>>> Ashish >>>>>>> >>>>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio < >>>>>>> lui...@gm...> wrote: >>>>>>> >>>>>>>> Hi — it could be. Any particular reason you're still using a >>>>>>>> version from 4 years ago? If you have a substantial amount of code that >>>>>>>> depends on QuantLib, it might require some work to update because some >>>>>>>> methods were deprecated and then removed in the meantime; and of course >>>>>>>> you'll probably have some validation process in place when updating, so >>>>>>>> that's work too. But on the other hand, you're missing 4 years worth of >>>>>>>> bug fixings... >>>>>>>> >>>>>>>> Luigi >>>>>>>> >>>>>>>> >>>>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal < >>>>>>>> ash...@gm...> wrote: >>>>>>>> >>>>>>>>> We tried again and got the same error. >>>>>>>>> >>>>>>>>> Could it be due to the old version (1.7) we are using? I see in >>>>>>>>> the release notes of Apr-2021 that the overload for past fixing was added: >>>>>>>>> >>>>>>>>> - Added an overloaded constructor for Asian options that takes >>>>>>>>> all past fixings and thus allows to reprice them correctly when the >>>>>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>>>>> >>>>>>>>> Ashish >>>>>>>>> >>>>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Ashish, >>>>>>>>>> >>>>>>>>>> I have a better answer for you with a screenshot awaiting >>>>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your >>>>>>>>>> code without problems using the python at the bottom of this email >>>>>>>>>> (although I didn't check the numbers). >>>>>>>>>> >>>>>>>>>> If there is something you're doing specifically to generate the >>>>>>>>>> error, could you please attach a minimal reproduction of it? >>>>>>>>>> >>>>>>>>>> Best, >>>>>>>>>> Jack >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> import QuantLib as ql >>>>>>>>>> from copy import deepcopy >>>>>>>>>> from datetime import datetime >>>>>>>>>> from datetime import timedelta >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>>>>> DEFAULT_tGRID = 100 >>>>>>>>>> DEFAULT_xGRID = 100 >>>>>>>>>> DEFAULT_aGRID = 50 >>>>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> class AsianOptionPrice: >>>>>>>>>> def __init__(self, **x): >>>>>>>>>> for k, v in x.items(): >>>>>>>>>> setattr(self, k, v) >>>>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>>>>> self.pastFixings = x.get("pastFixings", >>>>>>>>>> DEFAULT_PASTFIXINGS) >>>>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", >>>>>>>>>> DEFAULT_aRA) >>>>>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>>>>> self.dist = 10**(-2) >>>>>>>>>> self.date_format = "%d-%m-%Y" >>>>>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>>>>>> self.exDay = >>>>>>>>>> ql.DateParser.parseFormatted(self.expiryDate, '%d-%m-%Y') >>>>>>>>>> # Volatility input is required for running the computing >>>>>>>>>> implied volatility function. This volatility is NOT used in the implied >>>>>>>>>> volatility calculation. >>>>>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>>>>> self.IV = None >>>>>>>>>> >>>>>>>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>>>>> _date.weekday() not in [1,7]] >>>>>>>>>> return fixture_dates >>>>>>>>>> def asian(self): >>>>>>>>>> """ >>>>>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>>>>> """ >>>>>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>>>>> pastFixings = self.pastFixings >>>>>>>>>> print(pastFixings) >>>>>>>>>> option_type = self.optionType.lower() >>>>>>>>>> if option_type not in ["call", "put"]: >>>>>>>>>> raise Exception( >>>>>>>>>> f"Option Type is Neither Call nor Put, Option >>>>>>>>>> type is {option_type}") >>>>>>>>>> option_type = ql.Option.Call if option_type == "call" >>>>>>>>>> else ql.Option.Put >>>>>>>>>> strike = self.strikePrice >>>>>>>>>> today = self.value_date >>>>>>>>>> print(today) >>>>>>>>>> fixingStartDate >>>>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>>>>> print("#"*40,fixingStartDate) >>>>>>>>>> periods = self.periods >>>>>>>>>> asianFutureFixingDates = >>>>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>>>>> asianExpiryDate = self.expiry_date >>>>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>>>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>>>>> discreteArithmeticAsianOption = >>>>>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>>>>> return discreteArithmeticAsianOption >>>>>>>>>> >>>>>>>>>> def create_arg_list(self, Option=None, >>>>>>>>>> compute_implied_vol=None, implied_vol_am_put=None): >>>>>>>>>> ''' >>>>>>>>>> The arguments with disturbances added. Will be used >>>>>>>>>> for calculation of Greeks >>>>>>>>>> using numerical differentiation. >>>>>>>>>> Creating a dictionary of arguments that will be used >>>>>>>>>> for option price and greeks calculation. >>>>>>>>>> ''' >>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>> originalDict_ = {k: getattr(self, k) for k in >>>>>>>>>> self.keyList} >>>>>>>>>> ListDict = [] >>>>>>>>>> for i in range(4): >>>>>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + >>>>>>>>>> self.dist >>>>>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>>>>> self.expiryDate, self.date_format) - >>>>>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>>>>> print(ListDict) >>>>>>>>>> return(ListDict) >>>>>>>>>> >>>>>>>>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>>>>>>>> """ >>>>>>>>>> Creating the Black-Scholes process for option valuation. >>>>>>>>>> """ >>>>>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>>>>> ql.FlatForward(self.value_date, 0, >>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>> volatility = >>>>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>>>>> self.value_date, ql.NullCalendar(), self.volatility, >>>>>>>>>> ql.Actual365Fixed())) >>>>>>>>>> initialValue = >>>>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>>>>> return(process) >>>>>>>>>> >>>>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>>>>> """ >>>>>>>>>> Call the relevant option based on the input. >>>>>>>>>> """ >>>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>>> res = None >>>>>>>>>> option = AsianOptionPrice.asian(self) >>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>> # create Black Scholes process using IV. >>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>>>>>> self.IV} >>>>>>>>>> else: >>>>>>>>>> # Create Black Scholes process using HV. >>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>> option.setPricingEngine(engine) >>>>>>>>>> res = {'value': option.NPV()} >>>>>>>>>> return res >>>>>>>>>> >>>>>>>>>> def evaluate_asian_npv(self): >>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>> res = Option.NPV() >>>>>>>>>> return(res) >>>>>>>>>> >>>>>>>>>> def calculate_greeks(self, Option=None, >>>>>>>>>> compute_implied_vol=None): >>>>>>>>>> today = self.value_date >>>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>>> if compute_implied_vol == True: >>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>>> else: >>>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>>> aGrid=self.aGrid) >>>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>>>>> Option.gamma( >>>>>>>>>> )} >>>>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>>>>> self, Option, compute_implied_vol=True, >>>>>>>>>> implied_vol_am_put=self.volatility) >>>>>>>>>> DisturbedPrices = [] >>>>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>>>>> for i in range(4): >>>>>>>>>> DisturbedPrices.append(eval( >>>>>>>>>> >>>>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>>>>> print(DisturbedPrices) >>>>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>>> thetaDay = (PricesDistrbd['PTup'] - >>>>>>>>>> PricesDistrbd['Price']) >>>>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, >>>>>>>>>> 'theta': thetaDay}) >>>>>>>>>> return option_greeks_ >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> settings = { >>>>>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>>>>> "tenantId": "380", >>>>>>>>>> "gridPoints": 149, >>>>>>>>>> "computeImpliedVolatiltiy": False, >>>>>>>>>> "runId": 3735, >>>>>>>>>> "timeSteps": 150, >>>>>>>>>> "optionTrades": [ >>>>>>>>>> { >>>>>>>>>> "underlyingPrice": 98.69, >>>>>>>>>> "refNo": "OPT-1135-GVA", >>>>>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>>>>> "valueDate": "17-03-2022", >>>>>>>>>> "fixingStartDate":"01-05-2022", >>>>>>>>>> "pastFixings":0, >>>>>>>>>> "volatility": 0.6015, >>>>>>>>>> "openQuantity": 1, >>>>>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>>>>> "optionType": "Call", >>>>>>>>>> "expiryDate": "31-05-2022", >>>>>>>>>> "exType": "asian", >>>>>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>>>>> "premium": 1, >>>>>>>>>> "portfolioId": 18209, >>>>>>>>>> "marketPremium": 11.42, >>>>>>>>>> "longShort": "Long", >>>>>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>>>>> "portfolioName": "Option Trades", >>>>>>>>>> "scenarioId": 8356, >>>>>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>>>>> "strikePrice": 95, >>>>>>>>>> "maturityInYears": 0.205479452 >>>>>>>>>> } >>>>>>>>>> ], >>>>>>>>>> "userId": "5263", >>>>>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>>>>> } >>>>>>>>>> >>>>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>>>>> opt.evaluate_asian_npv() >>>>>>>>>> >>>>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Jack, >>>>>>>>>>> >>>>>>>>>>> Please find attached the Asian option python code and the option >>>>>>>>>>> trade payload. >>>>>>>>>>> >>>>>>>>>>> Thanks for your help, >>>>>>>>>>> Regards, >>>>>>>>>>> Ashish >>>>>>>>>>> >>>>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi Ashish, >>>>>>>>>>>> >>>>>>>>>>>> I've just lifted the examples from your references directly for >>>>>>>>>>>> a discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>>>>>>>> me - can you share the code you are using that breaks please? >>>>>>>>>>>> >>>>>>>>>>>> Best, >>>>>>>>>>>> Jack >>>>>>>>>>>> >>>>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, < >>>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>>> >>>>>>>>>>>>> Hi all, >>>>>>>>>>>>> >>>>>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>>>>>>> fixing" >>>>>>>>>>>>> ref: >>>>>>>>>>>>> >>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>>>>> >>>>>>>>>>>>> Queries: >>>>>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>>>>> 2. For trade which is mid of averaging and has few past >>>>>>>>>>>>> fixings, do we need to pass the count of past fixing or the actual rates of >>>>>>>>>>>>> the pastfixing as an array? >>>>>>>>>>>>> >>>>>>>>>>>>> Any help will be appreciated. >>>>>>>>>>>>> >>>>>>>>>>>>> Thanks in advance >>>>>>>>>>>>> Ashish >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>>> Qua...@li... >>>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>>> >>>>>>>>>>>> _______________________________________________ >>>>>>>>> QuantLib-users mailing list >>>>>>>>> Qua...@li... >>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>> >>>>>>>> |
|
From: Luigi B. <lui...@gm...> - 2022-05-23 16:56:16
|
May you send sample code and the value of the fixings for one of those options? Thanks! Luigi On Mon, May 23, 2022 at 8:32 AM Ashish Bansal <ash...@gm...> wrote: > Luigi, > > We ran the asian code, which i sent earlier for a couple of asian options > traded on exchange. We got prices very close to traded prices when we used > the value of running accumulator as 1 for march option being valued on 17th > with past fixing count as 12. But when we used the sum of past fixing > prices i.e. 1302.88 we got a very different number like 6.09 against 4.57 > earlier and 14.11 against 12.39 earlier. > > Just want to confirm if i am missing something about running accumulator > and should it be really the sum of all past fixings? > > Thanks for help in advance. > Ashish > > On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...> > wrote: > >> Ok understood. thanks. >> >> On Fri, 20 May 2022 at 14:46, Luigi Ballabio <lui...@gm...> >> wrote: >> >>> It would be the sum of past fixings; for three past fixings of 100.2, >>> 101.3 and 94.6 it would be 296.1. >>> >>> Luigi >>> >>> >>> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal <ash...@gm...> >>> wrote: >>> >>>> Thanks, Luigi for the suggestion. After taking the running accumulator, >>>> we are able to generate the numbers. What exactly should be passed here? >>>> The average price of past fixings or just 1 when the trade is priced during >>>> averaging period? >>>> >>>> Thanks for help. >>>> >>>> Ashish >>>> >>>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio <lui...@gm...> >>>> wrote: >>>> >>>>> I don't have a 1.7 version to try it, but the check is the one at < >>>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>>>> suggesting that your running accumulator should be 0 (which makes sense, >>>>> because you're using arithmetic average, i.e., a sum, and if you don't have >>>>> any fixings yet the sum should be 0.) >>>>> Your default seems to be 1 instead. >>>>> >>>>> Luigi >>>>> >>>>> >>>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <ash...@gm...> >>>>> wrote: >>>>> >>>>>> Luigi, >>>>>> >>>>>> Our code is not too much but we are using deprecated functions like >>>>>> FDEuropeanEngine and FDAmericanEngine. Not sure if using new >>>>>> function called FdBlackScholesVanillaEngine has any change in the >>>>>> calculation that our code will have an impact. >>>>>> >>>>>> Can we use the DiscreteAveragingAsianOption without the overloaded >>>>>> parameter of pastfixings under 1.7? >>>>>> >>>>>> Ashish >>>>>> >>>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio < >>>>>> lui...@gm...> wrote: >>>>>> >>>>>>> Hi — it could be. Any particular reason you're still using a >>>>>>> version from 4 years ago? If you have a substantial amount of code that >>>>>>> depends on QuantLib, it might require some work to update because some >>>>>>> methods were deprecated and then removed in the meantime; and of course >>>>>>> you'll probably have some validation process in place when updating, so >>>>>>> that's work too. But on the other hand, you're missing 4 years worth of >>>>>>> bug fixings... >>>>>>> >>>>>>> Luigi >>>>>>> >>>>>>> >>>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal < >>>>>>> ash...@gm...> wrote: >>>>>>> >>>>>>>> We tried again and got the same error. >>>>>>>> >>>>>>>> Could it be due to the old version (1.7) we are using? I see in the >>>>>>>> release notes of Apr-2021 that the overload for past fixing was added: >>>>>>>> >>>>>>>> - Added an overloaded constructor for Asian options that takes >>>>>>>> all past fixings and thus allows to reprice them correctly when the >>>>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>>>> >>>>>>>> Ashish >>>>>>>> >>>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi Ashish, >>>>>>>>> >>>>>>>>> I have a better answer for you with a screenshot awaiting >>>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your >>>>>>>>> code without problems using the python at the bottom of this email >>>>>>>>> (although I didn't check the numbers). >>>>>>>>> >>>>>>>>> If there is something you're doing specifically to generate the >>>>>>>>> error, could you please attach a minimal reproduction of it? >>>>>>>>> >>>>>>>>> Best, >>>>>>>>> Jack >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> import QuantLib as ql >>>>>>>>> from copy import deepcopy >>>>>>>>> from datetime import datetime >>>>>>>>> from datetime import timedelta >>>>>>>>> >>>>>>>>> >>>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>>>> DEFAULT_tGRID = 100 >>>>>>>>> DEFAULT_xGRID = 100 >>>>>>>>> DEFAULT_aGRID = 50 >>>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>>>> >>>>>>>>> >>>>>>>>> class AsianOptionPrice: >>>>>>>>> def __init__(self, **x): >>>>>>>>> for k, v in x.items(): >>>>>>>>> setattr(self, k, v) >>>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>>>> self.pastFixings = x.get("pastFixings", >>>>>>>>> DEFAULT_PASTFIXINGS) >>>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", >>>>>>>>> DEFAULT_aRA) >>>>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>>>> self.dist = 10**(-2) >>>>>>>>> self.date_format = "%d-%m-%Y" >>>>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>>>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate, >>>>>>>>> '%d-%m-%Y') >>>>>>>>> # Volatility input is required for running the computing >>>>>>>>> implied volatility function. This volatility is NOT used in the implied >>>>>>>>> volatility calculation. >>>>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>>>> self.IV = None >>>>>>>>> >>>>>>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>>>> _date.weekday() not in [1,7]] >>>>>>>>> return fixture_dates >>>>>>>>> def asian(self): >>>>>>>>> """ >>>>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>>>> """ >>>>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>>>> pastFixings = self.pastFixings >>>>>>>>> print(pastFixings) >>>>>>>>> option_type = self.optionType.lower() >>>>>>>>> if option_type not in ["call", "put"]: >>>>>>>>> raise Exception( >>>>>>>>> f"Option Type is Neither Call nor Put, Option type >>>>>>>>> is {option_type}") >>>>>>>>> option_type = ql.Option.Call if option_type == "call" else >>>>>>>>> ql.Option.Put >>>>>>>>> strike = self.strikePrice >>>>>>>>> today = self.value_date >>>>>>>>> print(today) >>>>>>>>> fixingStartDate >>>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>>>> print("#"*40,fixingStartDate) >>>>>>>>> periods = self.periods >>>>>>>>> asianFutureFixingDates = >>>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>>>> asianExpiryDate = self.expiry_date >>>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>>>> discreteArithmeticAsianOption = >>>>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>>>> return discreteArithmeticAsianOption >>>>>>>>> >>>>>>>>> def create_arg_list(self, Option=None, >>>>>>>>> compute_implied_vol=None, implied_vol_am_put=None): >>>>>>>>> ''' >>>>>>>>> The arguments with disturbances added. Will be used >>>>>>>>> for calculation of Greeks >>>>>>>>> using numerical differentiation. >>>>>>>>> Creating a dictionary of arguments that will be used >>>>>>>>> for option price and greeks calculation. >>>>>>>>> ''' >>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>> originalDict_ = {k: getattr(self, k) for k in self.keyList} >>>>>>>>> ListDict = [] >>>>>>>>> for i in range(4): >>>>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist >>>>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>>>> self.expiryDate, self.date_format) - >>>>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>>>> print(ListDict) >>>>>>>>> return(ListDict) >>>>>>>>> >>>>>>>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>>>>>>> """ >>>>>>>>> Creating the Black-Scholes process for option valuation. >>>>>>>>> """ >>>>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>>>>> ql.Actual365Fixed())) >>>>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>>>> ql.FlatForward(self.value_date, 0, >>>>>>>>> ql.Actual365Fixed())) >>>>>>>>> volatility = >>>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>>>> self.value_date, ql.NullCalendar(), self.volatility, >>>>>>>>> ql.Actual365Fixed())) >>>>>>>>> initialValue = >>>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>>>> return(process) >>>>>>>>> >>>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>>>> """ >>>>>>>>> Call the relevant option based on the input. >>>>>>>>> """ >>>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>>> res = None >>>>>>>>> option = AsianOptionPrice.asian(self) >>>>>>>>> if compute_implied_vol == True: >>>>>>>>> # create Black Scholes process using IV. >>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>> aGrid=self.aGrid) >>>>>>>>> option.setPricingEngine(engine) >>>>>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>>>>> self.IV} >>>>>>>>> else: >>>>>>>>> # Create Black Scholes process using HV. >>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>> aGrid=self.aGrid) >>>>>>>>> option.setPricingEngine(engine) >>>>>>>>> res = {'value': option.NPV()} >>>>>>>>> return res >>>>>>>>> >>>>>>>>> def evaluate_asian_npv(self): >>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>> aGrid=self.aGrid) >>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>> res = Option.NPV() >>>>>>>>> return(res) >>>>>>>>> >>>>>>>>> def calculate_greeks(self, Option=None, >>>>>>>>> compute_implied_vol=None): >>>>>>>>> today = self.value_date >>>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>>> if compute_implied_vol == True: >>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>>> else: >>>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>>> aGrid=self.aGrid) >>>>>>>>> Option.setPricingEngine(engine) >>>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>>>> Option.gamma( >>>>>>>>> )} >>>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>>>> self, Option, compute_implied_vol=True, >>>>>>>>> implied_vol_am_put=self.volatility) >>>>>>>>> DisturbedPrices = [] >>>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>>>> for i in range(4): >>>>>>>>> DisturbedPrices.append(eval( >>>>>>>>> >>>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>>>> print(DisturbedPrices) >>>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price']) >>>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta': >>>>>>>>> thetaDay}) >>>>>>>>> return option_greeks_ >>>>>>>>> >>>>>>>>> >>>>>>>>> settings = { >>>>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>>>> "tenantId": "380", >>>>>>>>> "gridPoints": 149, >>>>>>>>> "computeImpliedVolatiltiy": False, >>>>>>>>> "runId": 3735, >>>>>>>>> "timeSteps": 150, >>>>>>>>> "optionTrades": [ >>>>>>>>> { >>>>>>>>> "underlyingPrice": 98.69, >>>>>>>>> "refNo": "OPT-1135-GVA", >>>>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>>>> "valueDate": "17-03-2022", >>>>>>>>> "fixingStartDate":"01-05-2022", >>>>>>>>> "pastFixings":0, >>>>>>>>> "volatility": 0.6015, >>>>>>>>> "openQuantity": 1, >>>>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>>>> "optionType": "Call", >>>>>>>>> "expiryDate": "31-05-2022", >>>>>>>>> "exType": "asian", >>>>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>>>> "premium": 1, >>>>>>>>> "portfolioId": 18209, >>>>>>>>> "marketPremium": 11.42, >>>>>>>>> "longShort": "Long", >>>>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>>>> "portfolioName": "Option Trades", >>>>>>>>> "scenarioId": 8356, >>>>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>>>> "strikePrice": 95, >>>>>>>>> "maturityInYears": 0.205479452 >>>>>>>>> } >>>>>>>>> ], >>>>>>>>> "userId": "5263", >>>>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>>>> } >>>>>>>>> >>>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>>>> opt.evaluate_asian_npv() >>>>>>>>> >>>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>>>> ash...@gm...> wrote: >>>>>>>>> >>>>>>>>>> Hi Jack, >>>>>>>>>> >>>>>>>>>> Please find attached the Asian option python code and the option >>>>>>>>>> trade payload. >>>>>>>>>> >>>>>>>>>> Thanks for your help, >>>>>>>>>> Regards, >>>>>>>>>> Ashish >>>>>>>>>> >>>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>>>>>> wrote: >>>>>>>>>> >>>>>>>>>>> Hi Ashish, >>>>>>>>>>> >>>>>>>>>>> I've just lifted the examples from your references directly for >>>>>>>>>>> a discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>>>>>>> me - can you share the code you are using that breaks please? >>>>>>>>>>> >>>>>>>>>>> Best, >>>>>>>>>>> Jack >>>>>>>>>>> >>>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, < >>>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>>> >>>>>>>>>>>> Hi all, >>>>>>>>>>>> >>>>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>>>>>> fixing" >>>>>>>>>>>> ref: >>>>>>>>>>>> >>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>>>> >>>>>>>>>>>> Queries: >>>>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>>>> 2. For trade which is mid of averaging and has few past >>>>>>>>>>>> fixings, do we need to pass the count of past fixing or the actual rates of >>>>>>>>>>>> the pastfixing as an array? >>>>>>>>>>>> >>>>>>>>>>>> Any help will be appreciated. >>>>>>>>>>>> >>>>>>>>>>>> Thanks in advance >>>>>>>>>>>> Ashish >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>>> Qua...@li... >>>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>>> >>>>>>>>>>> _______________________________________________ >>>>>>>> QuantLib-users mailing list >>>>>>>> Qua...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>> >>>>>>> |
|
From: Ashish B. <ash...@gm...> - 2022-05-23 06:32:57
|
Luigi, We ran the asian code, which i sent earlier for a couple of asian options traded on exchange. We got prices very close to traded prices when we used the value of running accumulator as 1 for march option being valued on 17th with past fixing count as 12. But when we used the sum of past fixing prices i.e. 1302.88 we got a very different number like 6.09 against 4.57 earlier and 14.11 against 12.39 earlier. Just want to confirm if i am missing something about running accumulator and should it be really the sum of all past fixings? Thanks for help in advance. Ashish On Fri, 20 May 2022 at 14:58, Ashish Bansal <ash...@gm...> wrote: > Ok understood. thanks. > > On Fri, 20 May 2022 at 14:46, Luigi Ballabio <lui...@gm...> > wrote: > >> It would be the sum of past fixings; for three past fixings of 100.2, >> 101.3 and 94.6 it would be 296.1. >> >> Luigi >> >> >> On Thu, May 19, 2022 at 12:37 PM Ashish Bansal <ash...@gm...> >> wrote: >> >>> Thanks, Luigi for the suggestion. After taking the running accumulator, >>> we are able to generate the numbers. What exactly should be passed here? >>> The average price of past fixings or just 1 when the trade is priced during >>> averaging period? >>> >>> Thanks for help. >>> >>> Ashish >>> >>> On Wed, 18 May 2022 at 21:17, Luigi Ballabio <lui...@gm...> >>> wrote: >>> >>>> I don't have a 1.7 version to try it, but the check is the one at < >>>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>>> suggesting that your running accumulator should be 0 (which makes sense, >>>> because you're using arithmetic average, i.e., a sum, and if you don't have >>>> any fixings yet the sum should be 0.) >>>> Your default seems to be 1 instead. >>>> >>>> Luigi >>>> >>>> >>>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <ash...@gm...> >>>> wrote: >>>> >>>>> Luigi, >>>>> >>>>> Our code is not too much but we are using deprecated functions like >>>>> FDEuropeanEngine and FDAmericanEngine. Not sure if using new function >>>>> called FdBlackScholesVanillaEngine has any change in the calculation >>>>> that our code will have an impact. >>>>> >>>>> Can we use the DiscreteAveragingAsianOption without the overloaded >>>>> parameter of pastfixings under 1.7? >>>>> >>>>> Ashish >>>>> >>>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio <lui...@gm...> >>>>> wrote: >>>>> >>>>>> Hi — it could be. Any particular reason you're still using a >>>>>> version from 4 years ago? If you have a substantial amount of code that >>>>>> depends on QuantLib, it might require some work to update because some >>>>>> methods were deprecated and then removed in the meantime; and of course >>>>>> you'll probably have some validation process in place when updating, so >>>>>> that's work too. But on the other hand, you're missing 4 years worth of >>>>>> bug fixings... >>>>>> >>>>>> Luigi >>>>>> >>>>>> >>>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal < >>>>>> ash...@gm...> wrote: >>>>>> >>>>>>> We tried again and got the same error. >>>>>>> >>>>>>> Could it be due to the old version (1.7) we are using? I see in the >>>>>>> release notes of Apr-2021 that the overload for past fixing was added: >>>>>>> >>>>>>> - Added an overloaded constructor for Asian options that takes >>>>>>> all past fixings and thus allows to reprice them correctly when the >>>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>>> >>>>>>> Ashish >>>>>>> >>>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Ashish, >>>>>>>> >>>>>>>> I have a better answer for you with a screenshot awaiting >>>>>>>> moderation as it's quite large, but in the meantime, I was able to run your >>>>>>>> code without problems using the python at the bottom of this email >>>>>>>> (although I didn't check the numbers). >>>>>>>> >>>>>>>> If there is something you're doing specifically to generate the >>>>>>>> error, could you please attach a minimal reproduction of it? >>>>>>>> >>>>>>>> Best, >>>>>>>> Jack >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> import QuantLib as ql >>>>>>>> from copy import deepcopy >>>>>>>> from datetime import datetime >>>>>>>> from datetime import timedelta >>>>>>>> >>>>>>>> >>>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>>> DEFAULT_tGRID = 100 >>>>>>>> DEFAULT_xGRID = 100 >>>>>>>> DEFAULT_aGRID = 50 >>>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>>> >>>>>>>> >>>>>>>> class AsianOptionPrice: >>>>>>>> def __init__(self, **x): >>>>>>>> for k, v in x.items(): >>>>>>>> setattr(self, k, v) >>>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS) >>>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", >>>>>>>> DEFAULT_aRA) >>>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>>> self.dist = 10**(-2) >>>>>>>> self.date_format = "%d-%m-%Y" >>>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate, >>>>>>>> '%d-%m-%Y') >>>>>>>> # Volatility input is required for running the computing >>>>>>>> implied volatility function. This volatility is NOT used in the implied >>>>>>>> volatility calculation. >>>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>>> self.IV = None >>>>>>>> >>>>>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>>> _date.weekday() not in [1,7]] >>>>>>>> return fixture_dates >>>>>>>> def asian(self): >>>>>>>> """ >>>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>>> """ >>>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>>> pastFixings = self.pastFixings >>>>>>>> print(pastFixings) >>>>>>>> option_type = self.optionType.lower() >>>>>>>> if option_type not in ["call", "put"]: >>>>>>>> raise Exception( >>>>>>>> f"Option Type is Neither Call nor Put, Option type >>>>>>>> is {option_type}") >>>>>>>> option_type = ql.Option.Call if option_type == "call" else >>>>>>>> ql.Option.Put >>>>>>>> strike = self.strikePrice >>>>>>>> today = self.value_date >>>>>>>> print(today) >>>>>>>> fixingStartDate >>>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>>> print("#"*40,fixingStartDate) >>>>>>>> periods = self.periods >>>>>>>> asianFutureFixingDates = >>>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>>> asianExpiryDate = self.expiry_date >>>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>>> discreteArithmeticAsianOption = >>>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>>> return discreteArithmeticAsianOption >>>>>>>> >>>>>>>> def create_arg_list(self, Option=None, >>>>>>>> compute_implied_vol=None, implied_vol_am_put=None): >>>>>>>> ''' >>>>>>>> The arguments with disturbances added. Will be used for >>>>>>>> calculation of Greeks >>>>>>>> using numerical differentiation. >>>>>>>> Creating a dictionary of arguments that will be used >>>>>>>> for option price and greeks calculation. >>>>>>>> ''' >>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>> originalDict_ = {k: getattr(self, k) for k in self.keyList} >>>>>>>> ListDict = [] >>>>>>>> for i in range(4): >>>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist >>>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>>> self.expiryDate, self.date_format) - >>>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>>> print(ListDict) >>>>>>>> return(ListDict) >>>>>>>> >>>>>>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>>>>>> """ >>>>>>>> Creating the Black-Scholes process for option valuation. >>>>>>>> """ >>>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>>>> ql.Actual365Fixed())) >>>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed())) >>>>>>>> volatility = >>>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>>> self.value_date, ql.NullCalendar(), self.volatility, >>>>>>>> ql.Actual365Fixed())) >>>>>>>> initialValue = >>>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>>> return(process) >>>>>>>> >>>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>>> """ >>>>>>>> Call the relevant option based on the input. >>>>>>>> """ >>>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>>> res = None >>>>>>>> option = AsianOptionPrice.asian(self) >>>>>>>> if compute_implied_vol == True: >>>>>>>> # create Black Scholes process using IV. >>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>> aGrid=self.aGrid) >>>>>>>> option.setPricingEngine(engine) >>>>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>>>> self.IV} >>>>>>>> else: >>>>>>>> # Create Black Scholes process using HV. >>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>> aGrid=self.aGrid) >>>>>>>> option.setPricingEngine(engine) >>>>>>>> res = {'value': option.NPV()} >>>>>>>> return res >>>>>>>> >>>>>>>> def evaluate_asian_npv(self): >>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>> aGrid=self.aGrid) >>>>>>>> Option.setPricingEngine(engine) >>>>>>>> res = Option.NPV() >>>>>>>> return(res) >>>>>>>> >>>>>>>> def calculate_greeks(self, Option=None, >>>>>>>> compute_implied_vol=None): >>>>>>>> today = self.value_date >>>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>>> if compute_implied_vol == True: >>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>>> else: >>>>>>>> process = AsianOptionPrice.bs_process( >>>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>>> aGrid=self.aGrid) >>>>>>>> Option.setPricingEngine(engine) >>>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>>> Option.gamma( >>>>>>>> )} >>>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>>> self, Option, compute_implied_vol=True, >>>>>>>> implied_vol_am_put=self.volatility) >>>>>>>> DisturbedPrices = [] >>>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>>> for i in range(4): >>>>>>>> DisturbedPrices.append(eval( >>>>>>>> >>>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>>> print(DisturbedPrices) >>>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price']) >>>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta': >>>>>>>> thetaDay}) >>>>>>>> return option_greeks_ >>>>>>>> >>>>>>>> >>>>>>>> settings = { >>>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>>> "tenantId": "380", >>>>>>>> "gridPoints": 149, >>>>>>>> "computeImpliedVolatiltiy": False, >>>>>>>> "runId": 3735, >>>>>>>> "timeSteps": 150, >>>>>>>> "optionTrades": [ >>>>>>>> { >>>>>>>> "underlyingPrice": 98.69, >>>>>>>> "refNo": "OPT-1135-GVA", >>>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>>> "valueDate": "17-03-2022", >>>>>>>> "fixingStartDate":"01-05-2022", >>>>>>>> "pastFixings":0, >>>>>>>> "volatility": 0.6015, >>>>>>>> "openQuantity": 1, >>>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>>> "optionType": "Call", >>>>>>>> "expiryDate": "31-05-2022", >>>>>>>> "exType": "asian", >>>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>>> "premium": 1, >>>>>>>> "portfolioId": 18209, >>>>>>>> "marketPremium": 11.42, >>>>>>>> "longShort": "Long", >>>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>>> "portfolioName": "Option Trades", >>>>>>>> "scenarioId": 8356, >>>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>>> "strikePrice": 95, >>>>>>>> "maturityInYears": 0.205479452 >>>>>>>> } >>>>>>>> ], >>>>>>>> "userId": "5263", >>>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>>> } >>>>>>>> >>>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>>> opt.evaluate_asian_npv() >>>>>>>> >>>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>>> ash...@gm...> wrote: >>>>>>>> >>>>>>>>> Hi Jack, >>>>>>>>> >>>>>>>>> Please find attached the Asian option python code and the option >>>>>>>>> trade payload. >>>>>>>>> >>>>>>>>> Thanks for your help, >>>>>>>>> Regards, >>>>>>>>> Ashish >>>>>>>>> >>>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi Ashish, >>>>>>>>>> >>>>>>>>>> I've just lifted the examples from your references directly for a >>>>>>>>>> discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>>>>>> me - can you share the code you are using that breaks please? >>>>>>>>>> >>>>>>>>>> Best, >>>>>>>>>> Jack >>>>>>>>>> >>>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, < >>>>>>>>>> ash...@gm...> wrote: >>>>>>>>>> >>>>>>>>>>> Hi all, >>>>>>>>>>> >>>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>>>>> fixing" >>>>>>>>>>> ref: >>>>>>>>>>> >>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>>> >>>>>>>>>>> Queries: >>>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>>> 2. For trade which is mid of averaging and has few past fixings, >>>>>>>>>>> do we need to pass the count of past fixing or the actual rates of the >>>>>>>>>>> pastfixing as an array? >>>>>>>>>>> >>>>>>>>>>> Any help will be appreciated. >>>>>>>>>>> >>>>>>>>>>> Thanks in advance >>>>>>>>>>> Ashish >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> QuantLib-users mailing list >>>>>>>>>>> Qua...@li... >>>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>>> >>>>>>>>>> _______________________________________________ >>>>>>> QuantLib-users mailing list >>>>>>> Qua...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>> >>>>>> |
|
From: Ashish B. <ash...@gm...> - 2022-05-20 09:28:31
|
Ok understood. thanks. On Fri, 20 May 2022 at 14:46, Luigi Ballabio <lui...@gm...> wrote: > It would be the sum of past fixings; for three past fixings of 100.2, > 101.3 and 94.6 it would be 296.1. > > Luigi > > > On Thu, May 19, 2022 at 12:37 PM Ashish Bansal <ash...@gm...> > wrote: > >> Thanks, Luigi for the suggestion. After taking the running accumulator, >> we are able to generate the numbers. What exactly should be passed here? >> The average price of past fixings or just 1 when the trade is priced during >> averaging period? >> >> Thanks for help. >> >> Ashish >> >> On Wed, 18 May 2022 at 21:17, Luigi Ballabio <lui...@gm...> >> wrote: >> >>> I don't have a 1.7 version to try it, but the check is the one at < >>> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >>> suggesting that your running accumulator should be 0 (which makes sense, >>> because you're using arithmetic average, i.e., a sum, and if you don't have >>> any fixings yet the sum should be 0.) >>> Your default seems to be 1 instead. >>> >>> Luigi >>> >>> >>> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <ash...@gm...> >>> wrote: >>> >>>> Luigi, >>>> >>>> Our code is not too much but we are using deprecated functions like >>>> FDEuropeanEngine and FDAmericanEngine. Not sure if using new function >>>> called FdBlackScholesVanillaEngine has any change in the calculation >>>> that our code will have an impact. >>>> >>>> Can we use the DiscreteAveragingAsianOption without the overloaded >>>> parameter of pastfixings under 1.7? >>>> >>>> Ashish >>>> >>>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio <lui...@gm...> >>>> wrote: >>>> >>>>> Hi — it could be. Any particular reason you're still using a version >>>>> from 4 years ago? If you have a substantial amount of code that depends on >>>>> QuantLib, it might require some work to update because some methods were >>>>> deprecated and then removed in the meantime; and of course you'll probably >>>>> have some validation process in place when updating, so that's work too. >>>>> But on the other hand, you're missing 4 years worth of bug fixings... >>>>> >>>>> Luigi >>>>> >>>>> >>>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <ash...@gm...> >>>>> wrote: >>>>> >>>>>> We tried again and got the same error. >>>>>> >>>>>> Could it be due to the old version (1.7) we are using? I see in the >>>>>> release notes of Apr-2021 that the overload for past fixing was added: >>>>>> >>>>>> - Added an overloaded constructor for Asian options that takes >>>>>> all past fixings and thus allows to reprice them correctly when the >>>>>> evaluation date changes (thanks to Jack Gillett). >>>>>> >>>>>> Ashish >>>>>> >>>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> >>>>>> wrote: >>>>>> >>>>>>> Hi Ashish, >>>>>>> >>>>>>> I have a better answer for you with a screenshot awaiting moderation >>>>>>> as it's quite large, but in the meantime, I was able to run your code >>>>>>> without problems using the python at the bottom of this email (although I >>>>>>> didn't check the numbers). >>>>>>> >>>>>>> If there is something you're doing specifically to generate the >>>>>>> error, could you please attach a minimal reproduction of it? >>>>>>> >>>>>>> Best, >>>>>>> Jack >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> import QuantLib as ql >>>>>>> from copy import deepcopy >>>>>>> from datetime import datetime >>>>>>> from datetime import timedelta >>>>>>> >>>>>>> >>>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>>> DEFAULT_tGRID = 100 >>>>>>> DEFAULT_xGRID = 100 >>>>>>> DEFAULT_aGRID = 50 >>>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>>> >>>>>>> >>>>>>> class AsianOptionPrice: >>>>>>> def __init__(self, **x): >>>>>>> for k, v in x.items(): >>>>>>> setattr(self, k, v) >>>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS) >>>>>>> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA) >>>>>>> self.keyList = [k for k, v in x.items()] >>>>>>> self.dist = 10**(-2) >>>>>>> self.date_format = "%d-%m-%Y" >>>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>>> self.valueDate, '%d-%m-%Y') >>>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>>> self.expiryDate, '%d-%m-%Y') >>>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate, >>>>>>> '%d-%m-%Y') >>>>>>> # Volatility input is required for running the computing >>>>>>> implied volatility function. This volatility is NOT used in the implied >>>>>>> volatility calculation. >>>>>>> self.vol_for_iv_calc = 0.10 >>>>>>> self.IV = None >>>>>>> >>>>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>>>> fixture_dates = [_date for _date in schedule if >>>>>>> _date.weekday() not in [1,7]] >>>>>>> return fixture_dates >>>>>>> def asian(self): >>>>>>> """ >>>>>>> arithmeticRunningAccumulator(aRA) >>>>>>> """ >>>>>>> arithmeticRunningAccumulator = self.aRA >>>>>>> pastFixings = self.pastFixings >>>>>>> print(pastFixings) >>>>>>> option_type = self.optionType.lower() >>>>>>> if option_type not in ["call", "put"]: >>>>>>> raise Exception( >>>>>>> f"Option Type is Neither Call nor Put, Option type >>>>>>> is {option_type}") >>>>>>> option_type = ql.Option.Call if option_type == "call" else >>>>>>> ql.Option.Put >>>>>>> strike = self.strikePrice >>>>>>> today = self.value_date >>>>>>> print(today) >>>>>>> fixingStartDate >>>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>>> print("#"*40,fixingStartDate) >>>>>>> periods = self.periods >>>>>>> asianFutureFixingDates = >>>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>>> print("#"*40,asianFutureFixingDates) >>>>>>> asianExpiryDate = self.expiry_date >>>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>>> discreteArithmeticAsianOption = >>>>>>> ql.DiscreteAveragingAsianOption( >>>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>>> return discreteArithmeticAsianOption >>>>>>> >>>>>>> def create_arg_list(self, Option=None, compute_implied_vol=None, >>>>>>> implied_vol_am_put=None): >>>>>>> ''' >>>>>>> The arguments with disturbances added. Will be used for >>>>>>> calculation of Greeks >>>>>>> using numerical differentiation. >>>>>>> Creating a dictionary of arguments that will be used for >>>>>>> option price and greeks calculation. >>>>>>> ''' >>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>> originalDict_ = {k: getattr(self, k) for k in self.keyList} >>>>>>> ListDict = [] >>>>>>> for i in range(4): >>>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist >>>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>>> self.expiryDate, self.date_format) - >>>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>>> print(ListDict) >>>>>>> return(ListDict) >>>>>>> >>>>>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>>>>> """ >>>>>>> Creating the Black-Scholes process for option valuation. >>>>>>> """ >>>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>>> ql.Actual365Fixed())) >>>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed())) >>>>>>> volatility = >>>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>>> self.value_date, ql.NullCalendar(), self.volatility, >>>>>>> ql.Actual365Fixed())) >>>>>>> initialValue = >>>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>>> process = ql.BlackScholesMertonProcess( >>>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>>> return(process) >>>>>>> >>>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>>> """ >>>>>>> Call the relevant option based on the input. >>>>>>> """ >>>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>>> res = None >>>>>>> option = AsianOptionPrice.asian(self) >>>>>>> if compute_implied_vol == True: >>>>>>> # create Black Scholes process using IV. >>>>>>> process = AsianOptionPrice.bs_process( >>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>> aGrid=self.aGrid) >>>>>>> option.setPricingEngine(engine) >>>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>>> self.IV} >>>>>>> else: >>>>>>> # Create Black Scholes process using HV. >>>>>>> process = AsianOptionPrice.bs_process( >>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>> aGrid=self.aGrid) >>>>>>> option.setPricingEngine(engine) >>>>>>> res = {'value': option.NPV()} >>>>>>> return res >>>>>>> >>>>>>> def evaluate_asian_npv(self): >>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>> process = AsianOptionPrice.bs_process( >>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>> aGrid=self.aGrid) >>>>>>> Option.setPricingEngine(engine) >>>>>>> res = Option.NPV() >>>>>>> return(res) >>>>>>> >>>>>>> def calculate_greeks(self, Option=None, >>>>>>> compute_implied_vol=None): >>>>>>> today = self.value_date >>>>>>> Option = AsianOptionPrice.asian(self) >>>>>>> if compute_implied_vol == True: >>>>>>> process = AsianOptionPrice.bs_process( >>>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>>> else: >>>>>>> process = AsianOptionPrice.bs_process( >>>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>>> aGrid=self.aGrid) >>>>>>> Option.setPricingEngine(engine) >>>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>>> Option.gamma( >>>>>>> )} >>>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>>> self, Option, compute_implied_vol=True, >>>>>>> implied_vol_am_put=self.volatility) >>>>>>> DisturbedPrices = [] >>>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>>> for i in range(4): >>>>>>> DisturbedPrices.append(eval( >>>>>>> >>>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>>> print(DisturbedPrices) >>>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>> vega = (PricesDistrbd['PVup'] - >>>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price']) >>>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta': >>>>>>> thetaDay}) >>>>>>> return option_greeks_ >>>>>>> >>>>>>> >>>>>>> settings = { >>>>>>> "computeHistoricalVolatiltiy": False, >>>>>>> "tenantId": "380", >>>>>>> "gridPoints": 149, >>>>>>> "computeImpliedVolatiltiy": False, >>>>>>> "runId": 3735, >>>>>>> "timeSteps": 150, >>>>>>> "optionTrades": [ >>>>>>> { >>>>>>> "underlyingPrice": 98.69, >>>>>>> "refNo": "OPT-1135-GVA", >>>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>>> "valueDate": "17-03-2022", >>>>>>> "fixingStartDate":"01-05-2022", >>>>>>> "pastFixings":0, >>>>>>> "volatility": 0.6015, >>>>>>> "openQuantity": 1, >>>>>>> "strikePriceUnit": "US cents/LB", >>>>>>> "optionType": "Call", >>>>>>> "expiryDate": "31-05-2022", >>>>>>> "exType": "asian", >>>>>>> "riskFreeRate": 0.8080374999999999, >>>>>>> "premium": 1, >>>>>>> "portfolioId": 18209, >>>>>>> "marketPremium": 11.42, >>>>>>> "longShort": "Long", >>>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>>> "asset": "EURO USD 1.105 Call", >>>>>>> "portfolioName": "Option Trades", >>>>>>> "scenarioId": 8356, >>>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>>> "strikePrice": 95, >>>>>>> "maturityInYears": 0.205479452 >>>>>>> } >>>>>>> ], >>>>>>> "userId": "5263", >>>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>>> } >>>>>>> >>>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>>> opt.evaluate_asian_npv() >>>>>>> >>>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>>> ash...@gm...> wrote: >>>>>>> >>>>>>>> Hi Jack, >>>>>>>> >>>>>>>> Please find attached the Asian option python code and the option >>>>>>>> trade payload. >>>>>>>> >>>>>>>> Thanks for your help, >>>>>>>> Regards, >>>>>>>> Ashish >>>>>>>> >>>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi Ashish, >>>>>>>>> >>>>>>>>> I've just lifted the examples from your references directly for a >>>>>>>>> discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>>>>> me - can you share the code you are using that breaks please? >>>>>>>>> >>>>>>>>> Best, >>>>>>>>> Jack >>>>>>>>> >>>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Hi all, >>>>>>>>>> >>>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>>>> fixing" >>>>>>>>>> ref: >>>>>>>>>> >>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>>> >>>>>>>>>> Queries: >>>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>>> 2. For trade which is mid of averaging and has few past fixings, >>>>>>>>>> do we need to pass the count of past fixing or the actual rates of the >>>>>>>>>> pastfixing as an array? >>>>>>>>>> >>>>>>>>>> Any help will be appreciated. >>>>>>>>>> >>>>>>>>>> Thanks in advance >>>>>>>>>> Ashish >>>>>>>>>> _______________________________________________ >>>>>>>>>> QuantLib-users mailing list >>>>>>>>>> Qua...@li... >>>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>>> >>>>>>>>> _______________________________________________ >>>>>> QuantLib-users mailing list >>>>>> Qua...@li... >>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>> >>>>> |
|
From: Luigi B. <lui...@gm...> - 2022-05-20 09:17:00
|
It would be the sum of past fixings; for three past fixings of 100.2, 101.3 and 94.6 it would be 296.1. Luigi On Thu, May 19, 2022 at 12:37 PM Ashish Bansal <ash...@gm...> wrote: > Thanks, Luigi for the suggestion. After taking the running accumulator, we > are able to generate the numbers. What exactly should be passed here? The > average price of past fixings or just 1 when the trade is priced during > averaging period? > > Thanks for help. > > Ashish > > On Wed, 18 May 2022 at 21:17, Luigi Ballabio <lui...@gm...> > wrote: > >> I don't have a 1.7 version to try it, but the check is the one at < >> https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, >> suggesting that your running accumulator should be 0 (which makes sense, >> because you're using arithmetic average, i.e., a sum, and if you don't have >> any fixings yet the sum should be 0.) >> Your default seems to be 1 instead. >> >> Luigi >> >> >> On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <ash...@gm...> >> wrote: >> >>> Luigi, >>> >>> Our code is not too much but we are using deprecated functions like >>> FDEuropeanEngine and FDAmericanEngine. Not sure if using new function >>> called FdBlackScholesVanillaEngine has any change in the calculation >>> that our code will have an impact. >>> >>> Can we use the DiscreteAveragingAsianOption without the overloaded >>> parameter of pastfixings under 1.7? >>> >>> Ashish >>> >>> On Wed, 18 May 2022 at 20:00, Luigi Ballabio <lui...@gm...> >>> wrote: >>> >>>> Hi — it could be. Any particular reason you're still using a version >>>> from 4 years ago? If you have a substantial amount of code that depends on >>>> QuantLib, it might require some work to update because some methods were >>>> deprecated and then removed in the meantime; and of course you'll probably >>>> have some validation process in place when updating, so that's work too. >>>> But on the other hand, you're missing 4 years worth of bug fixings... >>>> >>>> Luigi >>>> >>>> >>>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <ash...@gm...> >>>> wrote: >>>> >>>>> We tried again and got the same error. >>>>> >>>>> Could it be due to the old version (1.7) we are using? I see in the >>>>> release notes of Apr-2021 that the overload for past fixing was added: >>>>> >>>>> - Added an overloaded constructor for Asian options that takes all >>>>> past fixings and thus allows to reprice them correctly when the evaluation >>>>> date changes (thanks to Jack Gillett). >>>>> >>>>> Ashish >>>>> >>>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> wrote: >>>>> >>>>>> Hi Ashish, >>>>>> >>>>>> I have a better answer for you with a screenshot awaiting moderation >>>>>> as it's quite large, but in the meantime, I was able to run your code >>>>>> without problems using the python at the bottom of this email (although I >>>>>> didn't check the numbers). >>>>>> >>>>>> If there is something you're doing specifically to generate the >>>>>> error, could you please attach a minimal reproduction of it? >>>>>> >>>>>> Best, >>>>>> Jack >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> import QuantLib as ql >>>>>> from copy import deepcopy >>>>>> from datetime import datetime >>>>>> from datetime import timedelta >>>>>> >>>>>> >>>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>>> ql.Period("18M"), ql.Period("24M")] >>>>>> DEFAULT_tGRID = 100 >>>>>> DEFAULT_xGRID = 100 >>>>>> DEFAULT_aGRID = 50 >>>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>>> DEFAULT_PASTFIXINGS = 1 >>>>>> >>>>>> >>>>>> class AsianOptionPrice: >>>>>> def __init__(self, **x): >>>>>> for k, v in x.items(): >>>>>> setattr(self, k, v) >>>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS) >>>>>> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA) >>>>>> self.keyList = [k for k, v in x.items()] >>>>>> self.dist = 10**(-2) >>>>>> self.date_format = "%d-%m-%Y" >>>>>> self.value_date = ql.DateParser.parseFormatted( >>>>>> self.valueDate, '%d-%m-%Y') >>>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>>> self.expiryDate, '%d-%m-%Y') >>>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate, >>>>>> '%d-%m-%Y') >>>>>> # Volatility input is required for running the computing >>>>>> implied volatility function. This volatility is NOT used in the implied >>>>>> volatility calculation. >>>>>> self.vol_for_iv_calc = 0.10 >>>>>> self.IV = None >>>>>> >>>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>>> fixture_dates = [_date for _date in schedule if >>>>>> _date.weekday() not in [1,7]] >>>>>> return fixture_dates >>>>>> def asian(self): >>>>>> """ >>>>>> arithmeticRunningAccumulator(aRA) >>>>>> """ >>>>>> arithmeticRunningAccumulator = self.aRA >>>>>> pastFixings = self.pastFixings >>>>>> print(pastFixings) >>>>>> option_type = self.optionType.lower() >>>>>> if option_type not in ["call", "put"]: >>>>>> raise Exception( >>>>>> f"Option Type is Neither Call nor Put, Option type is >>>>>> {option_type}") >>>>>> option_type = ql.Option.Call if option_type == "call" else >>>>>> ql.Option.Put >>>>>> strike = self.strikePrice >>>>>> today = self.value_date >>>>>> print(today) >>>>>> fixingStartDate >>>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>>> print("#"*40,fixingStartDate) >>>>>> periods = self.periods >>>>>> asianFutureFixingDates = >>>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>>> print("#"*40,asianFutureFixingDates) >>>>>> asianExpiryDate = self.expiry_date >>>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>>> arithmeticAverage = ql.Average().Arithmetic >>>>>> discreteArithmeticAsianOption = >>>>>> ql.DiscreteAveragingAsianOption( >>>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>>> return discreteArithmeticAsianOption >>>>>> >>>>>> def create_arg_list(self, Option=None, compute_implied_vol=None, >>>>>> implied_vol_am_put=None): >>>>>> ''' >>>>>> The arguments with disturbances added. Will be used for >>>>>> calculation of Greeks >>>>>> using numerical differentiation. >>>>>> Creating a dictionary of arguments that will be used for >>>>>> option price and greeks calculation. >>>>>> ''' >>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>> originalDict_ = {k: getattr(self, k) for k in self.keyList} >>>>>> ListDict = [] >>>>>> for i in range(4): >>>>>> ListDict.append(deepcopy(originalDict_)) >>>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist >>>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>>> self.expiryDate, self.date_format) - >>>>>> timedelta(days=1)).strftime(self.date_format) >>>>>> print(ListDict) >>>>>> return(ListDict) >>>>>> >>>>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>>>> """ >>>>>> Creating the Black-Scholes process for option valuation. >>>>>> """ >>>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>>> ql.Actual365Fixed())) >>>>>> dividendTS = ql.YieldTermStructureHandle( >>>>>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed())) >>>>>> volatility = >>>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>>> self.value_date, ql.NullCalendar(), self.volatility, >>>>>> ql.Actual365Fixed())) >>>>>> initialValue = >>>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>>> process = ql.BlackScholesMertonProcess( >>>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>>> return(process) >>>>>> >>>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>>> """ >>>>>> Call the relevant option based on the input. >>>>>> """ >>>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>>> res = None >>>>>> option = AsianOptionPrice.asian(self) >>>>>> if compute_implied_vol == True: >>>>>> # create Black Scholes process using IV. >>>>>> process = AsianOptionPrice.bs_process( >>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>> aGrid=self.aGrid) >>>>>> option.setPricingEngine(engine) >>>>>> res = {'value': option.NPV(), 'impliedVolatility': >>>>>> self.IV} >>>>>> else: >>>>>> # Create Black Scholes process using HV. >>>>>> process = AsianOptionPrice.bs_process( >>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>> aGrid=self.aGrid) >>>>>> option.setPricingEngine(engine) >>>>>> res = {'value': option.NPV()} >>>>>> return res >>>>>> >>>>>> def evaluate_asian_npv(self): >>>>>> Option = AsianOptionPrice.asian(self) >>>>>> process = AsianOptionPrice.bs_process( >>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>> aGrid=self.aGrid) >>>>>> Option.setPricingEngine(engine) >>>>>> res = Option.NPV() >>>>>> return(res) >>>>>> >>>>>> def calculate_greeks(self, Option=None, compute_implied_vol=None): >>>>>> today = self.value_date >>>>>> Option = AsianOptionPrice.asian(self) >>>>>> if compute_implied_vol == True: >>>>>> process = AsianOptionPrice.bs_process( >>>>>> self, create_process_for_iv=False, use_IV=True) >>>>>> else: >>>>>> process = AsianOptionPrice.bs_process( >>>>>> self, create_process_for_iv=False, use_IV=False) >>>>>> engine = ql.FdBlackScholesAsianEngine( >>>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>>> aGrid=self.aGrid) >>>>>> Option.setPricingEngine(engine) >>>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>>> Option.gamma( >>>>>> )} >>>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>>> self, Option, compute_implied_vol=True, >>>>>> implied_vol_am_put=self.volatility) >>>>>> DisturbedPrices = [] >>>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>>> for i in range(4): >>>>>> DisturbedPrices.append(eval( >>>>>> >>>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>>> print(DisturbedPrices) >>>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>>> Rho = (PricesDistrbd['PRup'] - >>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>> vega = (PricesDistrbd['PVup'] - >>>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price']) >>>>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta': >>>>>> thetaDay}) >>>>>> return option_greeks_ >>>>>> >>>>>> >>>>>> settings = { >>>>>> "computeHistoricalVolatiltiy": False, >>>>>> "tenantId": "380", >>>>>> "gridPoints": 149, >>>>>> "computeImpliedVolatiltiy": False, >>>>>> "runId": 3735, >>>>>> "timeSteps": 150, >>>>>> "optionTrades": [ >>>>>> { >>>>>> "underlyingPrice": 98.69, >>>>>> "refNo": "OPT-1135-GVA", >>>>>> "underlyingPriceUnit": "US cents/LB", >>>>>> "valueDate": "17-03-2022", >>>>>> "fixingStartDate":"01-05-2022", >>>>>> "pastFixings":0, >>>>>> "volatility": 0.6015, >>>>>> "openQuantity": 1, >>>>>> "strikePriceUnit": "US cents/LB", >>>>>> "optionType": "Call", >>>>>> "expiryDate": "31-05-2022", >>>>>> "exType": "asian", >>>>>> "riskFreeRate": 0.8080374999999999, >>>>>> "premium": 1, >>>>>> "portfolioId": 18209, >>>>>> "marketPremium": 11.42, >>>>>> "longShort": "Long", >>>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>>> "asset": "EURO USD 1.105 Call", >>>>>> "portfolioName": "Option Trades", >>>>>> "scenarioId": 8356, >>>>>> "scenarioName": "Option Valuation - Greeks", >>>>>> "strikePrice": 95, >>>>>> "maturityInYears": 0.205479452 >>>>>> } >>>>>> ], >>>>>> "userId": "5263", >>>>>> "americanOptionsEngine": "CrankNicolson" >>>>>> } >>>>>> >>>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>>> opt.evaluate_asian_npv() >>>>>> >>>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal < >>>>>> ash...@gm...> wrote: >>>>>> >>>>>>> Hi Jack, >>>>>>> >>>>>>> Please find attached the Asian option python code and the option >>>>>>> trade payload. >>>>>>> >>>>>>> Thanks for your help, >>>>>>> Regards, >>>>>>> Ashish >>>>>>> >>>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>>> wrote: >>>>>>> >>>>>>>> Hi Ashish, >>>>>>>> >>>>>>>> I've just lifted the examples from your references directly for a >>>>>>>> discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>>>> me - can you share the code you are using that breaks please? >>>>>>>> >>>>>>>> Best, >>>>>>>> Jack >>>>>>>> >>>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Hi all, >>>>>>>>> >>>>>>>>> Could somebody help with the asian options? We are using >>>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>>> fixing" >>>>>>>>> ref: >>>>>>>>> >>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>>> >>>>>>>>> >>>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>>> >>>>>>>>> Queries: >>>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>>> 2. For trade which is mid of averaging and has few past fixings, >>>>>>>>> do we need to pass the count of past fixing or the actual rates of the >>>>>>>>> pastfixing as an array? >>>>>>>>> >>>>>>>>> Any help will be appreciated. >>>>>>>>> >>>>>>>>> Thanks in advance >>>>>>>>> Ashish >>>>>>>>> _______________________________________________ >>>>>>>>> QuantLib-users mailing list >>>>>>>>> Qua...@li... >>>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>>> >>>>>>>> _______________________________________________ >>>>> QuantLib-users mailing list >>>>> Qua...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>> >>>> |
|
From: Ashish B. <ash...@gm...> - 2022-05-19 10:37:53
|
Thanks, Luigi for the suggestion. After taking the running accumulator, we are able to generate the numbers. What exactly should be passed here? The average price of past fixings or just 1 when the trade is priced during averaging period? Thanks for help. Ashish On Wed, 18 May 2022 at 21:17, Luigi Ballabio <lui...@gm...> wrote: > I don't have a 1.7 version to try it, but the check is the one at < > https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, > suggesting that your running accumulator should be 0 (which makes sense, > because you're using arithmetic average, i.e., a sum, and if you don't have > any fixings yet the sum should be 0.) > Your default seems to be 1 instead. > > Luigi > > > On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <ash...@gm...> > wrote: > >> Luigi, >> >> Our code is not too much but we are using deprecated functions like >> FDEuropeanEngine and FDAmericanEngine. Not sure if using new function >> called FdBlackScholesVanillaEngine has any change in the calculation >> that our code will have an impact. >> >> Can we use the DiscreteAveragingAsianOption without the overloaded >> parameter of pastfixings under 1.7? >> >> Ashish >> >> On Wed, 18 May 2022 at 20:00, Luigi Ballabio <lui...@gm...> >> wrote: >> >>> Hi — it could be. Any particular reason you're still using a version >>> from 4 years ago? If you have a substantial amount of code that depends on >>> QuantLib, it might require some work to update because some methods were >>> deprecated and then removed in the meantime; and of course you'll probably >>> have some validation process in place when updating, so that's work too. >>> But on the other hand, you're missing 4 years worth of bug fixings... >>> >>> Luigi >>> >>> >>> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <ash...@gm...> >>> wrote: >>> >>>> We tried again and got the same error. >>>> >>>> Could it be due to the old version (1.7) we are using? I see in the >>>> release notes of Apr-2021 that the overload for past fixing was added: >>>> >>>> - Added an overloaded constructor for Asian options that takes all >>>> past fixings and thus allows to reprice them correctly when the evaluation >>>> date changes (thanks to Jack Gillett). >>>> >>>> Ashish >>>> >>>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> wrote: >>>> >>>>> Hi Ashish, >>>>> >>>>> I have a better answer for you with a screenshot awaiting moderation >>>>> as it's quite large, but in the meantime, I was able to run your code >>>>> without problems using the python at the bottom of this email (although I >>>>> didn't check the numbers). >>>>> >>>>> If there is something you're doing specifically to generate the error, >>>>> could you please attach a minimal reproduction of it? >>>>> >>>>> Best, >>>>> Jack >>>>> >>>>> >>>>> >>>>> >>>>> import QuantLib as ql >>>>> from copy import deepcopy >>>>> from datetime import datetime >>>>> from datetime import timedelta >>>>> >>>>> >>>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), >>>>> ql.Period("18M"), ql.Period("24M")] >>>>> DEFAULT_tGRID = 100 >>>>> DEFAULT_xGRID = 100 >>>>> DEFAULT_aGRID = 50 >>>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>>> DEFAULT_PASTFIXINGS = 1 >>>>> >>>>> >>>>> class AsianOptionPrice: >>>>> def __init__(self, **x): >>>>> for k, v in x.items(): >>>>> setattr(self, k, v) >>>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS) >>>>> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA) >>>>> self.keyList = [k for k, v in x.items()] >>>>> self.dist = 10**(-2) >>>>> self.date_format = "%d-%m-%Y" >>>>> self.value_date = ql.DateParser.parseFormatted( >>>>> self.valueDate, '%d-%m-%Y') >>>>> self.expiry_date = ql.DateParser.parseFormatted( >>>>> self.expiryDate, '%d-%m-%Y') >>>>> ql.Settings.instance().evaluationDate = self.value_date >>>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate, >>>>> '%d-%m-%Y') >>>>> # Volatility input is required for running the computing >>>>> implied volatility function. This volatility is NOT used in the implied >>>>> volatility calculation. >>>>> self.vol_for_iv_calc = 0.10 >>>>> self.IV = None >>>>> >>>>> def generate_fixture_dates(self,start_date,end_date,period): >>>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>>> fixture_dates = [_date for _date in schedule if >>>>> _date.weekday() not in [1,7]] >>>>> return fixture_dates >>>>> def asian(self): >>>>> """ >>>>> arithmeticRunningAccumulator(aRA) >>>>> """ >>>>> arithmeticRunningAccumulator = self.aRA >>>>> pastFixings = self.pastFixings >>>>> print(pastFixings) >>>>> option_type = self.optionType.lower() >>>>> if option_type not in ["call", "put"]: >>>>> raise Exception( >>>>> f"Option Type is Neither Call nor Put, Option type is >>>>> {option_type}") >>>>> option_type = ql.Option.Call if option_type == "call" else >>>>> ql.Option.Put >>>>> strike = self.strikePrice >>>>> today = self.value_date >>>>> print(today) >>>>> fixingStartDate >>>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>>> print("#"*40,fixingStartDate) >>>>> periods = self.periods >>>>> asianFutureFixingDates = >>>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>>> print("#"*40,asianFutureFixingDates) >>>>> asianExpiryDate = self.expiry_date >>>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>>> arithmeticAverage = ql.Average().Arithmetic >>>>> discreteArithmeticAsianOption = >>>>> ql.DiscreteAveragingAsianOption( >>>>> arithmeticAverage, arithmeticRunningAccumulator, >>>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>>> return discreteArithmeticAsianOption >>>>> >>>>> def create_arg_list(self, Option=None, compute_implied_vol=None, >>>>> implied_vol_am_put=None): >>>>> ''' >>>>> The arguments with disturbances added. Will be used for >>>>> calculation of Greeks >>>>> using numerical differentiation. >>>>> Creating a dictionary of arguments that will be used for >>>>> option price and greeks calculation. >>>>> ''' >>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>> originalDict_ = {k: getattr(self, k) for k in self.keyList} >>>>> ListDict = [] >>>>> for i in range(4): >>>>> ListDict.append(deepcopy(originalDict_)) >>>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist >>>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>>> self.expiryDate, self.date_format) - >>>>> timedelta(days=1)).strftime(self.date_format) >>>>> print(ListDict) >>>>> return(ListDict) >>>>> >>>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>>> """ >>>>> Creating the Black-Scholes process for option valuation. >>>>> """ >>>>> riskFreeTS = ql.YieldTermStructureHandle( >>>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>>> ql.Actual365Fixed())) >>>>> dividendTS = ql.YieldTermStructureHandle( >>>>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed())) >>>>> volatility = >>>>> ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>>> self.value_date, ql.NullCalendar(), self.volatility, >>>>> ql.Actual365Fixed())) >>>>> initialValue = >>>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>>> process = ql.BlackScholesMertonProcess( >>>>> initialValue, dividendTS, riskFreeTS, volatility) >>>>> return(process) >>>>> >>>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>>> """ >>>>> Call the relevant option based on the input. >>>>> """ >>>>> self.riskFreeRate = self.riskFreeRate/100 >>>>> res = None >>>>> option = AsianOptionPrice.asian(self) >>>>> if compute_implied_vol == True: >>>>> # create Black Scholes process using IV. >>>>> process = AsianOptionPrice.bs_process( >>>>> self, create_process_for_iv=False, use_IV=True) >>>>> engine = ql.FdBlackScholesAsianEngine( >>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>> aGrid=self.aGrid) >>>>> option.setPricingEngine(engine) >>>>> res = {'value': option.NPV(), 'impliedVolatility': self.IV} >>>>> else: >>>>> # Create Black Scholes process using HV. >>>>> process = AsianOptionPrice.bs_process( >>>>> self, create_process_for_iv=False, use_IV=False) >>>>> engine = ql.FdBlackScholesAsianEngine( >>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>> aGrid=self.aGrid) >>>>> option.setPricingEngine(engine) >>>>> res = {'value': option.NPV()} >>>>> return res >>>>> >>>>> def evaluate_asian_npv(self): >>>>> Option = AsianOptionPrice.asian(self) >>>>> process = AsianOptionPrice.bs_process( >>>>> self, create_process_for_iv=False, use_IV=False) >>>>> engine = ql.FdBlackScholesAsianEngine( >>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>> aGrid=self.aGrid) >>>>> Option.setPricingEngine(engine) >>>>> res = Option.NPV() >>>>> return(res) >>>>> >>>>> def calculate_greeks(self, Option=None, compute_implied_vol=None): >>>>> today = self.value_date >>>>> Option = AsianOptionPrice.asian(self) >>>>> if compute_implied_vol == True: >>>>> process = AsianOptionPrice.bs_process( >>>>> self, create_process_for_iv=False, use_IV=True) >>>>> else: >>>>> process = AsianOptionPrice.bs_process( >>>>> self, create_process_for_iv=False, use_IV=False) >>>>> engine = ql.FdBlackScholesAsianEngine( >>>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>>> aGrid=self.aGrid) >>>>> Option.setPricingEngine(engine) >>>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>>> Option.gamma( >>>>> )} >>>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>>> self, Option, compute_implied_vol=True, >>>>> implied_vol_am_put=self.volatility) >>>>> DisturbedPrices = [] >>>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>>> for i in range(4): >>>>> DisturbedPrices.append(eval( >>>>> >>>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>>> print(DisturbedPrices) >>>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>>> Rho = (PricesDistrbd['PRup'] - >>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>> vega = (PricesDistrbd['PVup'] - >>>>> PricesDistrbd['Price'])/(self.dist*100) >>>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price']) >>>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta': >>>>> thetaDay}) >>>>> return option_greeks_ >>>>> >>>>> >>>>> settings = { >>>>> "computeHistoricalVolatiltiy": False, >>>>> "tenantId": "380", >>>>> "gridPoints": 149, >>>>> "computeImpliedVolatiltiy": False, >>>>> "runId": 3735, >>>>> "timeSteps": 150, >>>>> "optionTrades": [ >>>>> { >>>>> "underlyingPrice": 98.69, >>>>> "refNo": "OPT-1135-GVA", >>>>> "underlyingPriceUnit": "US cents/LB", >>>>> "valueDate": "17-03-2022", >>>>> "fixingStartDate":"01-05-2022", >>>>> "pastFixings":0, >>>>> "volatility": 0.6015, >>>>> "openQuantity": 1, >>>>> "strikePriceUnit": "US cents/LB", >>>>> "optionType": "Call", >>>>> "expiryDate": "31-05-2022", >>>>> "exType": "asian", >>>>> "riskFreeRate": 0.8080374999999999, >>>>> "premium": 1, >>>>> "portfolioId": 18209, >>>>> "marketPremium": 11.42, >>>>> "longShort": "Long", >>>>> "optionInstrument": "EURO USD 1.105 Call", >>>>> "asset": "EURO USD 1.105 Call", >>>>> "portfolioName": "Option Trades", >>>>> "scenarioId": 8356, >>>>> "scenarioName": "Option Valuation - Greeks", >>>>> "strikePrice": 95, >>>>> "maturityInYears": 0.205479452 >>>>> } >>>>> ], >>>>> "userId": "5263", >>>>> "americanOptionsEngine": "CrankNicolson" >>>>> } >>>>> >>>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>>> opt.evaluate_asian_npv() >>>>> >>>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...> >>>>> wrote: >>>>> >>>>>> Hi Jack, >>>>>> >>>>>> Please find attached the Asian option python code and the option >>>>>> trade payload. >>>>>> >>>>>> Thanks for your help, >>>>>> Regards, >>>>>> Ashish >>>>>> >>>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> >>>>>> wrote: >>>>>> >>>>>>> Hi Ashish, >>>>>>> >>>>>>> I've just lifted the examples from your references directly for a >>>>>>> discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>>> me - can you share the code you are using that breaks please? >>>>>>> >>>>>>> Best, >>>>>>> Jack >>>>>>> >>>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> >>>>>>> wrote: >>>>>>> >>>>>>>> Hi all, >>>>>>>> >>>>>>>> Could somebody help with the asian options? We are using >>>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>>> we are passing it as 0, we are getting the following error: >>>>>>>> "QuantLib Error - Running average requires at least one past >>>>>>>> fixing" >>>>>>>> ref: >>>>>>>> >>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>>> >>>>>>>> >>>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>>> >>>>>>>> Queries: >>>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>>> 2. For trade which is mid of averaging and has few past fixings, do >>>>>>>> we need to pass the count of past fixing or the actual rates of the >>>>>>>> pastfixing as an array? >>>>>>>> >>>>>>>> Any help will be appreciated. >>>>>>>> >>>>>>>> Thanks in advance >>>>>>>> Ashish >>>>>>>> _______________________________________________ >>>>>>>> QuantLib-users mailing list >>>>>>>> Qua...@li... >>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>>> >>>>>>> _______________________________________________ >>>> QuantLib-users mailing list >>>> Qua...@li... >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>> >>> |
|
From: Luigi B. <lui...@gm...> - 2022-05-18 15:47:13
|
I don't have a 1.7 version to try it, but the check is the one at < https://github.com/lballabio/QuantLib/blob/QuantLib-v1.7/ql/pricingengines/asian/fdblackscholesasianengine.cpp#L51-L53>, suggesting that your running accumulator should be 0 (which makes sense, because you're using arithmetic average, i.e., a sum, and if you don't have any fixings yet the sum should be 0.) Your default seems to be 1 instead. Luigi On Wed, May 18, 2022 at 5:17 PM Ashish Bansal <ash...@gm...> wrote: > Luigi, > > Our code is not too much but we are using deprecated functions like > FDEuropeanEngine and FDAmericanEngine. Not sure if using new function > called FdBlackScholesVanillaEngine has any change in the calculation that > our code will have an impact. > > Can we use the DiscreteAveragingAsianOption without the overloaded > parameter of pastfixings under 1.7? > > Ashish > > On Wed, 18 May 2022 at 20:00, Luigi Ballabio <lui...@gm...> > wrote: > >> Hi — it could be. Any particular reason you're still using a version >> from 4 years ago? If you have a substantial amount of code that depends on >> QuantLib, it might require some work to update because some methods were >> deprecated and then removed in the meantime; and of course you'll probably >> have some validation process in place when updating, so that's work too. >> But on the other hand, you're missing 4 years worth of bug fixings... >> >> Luigi >> >> >> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <ash...@gm...> >> wrote: >> >>> We tried again and got the same error. >>> >>> Could it be due to the old version (1.7) we are using? I see in the >>> release notes of Apr-2021 that the overload for past fixing was added: >>> >>> - Added an overloaded constructor for Asian options that takes all >>> past fixings and thus allows to reprice them correctly when the evaluation >>> date changes (thanks to Jack Gillett). >>> >>> Ashish >>> >>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> wrote: >>> >>>> Hi Ashish, >>>> >>>> I have a better answer for you with a screenshot awaiting moderation as >>>> it's quite large, but in the meantime, I was able to run your code without >>>> problems using the python at the bottom of this email (although I didn't >>>> check the numbers). >>>> >>>> If there is something you're doing specifically to generate the error, >>>> could you please attach a minimal reproduction of it? >>>> >>>> Best, >>>> Jack >>>> >>>> >>>> >>>> >>>> import QuantLib as ql >>>> from copy import deepcopy >>>> from datetime import datetime >>>> from datetime import timedelta >>>> >>>> >>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)] >>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), ql.Period("18M"), >>>> ql.Period("24M")] >>>> DEFAULT_tGRID = 100 >>>> DEFAULT_xGRID = 100 >>>> DEFAULT_aGRID = 50 >>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator >>>> DEFAULT_PASTFIXINGS = 1 >>>> >>>> >>>> class AsianOptionPrice: >>>> def __init__(self, **x): >>>> for k, v in x.items(): >>>> setattr(self, k, v) >>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID) >>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID) >>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID) >>>> self.periods = x.get("periods", DEFAULT_PERIODS) >>>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS) >>>> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA) >>>> self.keyList = [k for k, v in x.items()] >>>> self.dist = 10**(-2) >>>> self.date_format = "%d-%m-%Y" >>>> self.value_date = ql.DateParser.parseFormatted( >>>> self.valueDate, '%d-%m-%Y') >>>> self.expiry_date = ql.DateParser.parseFormatted( >>>> self.expiryDate, '%d-%m-%Y') >>>> ql.Settings.instance().evaluationDate = self.value_date >>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate, >>>> '%d-%m-%Y') >>>> # Volatility input is required for running the computing >>>> implied volatility function. This volatility is NOT used in the implied >>>> volatility calculation. >>>> self.vol_for_iv_calc = 0.10 >>>> self.IV = None >>>> >>>> def generate_fixture_dates(self,start_date,end_date,period): >>>> schedule = ql.MakeSchedule(start_date, end_date, period) >>>> fixture_dates = [_date for _date in schedule if _date.weekday() >>>> not in [1,7]] >>>> return fixture_dates >>>> def asian(self): >>>> """ >>>> arithmeticRunningAccumulator(aRA) >>>> """ >>>> arithmeticRunningAccumulator = self.aRA >>>> pastFixings = self.pastFixings >>>> print(pastFixings) >>>> option_type = self.optionType.lower() >>>> if option_type not in ["call", "put"]: >>>> raise Exception( >>>> f"Option Type is Neither Call nor Put, Option type is >>>> {option_type}") >>>> option_type = ql.Option.Call if option_type == "call" else >>>> ql.Option.Put >>>> strike = self.strikePrice >>>> today = self.value_date >>>> print(today) >>>> fixingStartDate >>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y') >>>> print("#"*40,fixingStartDate) >>>> periods = self.periods >>>> asianFutureFixingDates = >>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d")) >>>> print("#"*40,asianFutureFixingDates) >>>> asianExpiryDate = self.expiry_date >>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike) >>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate) >>>> arithmeticAverage = ql.Average().Arithmetic >>>> discreteArithmeticAsianOption = ql.DiscreteAveragingAsianOption( >>>> arithmeticAverage, arithmeticRunningAccumulator, >>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise) >>>> return discreteArithmeticAsianOption >>>> >>>> def create_arg_list(self, Option=None, compute_implied_vol=None, >>>> implied_vol_am_put=None): >>>> ''' >>>> The arguments with disturbances added. Will be used for >>>> calculation of Greeks >>>> using numerical differentiation. >>>> Creating a dictionary of arguments that will be used for >>>> option price and greeks calculation. >>>> ''' >>>> self.riskFreeRate = self.riskFreeRate/100 >>>> originalDict_ = {k: getattr(self, k) for k in self.keyList} >>>> ListDict = [] >>>> for i in range(4): >>>> ListDict.append(deepcopy(originalDict_)) >>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist >>>> ListDict[2]['volatility'] = self.volatility + self.dist >>>> ListDict[3]['expiryDate'] = (datetime.strptime( >>>> self.expiryDate, self.date_format) - >>>> timedelta(days=1)).strftime(self.date_format) >>>> print(ListDict) >>>> return(ListDict) >>>> >>>> def bs_process(self, create_process_for_iv=None, use_IV=None): >>>> """ >>>> Creating the Black-Scholes process for option valuation. >>>> """ >>>> riskFreeTS = ql.YieldTermStructureHandle( >>>> ql.FlatForward(self.value_date, self.riskFreeRate, >>>> ql.Actual365Fixed())) >>>> dividendTS = ql.YieldTermStructureHandle( >>>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed())) >>>> volatility = ql.BlackVolTermStructureHandle(ql.BlackConstantVol( >>>> self.value_date, ql.NullCalendar(), self.volatility, >>>> ql.Actual365Fixed())) >>>> initialValue = >>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice)) >>>> process = ql.BlackScholesMertonProcess( >>>> initialValue, dividendTS, riskFreeTS, volatility) >>>> return(process) >>>> >>>> def evaluate(self, Option=None, compute_implied_vol=None): >>>> """ >>>> Call the relevant option based on the input. >>>> """ >>>> self.riskFreeRate = self.riskFreeRate/100 >>>> res = None >>>> option = AsianOptionPrice.asian(self) >>>> if compute_implied_vol == True: >>>> # create Black Scholes process using IV. >>>> process = AsianOptionPrice.bs_process( >>>> self, create_process_for_iv=False, use_IV=True) >>>> engine = ql.FdBlackScholesAsianEngine( >>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>> aGrid=self.aGrid) >>>> option.setPricingEngine(engine) >>>> res = {'value': option.NPV(), 'impliedVolatility': self.IV} >>>> else: >>>> # Create Black Scholes process using HV. >>>> process = AsianOptionPrice.bs_process( >>>> self, create_process_for_iv=False, use_IV=False) >>>> engine = ql.FdBlackScholesAsianEngine( >>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>> aGrid=self.aGrid) >>>> option.setPricingEngine(engine) >>>> res = {'value': option.NPV()} >>>> return res >>>> >>>> def evaluate_asian_npv(self): >>>> Option = AsianOptionPrice.asian(self) >>>> process = AsianOptionPrice.bs_process( >>>> self, create_process_for_iv=False, use_IV=False) >>>> engine = ql.FdBlackScholesAsianEngine( >>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>> aGrid=self.aGrid) >>>> Option.setPricingEngine(engine) >>>> res = Option.NPV() >>>> return(res) >>>> >>>> def calculate_greeks(self, Option=None, compute_implied_vol=None): >>>> today = self.value_date >>>> Option = AsianOptionPrice.asian(self) >>>> if compute_implied_vol == True: >>>> process = AsianOptionPrice.bs_process( >>>> self, create_process_for_iv=False, use_IV=True) >>>> else: >>>> process = AsianOptionPrice.bs_process( >>>> self, create_process_for_iv=False, use_IV=False) >>>> engine = ql.FdBlackScholesAsianEngine( >>>> process, tGrid=self.tGrid, xGrid=self.xGrid, >>>> aGrid=self.aGrid) >>>> Option.setPricingEngine(engine) >>>> option_greeks_ = {"delta": Option.delta(), "gamma": >>>> Option.gamma( >>>> )} >>>> ArgmntList = AsianOptionPrice.create_arg_list( >>>> self, Option, compute_implied_vol=True, >>>> implied_vol_am_put=self.volatility) >>>> DisturbedPrices = [] >>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup'] >>>> for i in range(4): >>>> DisturbedPrices.append(eval( >>>> >>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()")) >>>> print(DisturbedPrices) >>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices)) >>>> Rho = (PricesDistrbd['PRup'] - >>>> PricesDistrbd['Price'])/(self.dist*100) >>>> vega = (PricesDistrbd['PVup'] - >>>> PricesDistrbd['Price'])/(self.dist*100) >>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price']) >>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta': >>>> thetaDay}) >>>> return option_greeks_ >>>> >>>> >>>> settings = { >>>> "computeHistoricalVolatiltiy": False, >>>> "tenantId": "380", >>>> "gridPoints": 149, >>>> "computeImpliedVolatiltiy": False, >>>> "runId": 3735, >>>> "timeSteps": 150, >>>> "optionTrades": [ >>>> { >>>> "underlyingPrice": 98.69, >>>> "refNo": "OPT-1135-GVA", >>>> "underlyingPriceUnit": "US cents/LB", >>>> "valueDate": "17-03-2022", >>>> "fixingStartDate":"01-05-2022", >>>> "pastFixings":0, >>>> "volatility": 0.6015, >>>> "openQuantity": 1, >>>> "strikePriceUnit": "US cents/LB", >>>> "optionType": "Call", >>>> "expiryDate": "31-05-2022", >>>> "exType": "asian", >>>> "riskFreeRate": 0.8080374999999999, >>>> "premium": 1, >>>> "portfolioId": 18209, >>>> "marketPremium": 11.42, >>>> "longShort": "Long", >>>> "optionInstrument": "EURO USD 1.105 Call", >>>> "asset": "EURO USD 1.105 Call", >>>> "portfolioName": "Option Trades", >>>> "scenarioId": 8356, >>>> "scenarioName": "Option Valuation - Greeks", >>>> "strikePrice": 95, >>>> "maturityInYears": 0.205479452 >>>> } >>>> ], >>>> "userId": "5263", >>>> "americanOptionsEngine": "CrankNicolson" >>>> } >>>> >>>> opt = AsianOptionPrice(**settings["optionTrades"][0]) >>>> opt.evaluate_asian_npv() >>>> >>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...> >>>> wrote: >>>> >>>>> Hi Jack, >>>>> >>>>> Please find attached the Asian option python code and the option trade >>>>> payload. >>>>> >>>>> Thanks for your help, >>>>> Regards, >>>>> Ashish >>>>> >>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote: >>>>> >>>>>> Hi Ashish, >>>>>> >>>>>> I've just lifted the examples from your references directly for a >>>>>> discrete arithmetic Asian using the FD Asian engine and it is working for >>>>>> me - can you share the code you are using that breaks please? >>>>>> >>>>>> Best, >>>>>> Jack >>>>>> >>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> >>>>>> wrote: >>>>>> >>>>>>> Hi all, >>>>>>> >>>>>>> Could somebody help with the asian options? We are using >>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to >>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>>>>>> we are passing it as 0, we are getting the following error: >>>>>>> "QuantLib Error - Running average requires at least one past fixing" >>>>>>> ref: >>>>>>> >>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>>>>>> >>>>>>> >>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>>>>>> >>>>>>> Queries: >>>>>>> 1. What is to be passed here for new trade if not 0? >>>>>>> 2. For trade which is mid of averaging and has few past fixings, do >>>>>>> we need to pass the count of past fixing or the actual rates of the >>>>>>> pastfixing as an array? >>>>>>> >>>>>>> Any help will be appreciated. >>>>>>> >>>>>>> Thanks in advance >>>>>>> Ashish >>>>>>> _______________________________________________ >>>>>>> QuantLib-users mailing list >>>>>>> Qua...@li... >>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>>>>>> >>>>>> _______________________________________________ >>> QuantLib-users mailing list >>> Qua...@li... >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>> >> |
|
From: Ashish B. <ash...@gm...> - 2022-05-18 15:17:58
|
Luigi,
Our code is not too much but we are using deprecated functions like
FDEuropeanEngine and FDAmericanEngine. Not sure if using new function
called FdBlackScholesVanillaEngine has any change in the calculation that
our code will have an impact.
Can we use the DiscreteAveragingAsianOption without the overloaded
parameter of pastfixings under 1.7?
Ashish
On Wed, 18 May 2022 at 20:00, Luigi Ballabio <lui...@gm...>
wrote:
> Hi — it could be. Any particular reason you're still using a version
> from 4 years ago? If you have a substantial amount of code that depends on
> QuantLib, it might require some work to update because some methods were
> deprecated and then removed in the meantime; and of course you'll probably
> have some validation process in place when updating, so that's work too.
> But on the other hand, you're missing 4 years worth of bug fixings...
>
> Luigi
>
>
> On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <ash...@gm...>
> wrote:
>
>> We tried again and got the same error.
>>
>> Could it be due to the old version (1.7) we are using? I see in the
>> release notes of Apr-2021 that the overload for past fixing was added:
>>
>> - Added an overloaded constructor for Asian options that takes all
>> past fixings and thus allows to reprice them correctly when the evaluation
>> date changes (thanks to Jack Gillett).
>>
>> Ashish
>>
>> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> wrote:
>>
>>> Hi Ashish,
>>>
>>> I have a better answer for you with a screenshot awaiting moderation as
>>> it's quite large, but in the meantime, I was able to run your code without
>>> problems using the python at the bottom of this email (although I didn't
>>> check the numbers).
>>>
>>> If there is something you're doing specifically to generate the error,
>>> could you please attach a minimal reproduction of it?
>>>
>>> Best,
>>> Jack
>>>
>>>
>>>
>>>
>>> import QuantLib as ql
>>> from copy import deepcopy
>>> from datetime import datetime
>>> from datetime import timedelta
>>>
>>>
>>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)]
>>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), ql.Period("18M"),
>>> ql.Period("24M")]
>>> DEFAULT_tGRID = 100
>>> DEFAULT_xGRID = 100
>>> DEFAULT_aGRID = 50
>>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator
>>> DEFAULT_PASTFIXINGS = 1
>>>
>>>
>>> class AsianOptionPrice:
>>> def __init__(self, **x):
>>> for k, v in x.items():
>>> setattr(self, k, v)
>>> self.tGrid = x.get("tGrid", DEFAULT_tGRID)
>>> self.xGrid = x.get("xGrid", DEFAULT_xGRID)
>>> self.aGrid = x.get("aGrid", DEFAULT_aGRID)
>>> self.periods = x.get("periods", DEFAULT_PERIODS)
>>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS)
>>> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA)
>>> self.keyList = [k for k, v in x.items()]
>>> self.dist = 10**(-2)
>>> self.date_format = "%d-%m-%Y"
>>> self.value_date = ql.DateParser.parseFormatted(
>>> self.valueDate, '%d-%m-%Y')
>>> self.expiry_date = ql.DateParser.parseFormatted(
>>> self.expiryDate, '%d-%m-%Y')
>>> ql.Settings.instance().evaluationDate = self.value_date
>>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate,
>>> '%d-%m-%Y')
>>> # Volatility input is required for running the computing implied
>>> volatility function. This volatility is NOT used in the implied volatility
>>> calculation.
>>> self.vol_for_iv_calc = 0.10
>>> self.IV = None
>>>
>>> def generate_fixture_dates(self,start_date,end_date,period):
>>> schedule = ql.MakeSchedule(start_date, end_date, period)
>>> fixture_dates = [_date for _date in schedule if _date.weekday()
>>> not in [1,7]]
>>> return fixture_dates
>>> def asian(self):
>>> """
>>> arithmeticRunningAccumulator(aRA)
>>> """
>>> arithmeticRunningAccumulator = self.aRA
>>> pastFixings = self.pastFixings
>>> print(pastFixings)
>>> option_type = self.optionType.lower()
>>> if option_type not in ["call", "put"]:
>>> raise Exception(
>>> f"Option Type is Neither Call nor Put, Option type is
>>> {option_type}")
>>> option_type = ql.Option.Call if option_type == "call" else
>>> ql.Option.Put
>>> strike = self.strikePrice
>>> today = self.value_date
>>> print(today)
>>> fixingStartDate
>>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y')
>>> print("#"*40,fixingStartDate)
>>> periods = self.periods
>>> asianFutureFixingDates =
>>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d"))
>>> print("#"*40,asianFutureFixingDates)
>>> asianExpiryDate = self.expiry_date
>>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike)
>>> europeanExercise = ql.EuropeanExercise(asianExpiryDate)
>>> arithmeticAverage = ql.Average().Arithmetic
>>> discreteArithmeticAsianOption = ql.DiscreteAveragingAsianOption(
>>> arithmeticAverage, arithmeticRunningAccumulator,
>>> pastFixings, asianFutureFixingDates, vanillaPayoff, europeanExercise)
>>> return discreteArithmeticAsianOption
>>>
>>> def create_arg_list(self, Option=None, compute_implied_vol=None,
>>> implied_vol_am_put=None):
>>> '''
>>> The arguments with disturbances added. Will be used for
>>> calculation of Greeks
>>> using numerical differentiation.
>>> Creating a dictionary of arguments that will be used for
>>> option price and greeks calculation.
>>> '''
>>> self.riskFreeRate = self.riskFreeRate/100
>>> originalDict_ = {k: getattr(self, k) for k in self.keyList}
>>> ListDict = []
>>> for i in range(4):
>>> ListDict.append(deepcopy(originalDict_))
>>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist
>>> ListDict[2]['volatility'] = self.volatility + self.dist
>>> ListDict[3]['expiryDate'] = (datetime.strptime(
>>> self.expiryDate, self.date_format) -
>>> timedelta(days=1)).strftime(self.date_format)
>>> print(ListDict)
>>> return(ListDict)
>>>
>>> def bs_process(self, create_process_for_iv=None, use_IV=None):
>>> """
>>> Creating the Black-Scholes process for option valuation.
>>> """
>>> riskFreeTS = ql.YieldTermStructureHandle(
>>> ql.FlatForward(self.value_date, self.riskFreeRate,
>>> ql.Actual365Fixed()))
>>> dividendTS = ql.YieldTermStructureHandle(
>>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed()))
>>> volatility = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(
>>> self.value_date, ql.NullCalendar(), self.volatility,
>>> ql.Actual365Fixed()))
>>> initialValue =
>>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice))
>>> process = ql.BlackScholesMertonProcess(
>>> initialValue, dividendTS, riskFreeTS, volatility)
>>> return(process)
>>>
>>> def evaluate(self, Option=None, compute_implied_vol=None):
>>> """
>>> Call the relevant option based on the input.
>>> """
>>> self.riskFreeRate = self.riskFreeRate/100
>>> res = None
>>> option = AsianOptionPrice.asian(self)
>>> if compute_implied_vol == True:
>>> # create Black Scholes process using IV.
>>> process = AsianOptionPrice.bs_process(
>>> self, create_process_for_iv=False, use_IV=True)
>>> engine = ql.FdBlackScholesAsianEngine(
>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>> aGrid=self.aGrid)
>>> option.setPricingEngine(engine)
>>> res = {'value': option.NPV(), 'impliedVolatility': self.IV}
>>> else:
>>> # Create Black Scholes process using HV.
>>> process = AsianOptionPrice.bs_process(
>>> self, create_process_for_iv=False, use_IV=False)
>>> engine = ql.FdBlackScholesAsianEngine(
>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>> aGrid=self.aGrid)
>>> option.setPricingEngine(engine)
>>> res = {'value': option.NPV()}
>>> return res
>>>
>>> def evaluate_asian_npv(self):
>>> Option = AsianOptionPrice.asian(self)
>>> process = AsianOptionPrice.bs_process(
>>> self, create_process_for_iv=False, use_IV=False)
>>> engine = ql.FdBlackScholesAsianEngine(
>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>> aGrid=self.aGrid)
>>> Option.setPricingEngine(engine)
>>> res = Option.NPV()
>>> return(res)
>>>
>>> def calculate_greeks(self, Option=None, compute_implied_vol=None):
>>> today = self.value_date
>>> Option = AsianOptionPrice.asian(self)
>>> if compute_implied_vol == True:
>>> process = AsianOptionPrice.bs_process(
>>> self, create_process_for_iv=False, use_IV=True)
>>> else:
>>> process = AsianOptionPrice.bs_process(
>>> self, create_process_for_iv=False, use_IV=False)
>>> engine = ql.FdBlackScholesAsianEngine(
>>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>>> aGrid=self.aGrid)
>>> Option.setPricingEngine(engine)
>>> option_greeks_ = {"delta": Option.delta(), "gamma": Option.gamma(
>>> )}
>>> ArgmntList = AsianOptionPrice.create_arg_list(
>>> self, Option, compute_implied_vol=True,
>>> implied_vol_am_put=self.volatility)
>>> DisturbedPrices = []
>>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup']
>>> for i in range(4):
>>> DisturbedPrices.append(eval(
>>>
>>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()"))
>>> print(DisturbedPrices)
>>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices))
>>> Rho = (PricesDistrbd['PRup'] -
>>> PricesDistrbd['Price'])/(self.dist*100)
>>> vega = (PricesDistrbd['PVup'] -
>>> PricesDistrbd['Price'])/(self.dist*100)
>>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price'])
>>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta':
>>> thetaDay})
>>> return option_greeks_
>>>
>>>
>>> settings = {
>>> "computeHistoricalVolatiltiy": False,
>>> "tenantId": "380",
>>> "gridPoints": 149,
>>> "computeImpliedVolatiltiy": False,
>>> "runId": 3735,
>>> "timeSteps": 150,
>>> "optionTrades": [
>>> {
>>> "underlyingPrice": 98.69,
>>> "refNo": "OPT-1135-GVA",
>>> "underlyingPriceUnit": "US cents/LB",
>>> "valueDate": "17-03-2022",
>>> "fixingStartDate":"01-05-2022",
>>> "pastFixings":0,
>>> "volatility": 0.6015,
>>> "openQuantity": 1,
>>> "strikePriceUnit": "US cents/LB",
>>> "optionType": "Call",
>>> "expiryDate": "31-05-2022",
>>> "exType": "asian",
>>> "riskFreeRate": 0.8080374999999999,
>>> "premium": 1,
>>> "portfolioId": 18209,
>>> "marketPremium": 11.42,
>>> "longShort": "Long",
>>> "optionInstrument": "EURO USD 1.105 Call",
>>> "asset": "EURO USD 1.105 Call",
>>> "portfolioName": "Option Trades",
>>> "scenarioId": 8356,
>>> "scenarioName": "Option Valuation - Greeks",
>>> "strikePrice": 95,
>>> "maturityInYears": 0.205479452
>>> }
>>> ],
>>> "userId": "5263",
>>> "americanOptionsEngine": "CrankNicolson"
>>> }
>>>
>>> opt = AsianOptionPrice(**settings["optionTrades"][0])
>>> opt.evaluate_asian_npv()
>>>
>>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...>
>>> wrote:
>>>
>>>> Hi Jack,
>>>>
>>>> Please find attached the Asian option python code and the option trade
>>>> payload.
>>>>
>>>> Thanks for your help,
>>>> Regards,
>>>> Ashish
>>>>
>>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote:
>>>>
>>>>> Hi Ashish,
>>>>>
>>>>> I've just lifted the examples from your references directly for a
>>>>> discrete arithmetic Asian using the FD Asian engine and it is working for
>>>>> me - can you share the code you are using that breaks please?
>>>>>
>>>>> Best,
>>>>> Jack
>>>>>
>>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...>
>>>>> wrote:
>>>>>
>>>>>> Hi all,
>>>>>>
>>>>>> Could somebody help with the asian options? We are using
>>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online
>>>>>> references are given below. In DiscreteAveragingAsianOption, we need to
>>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when
>>>>>> we are passing it as 0, we are getting the following error:
>>>>>> "QuantLib Error - Running average requires at least one past fixing"
>>>>>> ref:
>>>>>>
>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine
>>>>>>
>>>>>>
>>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption
>>>>>>
>>>>>> Queries:
>>>>>> 1. What is to be passed here for new trade if not 0?
>>>>>> 2. For trade which is mid of averaging and has few past fixings, do
>>>>>> we need to pass the count of past fixing or the actual rates of the
>>>>>> pastfixing as an array?
>>>>>>
>>>>>> Any help will be appreciated.
>>>>>>
>>>>>> Thanks in advance
>>>>>> Ashish
>>>>>> _______________________________________________
>>>>>> QuantLib-users mailing list
>>>>>> Qua...@li...
>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>>>
>>>>> _______________________________________________
>> QuantLib-users mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>
>
|
|
From: Luigi B. <lui...@gm...> - 2022-05-18 14:30:57
|
Hi — it could be. Any particular reason you're still using a version from
4 years ago? If you have a substantial amount of code that depends on
QuantLib, it might require some work to update because some methods were
deprecated and then removed in the meantime; and of course you'll probably
have some validation process in place when updating, so that's work too.
But on the other hand, you're missing 4 years worth of bug fixings...
Luigi
On Wed, May 18, 2022 at 4:19 PM Ashish Bansal <ash...@gm...>
wrote:
> We tried again and got the same error.
>
> Could it be due to the old version (1.7) we are using? I see in the
> release notes of Apr-2021 that the overload for past fixing was added:
>
> - Added an overloaded constructor for Asian options that takes all
> past fixings and thus allows to reprice them correctly when the evaluation
> date changes (thanks to Jack Gillett).
>
> Ashish
>
> On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> wrote:
>
>> Hi Ashish,
>>
>> I have a better answer for you with a screenshot awaiting moderation as
>> it's quite large, but in the meantime, I was able to run your code without
>> problems using the python at the bottom of this email (although I didn't
>> check the numbers).
>>
>> If there is something you're doing specifically to generate the error,
>> could you please attach a minimal reproduction of it?
>>
>> Best,
>> Jack
>>
>>
>>
>>
>> import QuantLib as ql
>> from copy import deepcopy
>> from datetime import datetime
>> from datetime import timedelta
>>
>>
>> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)]
>> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), ql.Period("18M"),
>> ql.Period("24M")]
>> DEFAULT_tGRID = 100
>> DEFAULT_xGRID = 100
>> DEFAULT_aGRID = 50
>> DEFAULT_aRA = 1 # arithmeticRunningAccumulator
>> DEFAULT_PASTFIXINGS = 1
>>
>>
>> class AsianOptionPrice:
>> def __init__(self, **x):
>> for k, v in x.items():
>> setattr(self, k, v)
>> self.tGrid = x.get("tGrid", DEFAULT_tGRID)
>> self.xGrid = x.get("xGrid", DEFAULT_xGRID)
>> self.aGrid = x.get("aGrid", DEFAULT_aGRID)
>> self.periods = x.get("periods", DEFAULT_PERIODS)
>> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS)
>> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA)
>> self.keyList = [k for k, v in x.items()]
>> self.dist = 10**(-2)
>> self.date_format = "%d-%m-%Y"
>> self.value_date = ql.DateParser.parseFormatted(
>> self.valueDate, '%d-%m-%Y')
>> self.expiry_date = ql.DateParser.parseFormatted(
>> self.expiryDate, '%d-%m-%Y')
>> ql.Settings.instance().evaluationDate = self.value_date
>> self.exDay = ql.DateParser.parseFormatted(self.expiryDate,
>> '%d-%m-%Y')
>> # Volatility input is required for running the computing implied
>> volatility function. This volatility is NOT used in the implied volatility
>> calculation.
>> self.vol_for_iv_calc = 0.10
>> self.IV = None
>>
>> def generate_fixture_dates(self,start_date,end_date,period):
>> schedule = ql.MakeSchedule(start_date, end_date, period)
>> fixture_dates = [_date for _date in schedule if _date.weekday()
>> not in [1,7]]
>> return fixture_dates
>> def asian(self):
>> """
>> arithmeticRunningAccumulator(aRA)
>> """
>> arithmeticRunningAccumulator = self.aRA
>> pastFixings = self.pastFixings
>> print(pastFixings)
>> option_type = self.optionType.lower()
>> if option_type not in ["call", "put"]:
>> raise Exception(
>> f"Option Type is Neither Call nor Put, Option type is
>> {option_type}")
>> option_type = ql.Option.Call if option_type == "call" else
>> ql.Option.Put
>> strike = self.strikePrice
>> today = self.value_date
>> print(today)
>> fixingStartDate
>> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y')
>> print("#"*40,fixingStartDate)
>> periods = self.periods
>> asianFutureFixingDates =
>> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d"))
>> print("#"*40,asianFutureFixingDates)
>> asianExpiryDate = self.expiry_date
>> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike)
>> europeanExercise = ql.EuropeanExercise(asianExpiryDate)
>> arithmeticAverage = ql.Average().Arithmetic
>> discreteArithmeticAsianOption = ql.DiscreteAveragingAsianOption(
>> arithmeticAverage, arithmeticRunningAccumulator, pastFixings,
>> asianFutureFixingDates, vanillaPayoff, europeanExercise)
>> return discreteArithmeticAsianOption
>>
>> def create_arg_list(self, Option=None, compute_implied_vol=None,
>> implied_vol_am_put=None):
>> '''
>> The arguments with disturbances added. Will be used for
>> calculation of Greeks
>> using numerical differentiation.
>> Creating a dictionary of arguments that will be used for
>> option price and greeks calculation.
>> '''
>> self.riskFreeRate = self.riskFreeRate/100
>> originalDict_ = {k: getattr(self, k) for k in self.keyList}
>> ListDict = []
>> for i in range(4):
>> ListDict.append(deepcopy(originalDict_))
>> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist
>> ListDict[2]['volatility'] = self.volatility + self.dist
>> ListDict[3]['expiryDate'] = (datetime.strptime(
>> self.expiryDate, self.date_format) -
>> timedelta(days=1)).strftime(self.date_format)
>> print(ListDict)
>> return(ListDict)
>>
>> def bs_process(self, create_process_for_iv=None, use_IV=None):
>> """
>> Creating the Black-Scholes process for option valuation.
>> """
>> riskFreeTS = ql.YieldTermStructureHandle(
>> ql.FlatForward(self.value_date, self.riskFreeRate,
>> ql.Actual365Fixed()))
>> dividendTS = ql.YieldTermStructureHandle(
>> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed()))
>> volatility = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(
>> self.value_date, ql.NullCalendar(), self.volatility,
>> ql.Actual365Fixed()))
>> initialValue =
>> ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice))
>> process = ql.BlackScholesMertonProcess(
>> initialValue, dividendTS, riskFreeTS, volatility)
>> return(process)
>>
>> def evaluate(self, Option=None, compute_implied_vol=None):
>> """
>> Call the relevant option based on the input.
>> """
>> self.riskFreeRate = self.riskFreeRate/100
>> res = None
>> option = AsianOptionPrice.asian(self)
>> if compute_implied_vol == True:
>> # create Black Scholes process using IV.
>> process = AsianOptionPrice.bs_process(
>> self, create_process_for_iv=False, use_IV=True)
>> engine = ql.FdBlackScholesAsianEngine(
>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>> aGrid=self.aGrid)
>> option.setPricingEngine(engine)
>> res = {'value': option.NPV(), 'impliedVolatility': self.IV}
>> else:
>> # Create Black Scholes process using HV.
>> process = AsianOptionPrice.bs_process(
>> self, create_process_for_iv=False, use_IV=False)
>> engine = ql.FdBlackScholesAsianEngine(
>> process, tGrid=self.tGrid, xGrid=self.xGrid,
>> aGrid=self.aGrid)
>> option.setPricingEngine(engine)
>> res = {'value': option.NPV()}
>> return res
>>
>> def evaluate_asian_npv(self):
>> Option = AsianOptionPrice.asian(self)
>> process = AsianOptionPrice.bs_process(
>> self, create_process_for_iv=False, use_IV=False)
>> engine = ql.FdBlackScholesAsianEngine(
>> process, tGrid=self.tGrid, xGrid=self.xGrid, aGrid=self.aGrid)
>> Option.setPricingEngine(engine)
>> res = Option.NPV()
>> return(res)
>>
>> def calculate_greeks(self, Option=None, compute_implied_vol=None):
>> today = self.value_date
>> Option = AsianOptionPrice.asian(self)
>> if compute_implied_vol == True:
>> process = AsianOptionPrice.bs_process(
>> self, create_process_for_iv=False, use_IV=True)
>> else:
>> process = AsianOptionPrice.bs_process(
>> self, create_process_for_iv=False, use_IV=False)
>> engine = ql.FdBlackScholesAsianEngine(
>> process, tGrid=self.tGrid, xGrid=self.xGrid, aGrid=self.aGrid)
>> Option.setPricingEngine(engine)
>> option_greeks_ = {"delta": Option.delta(), "gamma": Option.gamma(
>> )}
>> ArgmntList = AsianOptionPrice.create_arg_list(
>> self, Option, compute_implied_vol=True,
>> implied_vol_am_put=self.volatility)
>> DisturbedPrices = []
>> arg_keys = ['Price', 'PRup', 'PVup', 'PTup']
>> for i in range(4):
>> DisturbedPrices.append(eval(
>> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()"))
>> print(DisturbedPrices)
>> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices))
>> Rho = (PricesDistrbd['PRup'] -
>> PricesDistrbd['Price'])/(self.dist*100)
>> vega = (PricesDistrbd['PVup'] -
>> PricesDistrbd['Price'])/(self.dist*100)
>> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price'])
>> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta':
>> thetaDay})
>> return option_greeks_
>>
>>
>> settings = {
>> "computeHistoricalVolatiltiy": False,
>> "tenantId": "380",
>> "gridPoints": 149,
>> "computeImpliedVolatiltiy": False,
>> "runId": 3735,
>> "timeSteps": 150,
>> "optionTrades": [
>> {
>> "underlyingPrice": 98.69,
>> "refNo": "OPT-1135-GVA",
>> "underlyingPriceUnit": "US cents/LB",
>> "valueDate": "17-03-2022",
>> "fixingStartDate":"01-05-2022",
>> "pastFixings":0,
>> "volatility": 0.6015,
>> "openQuantity": 1,
>> "strikePriceUnit": "US cents/LB",
>> "optionType": "Call",
>> "expiryDate": "31-05-2022",
>> "exType": "asian",
>> "riskFreeRate": 0.8080374999999999,
>> "premium": 1,
>> "portfolioId": 18209,
>> "marketPremium": 11.42,
>> "longShort": "Long",
>> "optionInstrument": "EURO USD 1.105 Call",
>> "asset": "EURO USD 1.105 Call",
>> "portfolioName": "Option Trades",
>> "scenarioId": 8356,
>> "scenarioName": "Option Valuation - Greeks",
>> "strikePrice": 95,
>> "maturityInYears": 0.205479452
>> }
>> ],
>> "userId": "5263",
>> "americanOptionsEngine": "CrankNicolson"
>> }
>>
>> opt = AsianOptionPrice(**settings["optionTrades"][0])
>> opt.evaluate_asian_npv()
>>
>> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...>
>> wrote:
>>
>>> Hi Jack,
>>>
>>> Please find attached the Asian option python code and the option trade
>>> payload.
>>>
>>> Thanks for your help,
>>> Regards,
>>> Ashish
>>>
>>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote:
>>>
>>>> Hi Ashish,
>>>>
>>>> I've just lifted the examples from your references directly for a
>>>> discrete arithmetic Asian using the FD Asian engine and it is working for
>>>> me - can you share the code you are using that breaks please?
>>>>
>>>> Best,
>>>> Jack
>>>>
>>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...>
>>>> wrote:
>>>>
>>>>> Hi all,
>>>>>
>>>>> Could somebody help with the asian options? We are using
>>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online
>>>>> references are given below. In DiscreteAveragingAsianOption, we need to
>>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when
>>>>> we are passing it as 0, we are getting the following error:
>>>>> "QuantLib Error - Running average requires at least one past fixing"
>>>>> ref:
>>>>>
>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine
>>>>>
>>>>>
>>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption
>>>>>
>>>>> Queries:
>>>>> 1. What is to be passed here for new trade if not 0?
>>>>> 2. For trade which is mid of averaging and has few past fixings, do we
>>>>> need to pass the count of past fixing or the actual rates of the pastfixing
>>>>> as an array?
>>>>>
>>>>> Any help will be appreciated.
>>>>>
>>>>> Thanks in advance
>>>>> Ashish
>>>>> _______________________________________________
>>>>> QuantLib-users mailing list
>>>>> Qua...@li...
>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>>
>>>> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|
|
From: Ashish B. <ash...@gm...> - 2022-05-18 14:16:02
|
We tried again and got the same error.
Could it be due to the old version (1.7) we are using? I see in the release
notes of Apr-2021 that the overload for past fixing was added:
- Added an overloaded constructor for Asian options that takes all past
fixings and thus allows to reprice them correctly when the evaluation date
changes (thanks to Jack Gillett).
Ashish
On Wed, 18 May 2022 at 19:14, Jack G <jac...@gm...> wrote:
> Hi Ashish,
>
> I have a better answer for you with a screenshot awaiting moderation as
> it's quite large, but in the meantime, I was able to run your code without
> problems using the python at the bottom of this email (although I didn't
> check the numbers).
>
> If there is something you're doing specifically to generate the error,
> could you please attach a minimal reproduction of it?
>
> Best,
> Jack
>
>
>
>
> import QuantLib as ql
> from copy import deepcopy
> from datetime import datetime
> from datetime import timedelta
>
>
> # DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)]
> DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), ql.Period("18M"),
> ql.Period("24M")]
> DEFAULT_tGRID = 100
> DEFAULT_xGRID = 100
> DEFAULT_aGRID = 50
> DEFAULT_aRA = 1 # arithmeticRunningAccumulator
> DEFAULT_PASTFIXINGS = 1
>
>
> class AsianOptionPrice:
> def __init__(self, **x):
> for k, v in x.items():
> setattr(self, k, v)
> self.tGrid = x.get("tGrid", DEFAULT_tGRID)
> self.xGrid = x.get("xGrid", DEFAULT_xGRID)
> self.aGrid = x.get("aGrid", DEFAULT_aGRID)
> self.periods = x.get("periods", DEFAULT_PERIODS)
> self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS)
> self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA)
> self.keyList = [k for k, v in x.items()]
> self.dist = 10**(-2)
> self.date_format = "%d-%m-%Y"
> self.value_date = ql.DateParser.parseFormatted(
> self.valueDate, '%d-%m-%Y')
> self.expiry_date = ql.DateParser.parseFormatted(
> self.expiryDate, '%d-%m-%Y')
> ql.Settings.instance().evaluationDate = self.value_date
> self.exDay = ql.DateParser.parseFormatted(self.expiryDate,
> '%d-%m-%Y')
> # Volatility input is required for running the computing implied
> volatility function. This volatility is NOT used in the implied volatility
> calculation.
> self.vol_for_iv_calc = 0.10
> self.IV = None
>
> def generate_fixture_dates(self,start_date,end_date,period):
> schedule = ql.MakeSchedule(start_date, end_date, period)
> fixture_dates = [_date for _date in schedule if _date.weekday()
> not in [1,7]]
> return fixture_dates
> def asian(self):
> """
> arithmeticRunningAccumulator(aRA)
> """
> arithmeticRunningAccumulator = self.aRA
> pastFixings = self.pastFixings
> print(pastFixings)
> option_type = self.optionType.lower()
> if option_type not in ["call", "put"]:
> raise Exception(
> f"Option Type is Neither Call nor Put, Option type is
> {option_type}")
> option_type = ql.Option.Call if option_type == "call" else
> ql.Option.Put
> strike = self.strikePrice
> today = self.value_date
> print(today)
> fixingStartDate
> =ql.DateParser.parseFormatted(self.fixingStartDate, '%d-%m-%Y')
> print("#"*40,fixingStartDate)
> periods = self.periods
> asianFutureFixingDates =
> self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d"))
> print("#"*40,asianFutureFixingDates)
> asianExpiryDate = self.expiry_date
> vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike)
> europeanExercise = ql.EuropeanExercise(asianExpiryDate)
> arithmeticAverage = ql.Average().Arithmetic
> discreteArithmeticAsianOption = ql.DiscreteAveragingAsianOption(
> arithmeticAverage, arithmeticRunningAccumulator, pastFixings,
> asianFutureFixingDates, vanillaPayoff, europeanExercise)
> return discreteArithmeticAsianOption
>
> def create_arg_list(self, Option=None, compute_implied_vol=None,
> implied_vol_am_put=None):
> '''
> The arguments with disturbances added. Will be used for
> calculation of Greeks
> using numerical differentiation.
> Creating a dictionary of arguments that will be used for
> option price and greeks calculation.
> '''
> self.riskFreeRate = self.riskFreeRate/100
> originalDict_ = {k: getattr(self, k) for k in self.keyList}
> ListDict = []
> for i in range(4):
> ListDict.append(deepcopy(originalDict_))
> ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist
> ListDict[2]['volatility'] = self.volatility + self.dist
> ListDict[3]['expiryDate'] = (datetime.strptime(
> self.expiryDate, self.date_format) -
> timedelta(days=1)).strftime(self.date_format)
> print(ListDict)
> return(ListDict)
>
> def bs_process(self, create_process_for_iv=None, use_IV=None):
> """
> Creating the Black-Scholes process for option valuation.
> """
> riskFreeTS = ql.YieldTermStructureHandle(
> ql.FlatForward(self.value_date, self.riskFreeRate,
> ql.Actual365Fixed()))
> dividendTS = ql.YieldTermStructureHandle(
> ql.FlatForward(self.value_date, 0, ql.Actual365Fixed()))
> volatility = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(
> self.value_date, ql.NullCalendar(), self.volatility,
> ql.Actual365Fixed()))
> initialValue = ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice))
> process = ql.BlackScholesMertonProcess(
> initialValue, dividendTS, riskFreeTS, volatility)
> return(process)
>
> def evaluate(self, Option=None, compute_implied_vol=None):
> """
> Call the relevant option based on the input.
> """
> self.riskFreeRate = self.riskFreeRate/100
> res = None
> option = AsianOptionPrice.asian(self)
> if compute_implied_vol == True:
> # create Black Scholes process using IV.
> process = AsianOptionPrice.bs_process(
> self, create_process_for_iv=False, use_IV=True)
> engine = ql.FdBlackScholesAsianEngine(
> process, tGrid=self.tGrid, xGrid=self.xGrid,
> aGrid=self.aGrid)
> option.setPricingEngine(engine)
> res = {'value': option.NPV(), 'impliedVolatility': self.IV}
> else:
> # Create Black Scholes process using HV.
> process = AsianOptionPrice.bs_process(
> self, create_process_for_iv=False, use_IV=False)
> engine = ql.FdBlackScholesAsianEngine(
> process, tGrid=self.tGrid, xGrid=self.xGrid,
> aGrid=self.aGrid)
> option.setPricingEngine(engine)
> res = {'value': option.NPV()}
> return res
>
> def evaluate_asian_npv(self):
> Option = AsianOptionPrice.asian(self)
> process = AsianOptionPrice.bs_process(
> self, create_process_for_iv=False, use_IV=False)
> engine = ql.FdBlackScholesAsianEngine(
> process, tGrid=self.tGrid, xGrid=self.xGrid, aGrid=self.aGrid)
> Option.setPricingEngine(engine)
> res = Option.NPV()
> return(res)
>
> def calculate_greeks(self, Option=None, compute_implied_vol=None):
> today = self.value_date
> Option = AsianOptionPrice.asian(self)
> if compute_implied_vol == True:
> process = AsianOptionPrice.bs_process(
> self, create_process_for_iv=False, use_IV=True)
> else:
> process = AsianOptionPrice.bs_process(
> self, create_process_for_iv=False, use_IV=False)
> engine = ql.FdBlackScholesAsianEngine(
> process, tGrid=self.tGrid, xGrid=self.xGrid, aGrid=self.aGrid)
> Option.setPricingEngine(engine)
> option_greeks_ = {"delta": Option.delta(), "gamma": Option.gamma(
> )}
> ArgmntList = AsianOptionPrice.create_arg_list(
> self, Option, compute_implied_vol=True,
> implied_vol_am_put=self.volatility)
> DisturbedPrices = []
> arg_keys = ['Price', 'PRup', 'PVup', 'PTup']
> for i in range(4):
> DisturbedPrices.append(eval(
> "AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()"))
> print(DisturbedPrices)
> PricesDistrbd = dict(zip(arg_keys, DisturbedPrices))
> Rho = (PricesDistrbd['PRup'] -
> PricesDistrbd['Price'])/(self.dist*100)
> vega = (PricesDistrbd['PVup'] -
> PricesDistrbd['Price'])/(self.dist*100)
> thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price'])
> option_greeks_.update({'rho': Rho, 'vega': vega, 'theta':
> thetaDay})
> return option_greeks_
>
>
> settings = {
> "computeHistoricalVolatiltiy": False,
> "tenantId": "380",
> "gridPoints": 149,
> "computeImpliedVolatiltiy": False,
> "runId": 3735,
> "timeSteps": 150,
> "optionTrades": [
> {
> "underlyingPrice": 98.69,
> "refNo": "OPT-1135-GVA",
> "underlyingPriceUnit": "US cents/LB",
> "valueDate": "17-03-2022",
> "fixingStartDate":"01-05-2022",
> "pastFixings":0,
> "volatility": 0.6015,
> "openQuantity": 1,
> "strikePriceUnit": "US cents/LB",
> "optionType": "Call",
> "expiryDate": "31-05-2022",
> "exType": "asian",
> "riskFreeRate": 0.8080374999999999,
> "premium": 1,
> "portfolioId": 18209,
> "marketPremium": 11.42,
> "longShort": "Long",
> "optionInstrument": "EURO USD 1.105 Call",
> "asset": "EURO USD 1.105 Call",
> "portfolioName": "Option Trades",
> "scenarioId": 8356,
> "scenarioName": "Option Valuation - Greeks",
> "strikePrice": 95,
> "maturityInYears": 0.205479452
> }
> ],
> "userId": "5263",
> "americanOptionsEngine": "CrankNicolson"
> }
>
> opt = AsianOptionPrice(**settings["optionTrades"][0])
> opt.evaluate_asian_npv()
>
> On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...>
> wrote:
>
>> Hi Jack,
>>
>> Please find attached the Asian option python code and the option trade
>> payload.
>>
>> Thanks for your help,
>> Regards,
>> Ashish
>>
>> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote:
>>
>>> Hi Ashish,
>>>
>>> I've just lifted the examples from your references directly for a
>>> discrete arithmetic Asian using the FD Asian engine and it is working for
>>> me - can you share the code you are using that breaks please?
>>>
>>> Best,
>>> Jack
>>>
>>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> Could somebody help with the asian options? We are using
>>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online
>>>> references are given below. In DiscreteAveragingAsianOption, we need to
>>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when
>>>> we are passing it as 0, we are getting the following error:
>>>> "QuantLib Error - Running average requires at least one past fixing"
>>>> ref:
>>>>
>>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine
>>>>
>>>>
>>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption
>>>>
>>>> Queries:
>>>> 1. What is to be passed here for new trade if not 0?
>>>> 2. For trade which is mid of averaging and has few past fixings, do we
>>>> need to pass the count of past fixing or the actual rates of the pastfixing
>>>> as an array?
>>>>
>>>> Any help will be appreciated.
>>>>
>>>> Thanks in advance
>>>> Ashish
>>>> _______________________________________________
>>>> QuantLib-users mailing list
>>>> Qua...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>>
>>>
|
|
From: Jack G <jac...@gm...> - 2022-05-18 13:44:23
|
Hi Ashish,
I have a better answer for you with a screenshot awaiting moderation as
it's quite large, but in the meantime, I was able to run your code without
problems using the python at the bottom of this email (although I didn't
check the numbers).
If there is something you're doing specifically to generate the error,
could you please attach a minimal reproduction of it?
Best,
Jack
import QuantLib as ql
from copy import deepcopy
from datetime import datetime
from datetime import timedelta
# DEFAULT_PERIODS = [ql.Period(f"{i}d") for i in range(0,31)]
DEFAULT_PERIODS = [ql.Period("6M"), ql.Period("12M"), ql.Period("18M"),
ql.Period("24M")]
DEFAULT_tGRID = 100
DEFAULT_xGRID = 100
DEFAULT_aGRID = 50
DEFAULT_aRA = 1 # arithmeticRunningAccumulator
DEFAULT_PASTFIXINGS = 1
class AsianOptionPrice:
def __init__(self, **x):
for k, v in x.items():
setattr(self, k, v)
self.tGrid = x.get("tGrid", DEFAULT_tGRID)
self.xGrid = x.get("xGrid", DEFAULT_xGRID)
self.aGrid = x.get("aGrid", DEFAULT_aGRID)
self.periods = x.get("periods", DEFAULT_PERIODS)
self.pastFixings = x.get("pastFixings", DEFAULT_PASTFIXINGS)
self.aRA = x.get("arithmeticRunningAccumulator", DEFAULT_aRA)
self.keyList = [k for k, v in x.items()]
self.dist = 10**(-2)
self.date_format = "%d-%m-%Y"
self.value_date = ql.DateParser.parseFormatted(
self.valueDate, '%d-%m-%Y')
self.expiry_date = ql.DateParser.parseFormatted(
self.expiryDate, '%d-%m-%Y')
ql.Settings.instance().evaluationDate = self.value_date
self.exDay = ql.DateParser.parseFormatted(self.expiryDate,
'%d-%m-%Y')
# Volatility input is required for running the computing implied
volatility function. This volatility is NOT used in the implied volatility
calculation.
self.vol_for_iv_calc = 0.10
self.IV = None
def generate_fixture_dates(self,start_date,end_date,period):
schedule = ql.MakeSchedule(start_date, end_date, period)
fixture_dates = [_date for _date in schedule if _date.weekday() not
in [1,7]]
return fixture_dates
def asian(self):
"""
arithmeticRunningAccumulator(aRA)
"""
arithmeticRunningAccumulator = self.aRA
pastFixings = self.pastFixings
print(pastFixings)
option_type = self.optionType.lower()
if option_type not in ["call", "put"]:
raise Exception(
f"Option Type is Neither Call nor Put, Option type is
{option_type}")
option_type = ql.Option.Call if option_type == "call" else
ql.Option.Put
strike = self.strikePrice
today = self.value_date
print(today)
fixingStartDate =ql.DateParser.parseFormatted(self.fixingStartDate,
'%d-%m-%Y')
print("#"*40,fixingStartDate)
periods = self.periods
asianFutureFixingDates =
self.generate_fixture_dates(fixingStartDate,self.expiry_date,ql.Period("1d"))
print("#"*40,asianFutureFixingDates)
asianExpiryDate = self.expiry_date
vanillaPayoff = ql.PlainVanillaPayoff(option_type, strike)
europeanExercise = ql.EuropeanExercise(asianExpiryDate)
arithmeticAverage = ql.Average().Arithmetic
discreteArithmeticAsianOption = ql.DiscreteAveragingAsianOption(
arithmeticAverage, arithmeticRunningAccumulator, pastFixings,
asianFutureFixingDates, vanillaPayoff, europeanExercise)
return discreteArithmeticAsianOption
def create_arg_list(self, Option=None, compute_implied_vol=None,
implied_vol_am_put=None):
'''
The arguments with disturbances added. Will be used for
calculation of Greeks
using numerical differentiation.
Creating a dictionary of arguments that will be used for option
price and greeks calculation.
'''
self.riskFreeRate = self.riskFreeRate/100
originalDict_ = {k: getattr(self, k) for k in self.keyList}
ListDict = []
for i in range(4):
ListDict.append(deepcopy(originalDict_))
ListDict[1]['riskFreeRate'] = self.riskFreeRate + self.dist
ListDict[2]['volatility'] = self.volatility + self.dist
ListDict[3]['expiryDate'] = (datetime.strptime(
self.expiryDate, self.date_format) -
timedelta(days=1)).strftime(self.date_format)
print(ListDict)
return(ListDict)
def bs_process(self, create_process_for_iv=None, use_IV=None):
"""
Creating the Black-Scholes process for option valuation.
"""
riskFreeTS = ql.YieldTermStructureHandle(
ql.FlatForward(self.value_date, self.riskFreeRate,
ql.Actual365Fixed()))
dividendTS = ql.YieldTermStructureHandle(
ql.FlatForward(self.value_date, 0, ql.Actual365Fixed()))
volatility = ql.BlackVolTermStructureHandle(ql.BlackConstantVol(
self.value_date, ql.NullCalendar(), self.volatility,
ql.Actual365Fixed()))
initialValue = ql.QuoteHandle(ql.SimpleQuote(self.underlyingPrice))
process = ql.BlackScholesMertonProcess(
initialValue, dividendTS, riskFreeTS, volatility)
return(process)
def evaluate(self, Option=None, compute_implied_vol=None):
"""
Call the relevant option based on the input.
"""
self.riskFreeRate = self.riskFreeRate/100
res = None
option = AsianOptionPrice.asian(self)
if compute_implied_vol == True:
# create Black Scholes process using IV.
process = AsianOptionPrice.bs_process(
self, create_process_for_iv=False, use_IV=True)
engine = ql.FdBlackScholesAsianEngine(
process, tGrid=self.tGrid, xGrid=self.xGrid,
aGrid=self.aGrid)
option.setPricingEngine(engine)
res = {'value': option.NPV(), 'impliedVolatility': self.IV}
else:
# Create Black Scholes process using HV.
process = AsianOptionPrice.bs_process(
self, create_process_for_iv=False, use_IV=False)
engine = ql.FdBlackScholesAsianEngine(
process, tGrid=self.tGrid, xGrid=self.xGrid,
aGrid=self.aGrid)
option.setPricingEngine(engine)
res = {'value': option.NPV()}
return res
def evaluate_asian_npv(self):
Option = AsianOptionPrice.asian(self)
process = AsianOptionPrice.bs_process(
self, create_process_for_iv=False, use_IV=False)
engine = ql.FdBlackScholesAsianEngine(
process, tGrid=self.tGrid, xGrid=self.xGrid, aGrid=self.aGrid)
Option.setPricingEngine(engine)
res = Option.NPV()
return(res)
def calculate_greeks(self, Option=None, compute_implied_vol=None):
today = self.value_date
Option = AsianOptionPrice.asian(self)
if compute_implied_vol == True:
process = AsianOptionPrice.bs_process(
self, create_process_for_iv=False, use_IV=True)
else:
process = AsianOptionPrice.bs_process(
self, create_process_for_iv=False, use_IV=False)
engine = ql.FdBlackScholesAsianEngine(
process, tGrid=self.tGrid, xGrid=self.xGrid, aGrid=self.aGrid)
Option.setPricingEngine(engine)
option_greeks_ = {"delta": Option.delta(), "gamma": Option.gamma(
)}
ArgmntList = AsianOptionPrice.create_arg_list(
self, Option, compute_implied_vol=True,
implied_vol_am_put=self.volatility)
DisturbedPrices = []
arg_keys = ['Price', 'PRup', 'PVup', 'PTup']
for i in range(4):
DisturbedPrices.append(eval(
"AsianOptionPrice(**ArgmntList[i]).evaluate_asian_npv()"))
print(DisturbedPrices)
PricesDistrbd = dict(zip(arg_keys, DisturbedPrices))
Rho = (PricesDistrbd['PRup'] -
PricesDistrbd['Price'])/(self.dist*100)
vega = (PricesDistrbd['PVup'] -
PricesDistrbd['Price'])/(self.dist*100)
thetaDay = (PricesDistrbd['PTup'] - PricesDistrbd['Price'])
option_greeks_.update({'rho': Rho, 'vega': vega, 'theta':
thetaDay})
return option_greeks_
settings = {
"computeHistoricalVolatiltiy": False,
"tenantId": "380",
"gridPoints": 149,
"computeImpliedVolatiltiy": False,
"runId": 3735,
"timeSteps": 150,
"optionTrades": [
{
"underlyingPrice": 98.69,
"refNo": "OPT-1135-GVA",
"underlyingPriceUnit": "US cents/LB",
"valueDate": "17-03-2022",
"fixingStartDate":"01-05-2022",
"pastFixings":0,
"volatility": 0.6015,
"openQuantity": 1,
"strikePriceUnit": "US cents/LB",
"optionType": "Call",
"expiryDate": "31-05-2022",
"exType": "asian",
"riskFreeRate": 0.8080374999999999,
"premium": 1,
"portfolioId": 18209,
"marketPremium": 11.42,
"longShort": "Long",
"optionInstrument": "EURO USD 1.105 Call",
"asset": "EURO USD 1.105 Call",
"portfolioName": "Option Trades",
"scenarioId": 8356,
"scenarioName": "Option Valuation - Greeks",
"strikePrice": 95,
"maturityInYears": 0.205479452
}
],
"userId": "5263",
"americanOptionsEngine": "CrankNicolson"
}
opt = AsianOptionPrice(**settings["optionTrades"][0])
opt.evaluate_asian_npv()
On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...>
wrote:
> Hi Jack,
>
> Please find attached the Asian option python code and the option trade
> payload.
>
> Thanks for your help,
> Regards,
> Ashish
>
> On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote:
>
>> Hi Ashish,
>>
>> I've just lifted the examples from your references directly for a
>> discrete arithmetic Asian using the FD Asian engine and it is working for
>> me - can you share the code you are using that breaks please?
>>
>> Best,
>> Jack
>>
>> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...>
>> wrote:
>>
>>> Hi all,
>>>
>>> Could somebody help with the asian options? We are using
>>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online
>>> references are given below. In DiscreteAveragingAsianOption, we need to
>>> pass the past fixing which is suggested to be 0 for new trade. Whereas when
>>> we are passing it as 0, we are getting the following error:
>>> "QuantLib Error - Running average requires at least one past fixing"
>>> ref:
>>>
>>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine
>>>
>>>
>>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption
>>>
>>> Queries:
>>> 1. What is to be passed here for new trade if not 0?
>>> 2. For trade which is mid of averaging and has few past fixings, do we
>>> need to pass the count of past fixing or the actual rates of the pastfixing
>>> as an array?
>>>
>>> Any help will be appreciated.
>>>
>>> Thanks in advance
>>> Ashish
>>> _______________________________________________
>>> QuantLib-users mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>>>
>>
|
|
From: Jack G <jac...@gm...> - 2022-05-18 13:35:49
|
Ashish, I haven't verified your numbers but your code seems to run and generate a price without errors for me (see screenshot below). If you have a specific way of generating the error, could you provide a minimal code reproduction of it and I'll have another look. Best, Jack [image: image.png] On Wed, May 18, 2022 at 9:25 PM Ashish Bansal <ash...@gm...> wrote: > Hi Jack, > > Please find attached the Asian option python code and the option trade > payload. > > Thanks for your help, > Regards, > Ashish > > On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote: > >> Hi Ashish, >> >> I've just lifted the examples from your references directly for a >> discrete arithmetic Asian using the FD Asian engine and it is working for >> me - can you share the code you are using that breaks please? >> >> Best, >> Jack >> >> On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> >> wrote: >> >>> Hi all, >>> >>> Could somebody help with the asian options? We are using >>> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >>> references are given below. In DiscreteAveragingAsianOption, we need to >>> pass the past fixing which is suggested to be 0 for new trade. Whereas when >>> we are passing it as 0, we are getting the following error: >>> "QuantLib Error - Running average requires at least one past fixing" >>> ref: >>> >>> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >>> >>> >>> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >>> >>> Queries: >>> 1. What is to be passed here for new trade if not 0? >>> 2. For trade which is mid of averaging and has few past fixings, do we >>> need to pass the count of past fixing or the actual rates of the pastfixing >>> as an array? >>> >>> Any help will be appreciated. >>> >>> Thanks in advance >>> Ashish >>> _______________________________________________ >>> QuantLib-users mailing list >>> Qua...@li... >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>> >> |
|
From: Ashish B. <ash...@gm...> - 2022-05-18 13:25:35
|
Hi Jack, Please find attached the Asian option python code and the option trade payload. Thanks for your help, Regards, Ashish On Wed, 18 May 2022 at 12:12, Jack G <jac...@gm...> wrote: > Hi Ashish, > > I've just lifted the examples from your references directly for a discrete > arithmetic Asian using the FD Asian engine and it is working for me - can > you share the code you are using that breaks please? > > Best, > Jack > > On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> wrote: > >> Hi all, >> >> Could somebody help with the asian options? We are using >> FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online >> references are given below. In DiscreteAveragingAsianOption, we need to >> pass the past fixing which is suggested to be 0 for new trade. Whereas when >> we are passing it as 0, we are getting the following error: >> "QuantLib Error - Running average requires at least one past fixing" >> ref: >> >> https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine >> >> >> https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption >> >> Queries: >> 1. What is to be passed here for new trade if not 0? >> 2. For trade which is mid of averaging and has few past fixings, do we >> need to pass the count of past fixing or the actual rates of the pastfixing >> as an array? >> >> Any help will be appreciated. >> >> Thanks in advance >> Ashish >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > |
|
From: Jack G <jac...@gm...> - 2022-05-18 06:42:55
|
Hi Ashish, I've just lifted the examples from your references directly for a discrete arithmetic Asian using the FD Asian engine and it is working for me - can you share the code you are using that breaks please? Best, Jack On Wed, 18 May 2022, 13:55 Ashish Bansal, <ash...@gm...> wrote: > Hi all, > > Could somebody help with the asian options? We are using > FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online > references are given below. In DiscreteAveragingAsianOption, we need to > pass the past fixing which is suggested to be 0 for new trade. Whereas when > we are passing it as 0, we are getting the following error: > "QuantLib Error - Running average requires at least one past fixing" > ref: > > https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine > > > https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption > > Queries: > 1. What is to be passed here for new trade if not 0? > 2. For trade which is mid of averaging and has few past fixings, do we > need to pass the count of past fixing or the actual rates of the pastfixing > as an array? > > Any help will be appreciated. > > Thanks in advance > Ashish > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Ashish B. <ash...@gm...> - 2022-05-18 05:55:22
|
Hi all, Could somebody help with the asian options? We are using FdBlackScholesAsianengine with DiscreteAveragingAsianOption. Online references are given below. In DiscreteAveragingAsianOption, we need to pass the past fixing which is suggested to be 0 for new trade. Whereas when we are passing it as 0, we are getting the following error: "QuantLib Error - Running average requires at least one past fixing" ref: https://quantlib-python-docs.readthedocs.io/en/latest/pricing_engines.html#fdblackscholesasianengine https://quantlib-python-docs.readthedocs.io/en/latest/instruments/options.html?highlight=DiscreteAveragingAsianOption#ql.DiscreteAveragingAsianOption Queries: 1. What is to be passed here for new trade if not 0? 2. For trade which is mid of averaging and has few past fixings, do we need to pass the count of past fixing or the actual rates of the pastfixing as an array? Any help will be appreciated. Thanks in advance Ashish |
|
From: Peter C. <pca...@gm...> - 2022-05-11 07:55:49
|
Hi all When QuantLib is built with enabled QL_ENABLE_SESSIONS, users have to provide an implementation of sessionId(). Usually the sessions are used to enable thread-local singleton instances and consequently sessionId() will be implemented such that the current thread id is returned. More recent versions of QuantLib require C++11 as the minimum language standard and with that we are able to simplify the singleton implementation while always ensuring a thread-safe initialization of singleton instances. The proposed change is this https://github.com/lballabio/QuantLib/pull/1377 and comes with a removal of the sessionId() and a hard-wired assumption that there is a 1:1 relation between sessions and threads. The question for you is whether there are other uses of sessions out there which wouldn't be supported after the above change, i.e. where you use sessions differently from what I described above. Thanks Peter |
|
From: Christofer B. <bog...@gm...> - 2022-05-04 17:55:00
|
Many thanks Luigi. It solves our problem. On Wed, May 4, 2022 at 3:14 PM Luigi Ballabio <lui...@gm...> wrote: > > Ok, here it is: > > configure:17302: checking for Boost development files > configure:17318: g++ -c -std=c++11 conftest.cpp >&5 > ./configure: line 1801: g++: command not found > > It looks like your VM has a minimal setup that doesn't include g++. Installing it should solve the problem. > > Luigi > > > > > On Wed, May 4, 2022 at 10:23 AM Christofer Bogaso <bog...@gm...> wrote: >> >> Hi, >> >> I am running ./configure within Home/QuantLib-1.26 folder. >> >> Attached is a snapshot of all files and folders within that folder. I >> fail to see any file with name config.log. There is a folder called >> config, but within that also the log is not present. Could you please >> help me to identify the exact location? >> >> On Wed, May 4, 2022 at 1:28 PM Luigi Ballabio <lui...@gm...> wrote: >> > >> > configure.ac is an input used to build configure itself. >> > >> > You need to look at config.log in the directory where you ran ./configure >> > >> > >> > On Wed, May 4, 2022 at 6:50 AM Daniel Lobo <dan...@gm...> wrote: >> >> >> >> Hi, >> >> >> >> I still get the same error message as below, >> >> >> >> $ ./configure --with-boost-include=usr/include/boost >> >> --with-boost-lib=/usr/lib/x86_64-linux-gnu >> >> checking for a BSD-compatible install... /usr/bin/install -c >> >> checking whether build environment is sane... yes >> >> checking for a race-free mkdir -p... /usr/bin/mkdir -p >> >> checking for gawk... no >> >> checking for mawk... mawk >> >> checking whether make sets $(MAKE)... no >> >> checking whether make supports nested variables... no >> >> checking whether UID '1000' is supported by ustar format... yes >> >> checking whether GID '1000' is supported by ustar format... yes >> >> checking how to create a ustar tar archive... gnutar >> >> checking for gawk... (cached) mawk >> >> checking for gcc... gcc >> >> checking whether the C compiler works... yes >> >> checking for C compiler default output file name... a.out >> >> checking for suffix of executables... >> >> checking whether we are cross compiling... no >> >> checking for suffix of object files... o >> >> checking whether the compiler supports GNU C... yes >> >> checking whether gcc accepts -g... yes >> >> checking for gcc option to enable C11 features... none needed >> >> checking whether gcc understands -c and -o together... yes >> >> checking whether make supports the include directive... no >> >> checking dependency style of gcc... none >> >> checking for g++... no >> >> checking for c++... no >> >> checking for gpp... no >> >> checking for aCC... no >> >> checking for CC... no >> >> checking for cxx... no >> >> checking for cc++... no >> >> checking for cl.exe... no >> >> checking for FCC... no >> >> checking for KCC... no >> >> checking for RCC... no >> >> checking for xlC_r... no >> >> checking for xlC... no >> >> checking for clang++... no >> >> checking whether the compiler supports GNU C++... no >> >> checking whether g++ accepts -g... no >> >> checking for g++ option to enable C++11 features... none needed >> >> checking dependency style of g++... none >> >> checking how to run the C preprocessor... gcc -E >> >> checking build system type... x86_64-pc-linux-gnu >> >> checking host system type... x86_64-pc-linux-gnu >> >> checking how to print strings... printf >> >> checking for a sed that does not truncate output... /usr/bin/sed >> >> checking for grep that handles long lines and -e... /usr/bin/grep >> >> checking for egrep... /usr/bin/grep -E >> >> checking for fgrep... /usr/bin/grep -F >> >> checking for ld used by gcc... /usr/bin/ld >> >> checking if the linker (/usr/bin/ld) is GNU ld... yes >> >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> >> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> >> checking whether ln -s works... yes >> >> checking the maximum length of command line arguments... 1572864 >> >> checking how to convert x86_64-pc-linux-gnu file names to >> >> x86_64-pc-linux-gnu format... func_convert_file_noop >> >> checking how to convert x86_64-pc-linux-gnu file names to toolchain >> >> format... func_convert_file_noop >> >> checking for /usr/bin/ld option to reload object files... -r >> >> checking for objdump... objdump >> >> checking how to recognize dependent libraries... pass_all >> >> checking for dlltool... no >> >> checking how to associate runtime and link libraries... printf %s\n >> >> checking for ar... ar >> >> checking for archiver @FILE support... @ >> >> checking for strip... strip >> >> checking for ranlib... ranlib >> >> checking command to parse /usr/bin/nm -B output from gcc object... ok >> >> checking for sysroot... no >> >> checking for a working dd... /usr/bin/dd >> >> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 >> >> checking for mt... mt >> >> checking if mt is a manifest tool... no >> >> checking for stdio.h... yes >> >> checking for stdlib.h... yes >> >> checking for string.h... yes >> >> checking for inttypes.h... yes >> >> checking for stdint.h... yes >> >> checking for strings.h... yes >> >> checking for sys/stat.h... yes >> >> checking for sys/types.h... yes >> >> checking for unistd.h... yes >> >> checking for dlfcn.h... yes >> >> checking for objdir... .libs >> >> checking if gcc supports -fno-rtti -fno-exceptions... no >> >> checking for gcc option to produce PIC... -fPIC -DPIC >> >> checking if gcc PIC flag -fPIC -DPIC works... yes >> >> checking if gcc static flag -static works... yes >> >> checking if gcc supports -c -o file.o... yes >> >> checking if gcc supports -c -o file.o... (cached) yes >> >> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> >> shared libraries... yes >> >> checking whether -lc should be explicitly linked in... no >> >> checking dynamic linker characteristics... GNU/Linux ld.so >> >> checking how to hardcode library paths into programs... immediate >> >> checking whether stripping libraries is possible... yes >> >> checking if libtool supports shared libraries... yes >> >> checking whether to build shared libraries... yes >> >> checking whether to build static libraries... yes >> >> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS >> >> checking for Boost development files... no >> >> configure: error: Boost development files not found >> >> >> >> Below is the outputs from configure file (configure.ac) >> >> >> >> # Process this file with autoconf to produce a configure script. >> >> AC_INIT([QuantLib], [1.26], >> >> [qua...@li...], >> >> [QuantLib]) >> >> AC_PREREQ(2.62) >> >> AC_CONFIG_SRCDIR([ql/qldefines.hpp]) >> >> AC_CONFIG_AUX_DIR([config]) >> >> AC_CONFIG_HEADERS([ql/config.hpp]) >> >> AM_INIT_AUTOMAKE([foreign nostdinc subdir-objects tar-ustar]) >> >> AC_CONFIG_MACRO_DIR([m4]) >> >> >> >> AC_COPYRIGHT([ >> >> Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl >> >> Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 StatPro Italia srl >> >> Copyright (C) 2004, 2005 Ferdinando Ametrano >> >> >> >> This file is part of QuantLib, a free-software/open-source library >> >> for financial quantitative analysts and developers - http://quantlib.org/ >> >> >> >> QuantLib is free software: you can redistribute it and/or modify it >> >> under the terms of the QuantLib license. You should have received a >> >> copy of the license along with this program; if not, please email >> >> <qua...@li...>. The license is also available online at >> >> <http://quantlib.org/license.shtml>. >> >> >> >> This program is distributed in the hope that it will be useful, but WITHOUT >> >> ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS >> >> FOR A PARTICULAR PURPOSE. See the license for more details.]) >> >> >> >> AC_PROG_AWK >> >> AC_PROG_INSTALL >> >> >> >> # Help the compiler find external software >> >> >> >> AC_ARG_WITH([boost-include], >> >> AS_HELP_STRING([--with-boost-include=INCLUDE_PATH], >> >> [Supply the location of Boost header files]), >> >> [ql_boost_include_path="`cd ${withval} 2>/dev/null && pwd`"], >> >> [ql_boost_include_path=""]) >> >> if test [ -n "$ql_boost_include_path" ] ; then >> >> AC_SUBST([BOOST_INCLUDE],["-I${ql_boost_include_path}"]) >> >> AC_SUBST([CPPFLAGS],["${CPPFLAGS} -I${ql_boost_include_path}"]) >> >> fi >> >> AC_ARG_WITH([boost-lib], >> >> AS_HELP_STRING([--with-boost-lib=LIB_PATH], >> >> [Supply the location of Boost libraries]), >> >> [ql_boost_lib_path="`cd ${withval} 2>/dev/null && pwd`"], >> >> [ql_boost_lib_path=""]) >> >> if test [ -n "$ql_boost_lib_path" ] ; then >> >> AC_SUBST([BOOST_LIB],["-L${ql_boost_lib_path}"]) >> >> AC_SUBST([LDFLAGS],["${LDFLAGS} -L${ql_boost_lib_path}"]) >> >> fi >> >> >> >> >> >> # Continue setup >> >> >> >> AC_PROG_CC >> >> AC_PROG_CXX >> >> AC_PROG_CPP >> >> LT_INIT >> >> >> >> AM_CONDITIONAL(ENABLE_STATIC, test "${enable_static}" == "yes") >> >> >> >> AC_LANG([C++]) >> >> >> >> AC_ARG_ENABLE([openmp], >> >> AS_HELP_STRING([--enable-openmp], >> >> [If enabled, configure will try to detect >> >> and enable OpenMP support.]), >> >> [ql_openmp=$enableval], >> >> [ql_openmp=no]) >> >> if test "$ql_openmp" = "yes" ; then >> >> AC_OPENMP >> >> AC_SUBST([CXXFLAGS],["${CXXFLAGS} ${OPENMP_CXXFLAGS}"]) >> >> fi >> >> >> >> # Check for C++11 support >> >> QL_CHECK_CPP11 >> >> >> >> # Check for Boost components >> >> QL_CHECK_BOOST >> >> AM_CONDITIONAL(BOOST_UNIT_TEST_FOUND, test "x${BOOST_UNIT_TEST_LIB}" != "x") >> >> >> >> # Check for Emacs >> >> AM_PATH_LISPDIR >> >> AM_CONDITIONAL(EMACS_FOUND, test "${EMACS}" != "no") >> >> >> >> # Check for tools needed for building documentation >> >> AC_PATH_PROG([DOXYGEN], [doxygen]) >> >> AC_PATH_PROG([SED], [sed]) >> >> AC_PATH_PROG([LATEX], [latex]) >> >> AC_PATH_PROG([PDFLATEX], [pdflatex]) >> >> AC_PATH_PROG([MAKEINDEX], [makeindex]) >> >> AC_PATH_PROG([DVIPS], [dvips]) >> >> >> >> >> >> # site configuration >> >> >> >> # AC_ARG_WITH([real], >> >> # AS_HELP_STRING([--with-real=type], >> >> # [The given type will be used for floating-point >> >> # calculations. >> >> # In case this option is not invoked, double >> >> # will be used.]), >> >> # [AC_DEFINE_UNQUOTED([QL_REAL],[$withval], >> >> # [Define this as the type to be used for >> >> # floating-point calculations.])], >> >> # [AC_DEFINE_UNQUOTED([QL_REAL],[double], >> >> # [Define this as the type to be used for >> >> # floating-point calculations.])]) >> >> >> >> # AC_ARG_WITH([integer], >> >> # AS_HELP_STRING([--with-integer=type], >> >> # [The given type will be used for integer >> >> # calculations. At least an int is required. >> >> # In case this option is not invoked, int >> >> # will be used.]), >> >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[$withval], >> >> # [Define this as the type to be used for >> >> # integer calculations. At least an int >> >> # is required.])], >> >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[int], >> >> # [Define this as the type to be used for >> >> # integer calculations. At least an int >> >> # is required.])]) >> >> >> >> # AC_ARG_WITH([big-integer], >> >> # AS_HELP_STRING([--with-big-integer=type], >> >> # [The given type will be used for large integer >> >> # calculations. At least 4 bytes are required. >> >> # In case this option is not invoked, long >> >> # will be used.]), >> >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[$withval], >> >> # [Define this as the type to be used for >> >> # large integer calculations. At least >> >> # 4 bytes are required.])], >> >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[long], >> >> # [Define this as the type to be used for >> >> # large integer calculations. At least >> >> # 4 bytes are required.])]) >> >> >> >> >> >> AC_ARG_ENABLE([error-lines], >> >> AS_HELP_STRING([--enable-error-lines], >> >> [If enabled, file and line information is >> >> added to the error messages thrown by >> >> the library.]), >> >> [ql_error_lines=$enableval], >> >> [ql_error_lines=no]) >> >> AC_MSG_CHECKING([whether to add file and line information to errors]) >> >> if test "$ql_error_lines" = "yes" ; then >> >> AC_DEFINE([QL_ERROR_LINES],[1], >> >> [Define this if error messages should include file and line >> >> information.]) >> >> fi >> >> AC_MSG_RESULT([$ql_error_lines]) >> >> >> >> AC_ARG_ENABLE([error-functions], >> >> AS_HELP_STRING([--enable-error-functions], >> >> [If enabled, current function information >> >> is added to the error messages thrown by >> >> the library.]), >> >> [ql_error_functions=$enableval], >> >> [ql_error_functions=no]) >> >> AC_MSG_CHECKING([whether to add function information to errors]) >> >> if test "$ql_error_functions" = "yes" ; then >> >> AC_DEFINE([QL_ERROR_FUNCTIONS],[1], >> >> [Define this if error messages should include current function >> >> information.]) >> >> fi >> >> AC_MSG_RESULT([$ql_error_functions]) >> >> >> >> AC_ARG_ENABLE([tracing], >> >> AS_HELP_STRING([--enable-tracing], >> >> [If enabled, tracing messages might be emitted >> >> by the library depending on run-time >> >> settings. Enabling this option can degrade >> >> performance.]), >> >> [ql_tracing=$enableval], >> >> [ql_tracing=no]) >> >> AC_MSG_CHECKING([whether to enable tracing]) >> >> if test "$ql_tracing" = "yes" ; then >> >> AC_DEFINE([QL_ENABLE_TRACING],[1], >> >> [Define this if tracing messages should allowed (whether they >> >> are actually emitted will depend on run-time settings.)]) >> >> fi >> >> AC_MSG_RESULT([$ql_tracing]) >> >> >> >> AC_MSG_CHECKING([whether to enable indexed coupons]) >> >> AC_ARG_ENABLE([indexed-coupons], >> >> AS_HELP_STRING([--enable-indexed-coupons], >> >> [If enabled, indexed coupons (see the >> >> documentation) are used in floating legs. >> >> If disabled (the default), par coupons >> >> are used.]), >> >> [ql_indexed_coupon=$enableval], >> >> [ql_indexed_coupon=no]) >> >> if test "$ql_indexed_coupon" = "yes" ; then >> >> AC_DEFINE([QL_USE_INDEXED_COUPON],[1], >> >> [Define this to use indexed coupons instead of par coupons in >> >> floating legs.]) >> >> fi >> >> AC_MSG_RESULT([$ql_indexed_coupon]) >> >> >> >> AC_MSG_CHECKING([whether to enable extra safety checks]) >> >> AC_ARG_ENABLE([extra-safety-checks], >> >> AS_HELP_STRING([--enable-extra-safety-checks], >> >> [If enabled, extra run-time checks are added >> >> to a few functions. This can prevent their >> >> inlining and degrade performance.]), >> >> [ql_belt_and_braces=$enableval], >> >> [ql_belt_and_braces=no]) >> >> if test "$ql_belt_and_braces" = "yes" ; then >> >> AC_DEFINE([QL_EXTRA_SAFETY_CHECKS],[1], >> >> [Define this if extra safety checks should be performed. >> >> This can degrade performance.]) >> >> fi >> >> AC_MSG_RESULT([$ql_belt_and_braces]) >> >> >> >> AC_MSG_CHECKING([whether to enable sessions]) >> >> AC_ARG_ENABLE([sessions], >> >> AS_HELP_STRING([--enable-sessions], >> >> [If enabled, singletons will return different >> >> instances for different sessions. You will >> >> have to provide and link with the library >> >> a sessionId() function in namespace QuantLib, >> >> returning a different session id for each >> >> session. This also implies thread-safe >> >> Singleton initialization.]), >> >> [ql_use_sessions=$enableval], >> >> [ql_use_sessions=no]) >> >> if test "$ql_use_sessions" = "yes" ; then >> >> AC_DEFINE([QL_ENABLE_SESSIONS],[1], >> >> [Define this if you want to enable sessions.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_sessions]) >> >> >> >> AC_MSG_CHECKING([whether to enable thread-safe observer pattern]) >> >> AC_ARG_ENABLE([thread-safe-observer-pattern], >> >> AS_HELP_STRING([--enable-thread-safe-observer-pattern], >> >> [If enabled, thread-safe version of the >> >> observer pattern will be used. You should >> >> enable it if you want to use QuantLib >> >> via the SWIG layer within the JVM or .NET >> >> eco system or any environment with an >> >> async garbage collector. C++-17 is required >> >> if this option is used together with >> >> --enable-std-pointers]), >> >> [ql_use_tsop=$enableval], >> >> [ql_use_tsop=no]) >> >> AC_MSG_RESULT([$ql_use_tsop]) >> >> if test "$ql_use_tsop" = "yes" ; then >> >> AC_DEFINE([QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN],[1], >> >> [Define this if you want to enable >> >> thread-safe observer pattern.]) >> >> fi >> >> >> >> AC_MSG_CHECKING([whether to enable thread-safe singleton initialization]) >> >> AC_ARG_ENABLE([thread-safe-singleton-init], >> >> AS_HELP_STRING([--enable-thread-safe-singleton-init], >> >> [If enabled, singleton initialization will >> >> be thread-safe. This requires Boost 1.58 >> >> or later. Note that --enable-sessions >> >> implies thread-safe initialization, >> >> whether this is defined or not]), >> >> [ql_use_safe_singleton_init=$enableval], >> >> [ql_use_safe_singleton_init=no]) >> >> if test "$ql_use_safe_singleton_init" = "yes" ; then >> >> AC_DEFINE([QL_ENABLE_SINGLETON_THREAD_SAFE_INIT],[1], >> >> [Define this if you want thread-safe singleton initialization.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_safe_singleton_init]) >> >> >> >> if test "$ql_use_sessions" = "yes" || test "$ql_use_tsop" = "yes" || >> >> test "$ql_use_safe_singleton_init" = "yes"; then >> >> QL_CHECK_BOOST_VERSION_1_58_OR_HIGHER >> >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM >> >> else >> >> AC_SUBST([BOOST_THREAD_LIB],[""]) >> >> fi >> >> >> >> AC_MSG_CHECKING([whether to enable parallel unit test runner]) >> >> AC_ARG_ENABLE([parallel-unit-test-runner], >> >> AS_HELP_STRING([--enable-parallel-unit-test-runner], >> >> [If enabled, a parallel unit test runner is used >> >> to execute the C++ test suite. This will reduce >> >> the runtime on multi core CPUs.]), >> >> [ql_use_parallel_test=$enableval], >> >> [ql_use_parallel_test=no]) >> >> AC_MSG_RESULT([$ql_use_parallel_test]) >> >> if test "$ql_use_parallel_test" = "yes" ; then >> >> AC_DEFINE([QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER],[1], >> >> [Define this if you want to enable >> >> the parallel unit test runner.]) >> >> QL_CHECK_BOOST_VERSION_1_59_OR_HIGHER >> >> if test "$ql_use_tsop" != "yes" ; then >> >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM >> >> fi >> >> QL_CHECK_BOOST_TEST_INTERPROCESS >> >> else >> >> AC_SUBST([BOOST_INTERPROCESS_LIB],[""]) >> >> fi >> >> >> >> AC_MSG_CHECKING([whether to install examples]) >> >> AC_ARG_ENABLE([examples], >> >> AS_HELP_STRING([--enable-examples], >> >> [If enabled, examples are built and installed >> >> when "make" and "make install" are invoked. >> >> If disabled (the default) they are built >> >> but not installed.]), >> >> [ql_install_examples=$enableval], >> >> [ql_install_examples=no]) >> >> AM_CONDITIONAL(AUTO_EXAMPLES, test "$ql_install_examples" != "no") >> >> AC_MSG_RESULT([$ql_install_examples]) >> >> >> >> AC_MSG_CHECKING([whether to install the benchmark]) >> >> AC_ARG_ENABLE([benchmark], >> >> AS_HELP_STRING([--enable-benchmark], >> >> [If enabled, the benchmark is built and >> >> installed when "make" and "make install" >> >> are invoked. If disabled (the default) >> >> it is built but not installed.]), >> >> [ql_install_benchmark=$enableval], >> >> [ql_install_benchmark=no]) >> >> AM_CONDITIONAL(AUTO_BENCHMARK, test "$ql_install_benchmark" != "no") >> >> AC_MSG_RESULT([$ql_install_benchmark]) >> >> >> >> AC_MSG_CHECKING([whether to use unity build]) >> >> AC_ARG_ENABLE([unity-build], >> >> AS_HELP_STRING([--enable-unity-build], >> >> [If enabled, the source files in each directory >> >> are collected into one single source file and >> >> compiled together. This can speed up the >> >> compilation of the library. >> >> If disabled (the default) each source file is >> >> compiled separately..]), >> >> [ql_use_unity_build=$enableval], >> >> [ql_use_unity_build=no]) >> >> AM_CONDITIONAL(UNITY_BUILD, test "$ql_use_unity_build" != "no") >> >> AC_MSG_RESULT([$ql_use_unity_build]) >> >> >> >> AC_MSG_CHECKING([whether to enable intraday date and daycounters]) >> >> AC_ARG_ENABLE([intraday], >> >> AS_HELP_STRING([--enable-intraday], >> >> [If enabled, date objects will support an intraday >> >> datetime resolution down to microseconds. >> >> Strickly monotone daycounters (Actual360, >> >> Actual365Fixed and ActualActual) will take >> >> the additional information into account >> >> and allow for accurate intraday pricing. >> >> If disabled (the default) the smallest >> >> resolution of date objects will be a single day. >> >> Intraday datetime resolution is experimental.]), >> >> [ql_use_intraday=$enableval], >> >> [ql_use_intraday=no]) >> >> if test "$ql_use_intraday" = "yes" ; then >> >> AC_DEFINE([QL_HIGH_RESOLUTION_DATE],[1], >> >> [Define this if you want to enable high resolution date class.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_intraday]) >> >> >> >> AC_MSG_CHECKING([whether to enable standard smart pointers]) >> >> AC_ARG_ENABLE([std-pointers], >> >> AS_HELP_STRING([--enable-std-pointers], >> >> [If enabled, std::shared_ptr and related >> >> classes and functions will be used instead >> >> of boost::shared_ptr. >> >> If disabled (the default) the Boost facilities >> >> are used. >> >> Note that std::shared_ptr does not check >> >> access and can cause segmentation faults.]), >> >> [ql_use_std_pointers=$enableval], >> >> [ql_use_std_pointers=no]) >> >> if test "$ql_use_std_pointers" = "yes" ; then >> >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], >> >> [Define this if you want to use standard smart pointers.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_std_pointers]) >> >> >> >> AC_MSG_CHECKING([whether to enable std::unique_ptr instead of std::auto_ptr]) >> >> AC_ARG_ENABLE([std-unique-ptr], >> >> AS_HELP_STRING([--enable-std-unique-ptr], >> >> [If enabled (the default), std::unique_ptr will >> >> be used instead of the deprecated std::auto_ptr. >> >> If disabled, std::auto_ptr will still be used.]), >> >> [ql_use_unique_ptr=$enableval], >> >> [ql_use_unique_ptr=yes]) >> >> if test "$ql_use_unique_ptr" = "yes" ; then >> >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], >> >> [Define this if you want to replace std::auto_ptr with >> >> std::unique_ptr.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_unique_ptr]) >> >> >> >> AC_MSG_CHECKING([whether to enable std::function]) >> >> AC_ARG_ENABLE([std-function], >> >> AS_HELP_STRING([--enable-std-function], >> >> [If enabled, std::function and std::bind will be >> >> used instead of boost::function and boost::bind. >> >> If disabled (the default) the Boost facilities >> >> are used.]), >> >> [ql_use_std_function=$enableval], >> >> [ql_use_std_function=no]) >> >> if test "$ql_use_std_function" = "yes" ; then >> >> AC_DEFINE([QL_USE_STD_FUNCTION],[1], >> >> [Define this if you want to use std::function and std::bind.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_std_function]) >> >> >> >> >> >> AC_MSG_CHECKING([whether to enable std::tuple]) >> >> AC_ARG_ENABLE([std-tuple], >> >> AS_HELP_STRING([--enable-std-tuple], >> >> [If enabled, std::tuple and related functions >> >> will be used instead of boost::tuple. >> >> If disabled (the default) the Boost facilities >> >> are used.]), >> >> [ql_use_std_tuple=$enableval], >> >> [ql_use_std_tuple=no]) >> >> if test "$ql_use_std_tuple" = "yes" ; then >> >> AC_DEFINE([QL_USE_STD_TUPLE],[1], >> >> [Define this if you want to use std::tuple.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_std_pointers]) >> >> >> >> AC_MSG_CHECKING([whether to enable available std classes]) >> >> AC_ARG_ENABLE([std-classes], >> >> AS_HELP_STRING([--enable-std-classes], >> >> [This is a shortcut for --enable-std-pointers >> >> --enable-std-unique-ptr --enable-std-function >> >> --enable-std-tuple. >> >> If enabled, this supersedes any --disable >> >> option passed for the above.]), >> >> [ql_use_std_classes=$enableval], >> >> [ql_use_std_classes=no]) >> >> if test "$ql_use_std_classes" = "yes" ; then >> >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], >> >> [Define this if you want to use standard smart pointers.]) >> >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], >> >> [Define this if you want to replace std::auto_ptr with >> >> std::unique_ptr.]) >> >> AC_DEFINE([QL_USE_STD_FUNCTION],[1], >> >> [Define this if you want to use std::function and std::bind.]) >> >> AC_DEFINE([QL_USE_STD_TUPLE],[1], >> >> [Define this if you want to use std::tuple.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_std_classes]) >> >> >> >> >> >> AC_MSG_CHECKING([whether to enable the Disposable class template]) >> >> AC_ARG_ENABLE([disposable], >> >> AS_HELP_STRING([--enable-disposable], >> >> [If enabled, the Disposable class >> >> template will be used; >> >> this should be no longer necessary in C++11 >> >> and might interfere with compiler optimizations. >> >> If disabled (the default) the class will only >> >> be an alias for the underlying type.]), >> >> [ql_use_disposable=$enableval], >> >> [ql_use_disposable=no]) >> >> if test "$ql_use_disposable" = "yes" ; then >> >> AC_DEFINE([QL_USE_DISPOSABLE],[1], >> >> [Define this if you want to use the Disposable class template.]) >> >> fi >> >> AC_MSG_RESULT([$ql_use_disposable]) >> >> >> >> >> >> # manual configurations for specific hosts >> >> case $host in >> >> powerpc-apple-darwin*) >> >> AC_DEFINE([QL_PATCH_DARWIN],[1], >> >> [Define if running on a Mac OS X machine.]) >> >> ;; >> >> sparc-sun-solaris*) >> >> AC_DEFINE([QL_PATCH_SOLARIS],[1], >> >> [Define if running on a Sun Solaris machine.]) >> >> ;; >> >> esac >> >> >> >> >> >> # done, output the configured files >> >> AC_CONFIG_FILES([ >> >> Makefile >> >> ql/Makefile >> >> ql/cashflows/Makefile >> >> ql/currencies/Makefile >> >> ql/experimental/Makefile >> >> ql/experimental/amortizingbonds/Makefile >> >> ql/experimental/asian/Makefile >> >> ql/experimental/averageois/Makefile >> >> ql/experimental/barrieroption/Makefile >> >> ql/experimental/basismodels/Makefile >> >> ql/experimental/callablebonds/Makefile >> >> ql/experimental/catbonds/Makefile >> >> ql/experimental/commodities/Makefile >> >> ql/experimental/coupons/Makefile >> >> ql/experimental/credit/Makefile >> >> ql/experimental/exoticoptions/Makefile >> >> ql/experimental/finitedifferences/Makefile >> >> ql/experimental/forward/Makefile >> >> ql/experimental/fx/Makefile >> >> ql/experimental/inflation/Makefile >> >> ql/experimental/lattices/Makefile >> >> ql/experimental/math/Makefile >> >> ql/experimental/mcbasket/Makefile >> >> ql/experimental/models/Makefile >> >> ql/experimental/processes/Makefile >> >> ql/experimental/risk/Makefile >> >> ql/experimental/shortrate/Makefile >> >> ql/experimental/swaptions/Makefile >> >> ql/experimental/termstructures/Makefile >> >> ql/experimental/variancegamma/Makefile >> >> ql/experimental/varianceoption/Makefile >> >> ql/experimental/volatility/Makefile >> >> ql/indexes/Makefile >> >> ql/indexes/ibor/Makefile >> >> ql/indexes/inflation/Makefile >> >> ql/indexes/swap/Makefile >> >> ql/instruments/Makefile >> >> ql/instruments/bonds/Makefile >> >> ql/legacy/Makefile >> >> ql/legacy/libormarketmodels/Makefile >> >> ql/math/Makefile >> >> ql/math/copulas/Makefile >> >> ql/math/distributions/Makefile >> >> ql/math/integrals/Makefile >> >> ql/math/interpolations/Makefile >> >> ql/math/matrixutilities/Makefile >> >> ql/math/ode/Makefile >> >> ql/math/optimization/Makefile >> >> ql/math/randomnumbers/Makefile >> >> ql/math/solvers1d/Makefile >> >> ql/math/statistics/Makefile >> >> ql/methods/Makefile >> >> ql/methods/finitedifferences/Makefile >> >> ql/methods/finitedifferences/meshers/Makefile >> >> ql/methods/finitedifferences/operators/Makefile >> >> ql/methods/finitedifferences/schemes/Makefile >> >> ql/methods/finitedifferences/solvers/Makefile >> >> ql/methods/finitedifferences/stepconditions/Makefile >> >> ql/methods/finitedifferences/utilities/Makefile >> >> ql/methods/lattices/Makefile >> >> ql/methods/montecarlo/Makefile >> >> ql/models/Makefile >> >> ql/models/equity/Makefile >> >> ql/models/marketmodels/Makefile >> >> ql/models/marketmodels/browniangenerators/Makefile >> >> ql/models/marketmodels/callability/Makefile >> >> ql/models/marketmodels/correlations/Makefile >> >> ql/models/marketmodels/curvestates/Makefile >> >> ql/models/marketmodels/driftcomputation/Makefile >> >> ql/models/marketmodels/evolvers/Makefile >> >> ql/models/marketmodels/evolvers/volprocesses/Makefile >> >> ql/models/marketmodels/models/Makefile >> >> ql/models/marketmodels/pathwisegreeks/Makefile >> >> ql/models/marketmodels/products/Makefile >> >> ql/models/marketmodels/products/onestep/Makefile >> >> ql/models/marketmodels/products/multistep/Makefile >> >> ql/models/marketmodels/products/pathwise/Makefile >> >> ql/models/shortrate/Makefile >> >> ql/models/shortrate/calibrationhelpers/Makefile >> >> ql/models/shortrate/onefactormodels/Makefile >> >> ql/models/shortrate/twofactormodels/Makefile >> >> ql/models/volatility/Makefile >> >> ql/patterns/Makefile >> >> ql/pricingengines/Makefile >> >> ql/pricingengines/asian/Makefile >> >> ql/pricingengines/barrier/Makefile >> >> ql/pricingengines/basket/Makefile >> >> ql/pricingengines/bond/Makefile >> >> ql/pricingengines/capfloor/Makefile >> >> ql/pricingengines/cliquet/Makefile >> >> ql/pricingengines/credit/Makefile >> >> ql/pricingengines/forward/Makefile >> >> ql/pricingengines/inflation/Makefile >> >> ql/pricingengines/lookback/Makefile >> >> ql/pricingengines/quanto/Makefile >> >> ql/pricingengines/swap/Makefile >> >> ql/pricingengines/swaption/Makefile >> >> ql/pricingengines/vanilla/Makefile >> >> ql/processes/Makefile >> >> ql/quotes/Makefile >> >> ql/termstructures/Makefile >> >> ql/termstructures/credit/Makefile >> >> ql/termstructures/inflation/Makefile >> >> ql/termstructures/volatility/Makefile >> >> ql/termstructures/volatility/equityfx/Makefile >> >> ql/termstructures/volatility/capfloor/Makefile >> >> ql/termstructures/volatility/inflation/Makefile >> >> ql/termstructures/volatility/optionlet/Makefile >> >> ql/termstructures/volatility/swaption/Makefile >> >> ql/termstructures/yield/Makefile >> >> ql/time/Makefile >> >> ql/time/calendars/Makefile >> >> ql/time/daycounters/Makefile >> >> ql/utilities/Makefile >> >> man/Makefile >> >> m4/Makefile >> >> Docs/Makefile >> >> Examples/Makefile >> >> test-suite/Makefile]) >> >> AC_CONFIG_FILES([quantlib-config],[chmod +x quantlib-config]) >> >> AC_CONFIG_FILES([QuantLib.spec]) >> >> AC_CONFIG_FILES([quantlib.pc]) >> >> AC_OUTPUT >> >> >> >> On Tue, 3 May 2022 at 16:43, Conrad Cole <con...@gm...> wrote: >> >> > >> >> > ./configure --with-boost-include=usr/include/boost >> >> > --with-boost-lib=/usr/lib/x86_64-linux-gnu >> >> > >> >> > The config.log file should be in whatever directory you ran the >> >> > configure script. >> >> > >> >> > On 5/3/22 06:55, Daniel Lobo wrote: >> >> > > Also, given that my boost location is /usr/include/boost, how can I >> >> > > execute ./configure again with the boost lib and include flags using >> >> > > the proper directories? What will be the right code? >> >> > > >> >> > > Thanks, >> >> > > >> >> > > On Tue, 3 May 2022 at 15:54, Daniel Lobo <dan...@gm...> wrote: >> >> > >> Many thanks for your responses. >> >> > >> >> >> > >> whereis boost returns below location, >> >> > >> >> >> > >> $ whereis boost >> >> > >> boost: /usr/include/boost >> >> > >> >> >> > >> Where can I see the generated config.log file? >> >> > >> >> >> > >> Thanks for your time. >> >> > >> >> >> > >> >> >> > >> On Tue, 3 May 2022 at 03:29, Conrad Cole <con...@gm...> wrote: >> >> > >>> whereis boost is the command to find the location of the installed boost header files. >> >> > >>> >> >> > >>> On 5/2/22 17:08, Luigi Ballabio wrote: >> >> > >>> >> >> > >>> Can you look inside the generated config.log file and see what compiler error you're getting exactly? >> >> > >>> >> >> > >>> Luigi >> >> > >>> >> >> > >>> >> >> > >>> On Mon, May 2, 2022 at 7:49 PM Daniel Lobo <dan...@gm...> wrote: >> >> > >>>> Many thanks. >> >> > >>>> >> >> > >>>> I ran below codes to remove and reinstall boost >> >> > >>>> >> >> > >>>> sudo apt-get remove libboost-all-dev >> >> > >>>> sudo apt-get install libboost-all-dev >> >> > >>>> >> >> > >>>> boost installed in /usr/include >> >> > >>>> >> >> > >>>> :/usr/include$ ls >> >> > >>>> aio.h complex.h error.h features-time64.h getopt.h >> >> > >>>> langinfo.h math.h netdb.h numa.h >> >> > >>>> python3.10 setjmp.h string.h time.h video >> >> > >>>> aliases.h cpio.h evdns.h fenv.h glob.h >> >> > >>>> lastlog.h mcheck.h neteconet numaif.h rdma >> >> > >>>> sgtty.h strings.h tirpc wait.h >> >> > >>>> alloca.h crypt.h event2 finclude >> >> > >>>> gnu-versions.h libgen.h memory.h netinet obstack.h >> >> > >>>> re_comp.h shadow.h sudo_plugin.h ttyent.h wchar.h >> >> > >>>> argp.h ctype.h event.h fmtmsg.h grp.h >> >> > >>>> libintl.h misc netipx openvpn regex.h >> >> > >>>> signal.h syscall.h uchar.h wctype.h >> >> > >>>> argz.h dirent.h evhttp.h fnmatch.h gshadow.h >> >> > >>>> libltdl mntent.h netiucv paths.h regexp.h >> >> > >>>> sound sysexits.h ucontext.h wordexp.h >> >> > >>>> ar.h dlfcn.h evrpc.h fstab.h hwloc >> >> > >>>> libnl3 monetary.h netpacket poll.h resolv.h >> >> > >>>> spawn.h syslog.h ulimit.h X11 >> >> > >>>> arpa drm evutil.h fts.h hwloc.h >> >> > >>>> limits.h mqueue.h netrom printf.h rpc >> >> > >>>> stab.h tar.h unicode x86_64-linux-gnu >> >> > >>>> asm-generic elf.h execinfo.h ftw.h iconv.h >> >> > >>>> link.h mtd netrose proc_service.h rpcsvc >> >> > >>>> stdc-predef.h termio.h unistd.h xen >> >> > >>>> assert.h endian.h expat_external.h gcalc-2 ifaddrs.h >> >> > >>>> linux net nfs protocols sched.h >> >> > >>>> stdint.h termios.h utime.h xorg >> >> > >>>> boost >> >> > >>>> >> >> > >>>> But still get error when I run ./configure >> >> > >>>> >> >> > >>>> Below is the log that I get >> >> > >>>> >> >> > >>>> $ ./configure >> >> > >>>> checking for a BSD-compatible install... /usr/bin/install -c >> >> > >>>> checking whether build environment is sane... yes >> >> > >>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p >> >> > >>>> checking for gawk... no >> >> > >>>> checking for mawk... mawk >> >> > >>>> checking whether make sets $(MAKE)... no >> >> > >>>> checking whether make supports nested variables... no >> >> > >>>> checking whether UID '1000' is supported by ustar format... yes >> >> > >>>> checking whether GID '1000' is supported by ustar format... yes >> >> > >>>> checking how to create a ustar tar archive... gnutar >> >> > >>>> checking for gawk... (cached) mawk >> >> > >>>> checking for gcc... gcc >> >> > >>>> checking whether the C compiler works... yes >> >> > >>>> checking for C compiler default output file name... a.out >> >> > >>>> checking for suffix of executables... >> >> > >>>> checking whether we are cross compiling... no >> >> > >>>> checking for suffix of object files... o >> >> > >>>> checking whether the compiler supports GNU C... yes >> >> > >>>> checking whether gcc accepts -g... yes >> >> > >>>> checking for gcc option to enable C11 features... none needed >> >> > >>>> checking whether gcc understands -c and -o together... yes >> >> > >>>> checking whether make supports the include directive... no >> >> > >>>> checking dependency style of gcc... none >> >> > >>>> checking for g++... no >> >> > >>>> checking for c++... no >> >> > >>>> checking for gpp... no >> >> > >>>> checking for aCC... no >> >> > >>>> checking for CC... no >> >> > >>>> checking for cxx... no >> >> > >>>> checking for cc++... no >> >> > >>>> checking for cl.exe... no >> >> > >>>> checking for FCC... no >> >> > >>>> checking for KCC... no >> >> > >>>> checking for RCC... no >> >> > >>>> checking for xlC_r... no >> >> > >>>> checking for xlC... no >> >> > >>>> checking for clang++... no >> >> > >>>> checking whether the compiler supports GNU C++... no >> >> > >>>> checking whether g++ accepts -g... no >> >> > >>>> checking for g++ option to enable C++11 features... none needed >> >> > >>>> checking dependency style of g++... none >> >> > >>>> checking how to run the C preprocessor... gcc -E >> >> > >>>> checking build system type... x86_64-pc-linux-gnu >> >> > >>>> checking host system type... x86_64-pc-linux-gnu >> >> > >>>> checking how to print strings... printf >> >> > >>>> checking for a sed that does not truncate output... /usr/bin/sed >> >> > >>>> checking for grep that handles long lines and -e... /usr/bin/grep >> >> > >>>> checking for egrep... /usr/bin/grep -E >> >> > >>>> checking for fgrep... /usr/bin/grep -F >> >> > >>>> checking for ld used by gcc... /usr/bin/ld >> >> > >>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >> >> > >>>> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> >> > >>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> >> > >>>> checking whether ln -s works... yes >> >> > >>>> checking the maximum length of command line arguments... 1572864 >> >> > >>>> checking how to convert x86_64-pc-linux-gnu file names to >> >> > >>>> x86_64-pc-linux-gnu format... func_convert_file_noop >> >> > >>>> checking how to convert x86_64-pc-linux-gnu file names to toolchain >> >> > >>>> format... func_convert_file_noop >> >> > >>>> checking for /usr/bin/ld option to reload object files... -r >> >> > >>>> checking for objdump... objdump >> >> > >>>> checking how to recognize dependent libraries... pass_all >> >> > >>>> checking for dlltool... no >> >> > >>>> checking how to associate runtime and link libraries... printf %s\n >> >> > >>>> checking for ar... ar >> >> > >>>> checking for archiver @FILE support... @ >> >> > >>>> checking for strip... strip >> >> > >>>> checking for ranlib... ranlib >> >> > >>>> checking command to parse /usr/bin/nm -B output from gcc object... ok >> >> > >>>> checking for sysroot... no >> >> > >>>> checking for a working dd... /usr/bin/dd >> >> > >>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 >> >> > >>>> checking for mt... mt >> >> > >>>> checking if mt is a manifest tool... no >> >> > >>>> checking for stdio.h... yes >> >> > >>>> checking for stdlib.h... yes >> >> > >>>> checking for string.h... yes >> >> > >>>> checking for inttypes.h... yes >> >> > >>>> checking for stdint.h... yes >> >> > >>>> checking for strings.h... yes >> >> > >>>> checking for sys/stat.h... yes >> >> > >>>> checking for sys/types.h... yes >> >> > >>>> checking for unistd.h... yes >> >> > >>>> checking for dlfcn.h... yes >> >> > >>>> checking for objdir... .libs >> >> > >>>> checking if gcc supports -fno-rtti -fno-exceptions... no >> >> > >>>> checking for gcc option to produce PIC... -fPIC -DPIC >> >> > >>>> checking if gcc PIC flag -fPIC -DPIC works... yes >> >> > >>>> checking if gcc static flag -static works... yes >> >> > >>>> checking if gcc supports -c -o file.o... yes >> >> > >>>> checking if gcc supports -c -o file.o... (cached) yes >> >> > >>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> >> > >>>> shared libraries... yes >> >> > >>>> checking whether -lc should be explicitly linked in... no >> >> > >>>> checking dynamic linker characteristics... GNU/Linux ld.so >> >> > >>>> checking how to hardcode library paths into programs... immediate >> >> > >>>> checking whether stripping libraries is possible... yes >> >> > >>>> checking if libtool supports shared libraries... yes >> >> > >>>> checking whether to build shared libraries... yes >> >> > >>>> checking whether to build static libraries... yes >> >> > >>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS >> >> > >>>> checking for Boost development files... no >> >> > >>>> configure: error: Boost development files not found >> >> > >>>> >> >> > >>>> >> >> > >>>> Any pointer how to resolve this will be very helpful. >> >> > >>>> >> >> > >>>> Thanks >> >> > >>>> >> >> > >>>> On Sun, 1 May 2022 at 13:16, Jonathan Sweemer <sw...@gm...> wrote: >> >> > >>>>> Hi Daniel, >> >> > >>>>> >> >> > >>>>> Just to confirm, you’re no longer running ./configure with the —with-boost-include and —with-boost-lib flags right? >> >> > >>>>> >> >> > >>>>> If so then I would expect the configure script to find your boost installation. Please check that you see boost headers in /usr/include/boost and if not, try reinstalling boost. >> >> > >>>>> >> >> > >>>>> If you’re still unable to get ./configure to find boost then please attach the full output including all the commands that you ran. >> >> > >>>>> >> >> > >>>>> Jonathan >> >> > >>>>> >> >> > >>>>> >> >> > >>>>> 2022년 5월 1일 (일) 15:41, Daniel Lobo <dan...@gm...>님이 작성: >> >> > >>>>>> Hi, >> >> > >>>>>> >> >> > >>>>>> Many thanks for your response. >> >> > >>>>>> >> >> > >>>>>> Yes I ran 'sudo apt-get install libboost-all-dev' to install boost. >> >> > >>>>>> However still I get this error. >> >> > >>>>>> >> >> > >>>>>> How can I find where the boost is installed and how can I pass that >> >> > >>>>>> information './configure ' line? >> >> > >>>>>> >> >> > >>>>>> Apologies for trivial question if any, as I am not very expert in >> >> > >>>>>> Linux ecosystem. >> >> > >>>>>> >> >> > >>>>>> Thanks and regards, >> >> > >>>>>> >> >> > >>>>>> On Sun, 1 May 2022 at 11:53, Jonathan Sweemer <sw...@gm...> wrote: >> >> > >>>>>>> Hi Daniel, >> >> > >>>>>>> >> >> > >>>>>>> When you say that you “install[ed] boost already as provided in the instruction page” do you mean that you ran the following command? >> >> > >>>>>>> >> >> > >>>>>>> sudo apt-get install libboost-all-dev >> >> > >>>>>>> >> >> > >>>>>>> If so then you shouldn’t need to use the —with-boost-include and —with-boost-lib flags when configuring QuantLib. As the install guide mentions, you only need those flags when you install boost in a non-standard location. >> >> > >>>>>>> >> >> > >>>>>>> Jonathan >> >> > >>>>>>> >> >> > >>>>>>> >> >> > >>>>>>> 2022년 5월 1일 (일) 02:25, Daniel Lobo <dan...@gm...>님이 작성: >> >> > >>>>>>>> Hi, >> >> > >>>>>>>> >> >> > >>>>>>>> I am trying to install Quantlib in my Ubuntu VM. I was following the >> >> > >>>>>>>> instructions as provided in >> >> > >>>>>>>> https://www.quantlib.org/install/linux.shtml >> >> > >>>>>>>> >> >> > >>>>>>>> But this installation failed when I executed >> >> > >>>>>>>> >> >> > >>>>>>>> ./configure --with-boost-include=/home/foo/include >> >> > >>>>>>>> --with-boost-lib=/home/foo/lib >> >> > >>>>>>>> >> >> > >>>>>>>> >> >> > >>>>>>>> >> >> > >>>>>>>> The error I got is >> >> > >>>>>>>> >> >> > >>>>>>>> $ ./configure --with-boost-include=/home/foo/include >> >> > >>>>>>>> --with-boost-lib=/home/foo/lib >> >> > >>>>>>>> checking for a BSD-compatible install... /usr/bin/install -c >> >> > >>>>>>>> checking whether build environment is sane... yes >> >> > >>>>>>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p >> >> > >>>>>>>> checking for gawk... no >> >> > >>>>>>>> checking for mawk... mawk >> >> > >>>>>>>> checking whether make sets $(MAKE)... no >> >> > >>>>>>>> checking whether make supports nested variables... no >> >> > >>>>>>>> checking whether UID '1000' is supported by ustar format... yes >> >> > >>>>>>>> checking whether GID '1000' is supported by ustar format... yes >> >> > >>>>>>>> checking how to create a ustar tar archive... gnutar >> >> > >>>>>>>> checking for gawk... (cached) mawk >> >> > >>>>>>>> checking for gcc... gcc >> >> > >>>>>>>> checking whether the C compiler works... yes >> >> > >>>>>>>> checking for C compiler default output file name... a.out >> >> > >>>>>>>> checking for suffix of executables... >> >> > >>>>>>>> checking whether we are cross compiling... no >> >> > >>>>>>>> checking for suffix of object files... o >> >> > >>>>>>>> checking whether the compiler supports GNU C... yes >> >> > >>>>>>>> checking whether gcc accepts -g... yes >> >> > >>>>>>>> checking for gcc option to enable C11 features... none needed >> >> > >>>>>>>> checking whether gcc understands -c and -o together... yes >> >> > >>>>>>>> checking whether make supports the include directive... no >> >> > >>>>>>>> checking dependency style of gcc... none >> >> > >>>>>>>> checking for g++... no >> >> > >>>>>>>> checking for c++... no >> >> > >>>>>>>> checking for gpp... no >> >> > >>>>>>>> checking for aCC... no >> >> > >>>>>>>> checking for CC... no >> >> > >>>>>>>> checking for cxx... no >> >> > >>>>>>>> checking for cc++... no >> >> > >>>>>>>> checking for cl.exe... no >> >> > >>>>>>>> checking for FCC... no >> >> > >>>>>>>> checking for KCC... no >> >> > >>>>>>>> checking for RCC... no >> >> > >>>>>>>> checking for xlC_r... no >> >> > >>>>>>>> checking for xlC... no >> >> > >>>>>>>> checking for clang++... no >> >> > >>>>>>>> checking whether the compiler supports GNU C++... no >> >> > >>>>>>>> checking whether g++ accepts -g... no >> >> > >>>>>>>> checking for g++ option to enable C++11 features... none needed >> >> > >>>>>>>> checking dependency style of g++... none >> >> > >>>>>>>> checking how to run the C preprocessor... gcc -E >> >> > >>>>>>>> checking build system type... x86_64-pc-linux-gnu >> >> > >>>>>>>> checking host system type... x86_64-pc-linux-gnu >> >> > >>>>>>>> checking how to print strings... printf >> >> > >>>>>>>> checking for a sed that does not truncate output... /usr/bin/sed >> >> > >>>>>>>> checking for grep that handles long lines and -e... /usr/bin/grep >> >> > >>>>>>>> checking for egrep... /usr/bin/grep -E >> >> > >>>>>>>> checking for fgrep... /usr/bin/grep -F >> >> > >>>>>>>> checking for ld used by gcc... /usr/bin/ld >> >> > >>>>>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >> >> > >>>>>>>> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> >> > >>>>>>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> >> > >>>>>>>> checking whether ln -s works... yes >> >> > >>>>>>>> checking the maximum length of command line arguments... 1572864 >> >> > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to >> >> > >>>>>>>> x86_64-pc-linux-gnu format... func_convert_file_noop >> >> > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to toolchain >> >> > >>>>>>>> format... func_convert_file_noop >> >> > >>>>>>>> checking for /usr/bin/ld option to reload object files... -r >> >> > >>>>>>>> checking for objdump... objdump >> >> > >>>>>>>> checking how to recognize dependent libraries... pass_all >> >> > >>>>>>>> checking for dlltool... no >> >> > >>>>>>>> checking how to associate runtime and link libraries... printf %s\n >> >> > >>>>>>>> checking for ar... ar >> >> > >>>>>>>> checking for archiver @FILE support... @ >> >> > >>>>>>>> checking for strip... strip >> >> > >>>>>>>> checking for ranlib... ranlib >> >> > >>>>>>>> checking command to parse /usr/bin/nm -B output from gcc object... ok >> >> > >>>>>>>> checking for sysroot... no >> >> > >>>>>>>> checking for a working dd... /usr/bin/dd >> >> > >>>>>>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 >> >> > >>>>>>>> checking for mt... mt >> >> > >>>>>>>> checking if mt is a manifest tool... no >> >> > >>>>>>>> checking for stdio.h... yes >> >> > >>>>>>>> checking for stdlib.h... yes >> >> > >>>>>>>> checking for string.h... yes >> >> > >>>>>>>> checking for inttypes.h... yes >> >> > >>>>>>>> checking for stdint.h... yes >> >> > >>>>>>>> checking for strings.h... yes >> >> > >>>>>>>> checking for sys/stat.h... yes >> >> > >>>>>>>> checking for sys/types.h... yes >> >> > >>>>>>>> checking for unistd.h... yes >> >> > >>>>>>>> checking for dlfcn.h... yes >> >> > >>>>>>>> checking for objdir... .libs >> >> > >>>>>>>> checking if gcc supports -fno-rtti -fno-exceptions... no >> >> > >>>>>>>> checking for gcc option to produce PIC... -fPIC -DPIC >> >> > >>>>>>>> checking if gcc PIC flag -fPIC -DPIC works... yes >> >> > >>>>>>>> checking if gcc static flag -static works... yes >> >> > >>>>>>>> checking if gcc supports -c -o file.o... yes >> >> > >>>>>>>> checking if gcc supports -c -o file.o... (cached) yes >> >> > >>>>>>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> >> > >>>>>>>> shared libraries... yes >> >> > >>>>>>>> checking whether -lc should be explicitly linked in... no >> >> > >>>>>>>> checking dynamic linker characteristics... GNU/Linux ld.so >> >> > >>>>>>>> checking how to hardcode library paths into programs... immediate >> >> > >>>>>>>> checking whether stripping libraries is possible... yes >> >> > >>>>>>>> checking if libtool supports shared libraries... yes >> >> > >>>>>>>> checking whether to build shared libraries... yes >> >> > >>>>>>>> checking whether to build static libraries... yes >> >> > >>>>>>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS >> >> > >>>>>>>> checking for Boost development files... no >> >> > >>>>>>>> configure: error: Boost development files not found >> >> > >>>>>>>> >> >> > >>>>>>>> Could you please help how to resolve this error. I executed the code >> >> > >>>>>>>> to install boost already as provided in the instruction page. >> >> > >>>>>>>> >> >> > >>>>>>>> >> >> > >>>>>>>> _______________________________________________ >> >> > >>>>>>>> QuantLib-users mailing list >> >> > >>>>>>>> Qua...@li... >> >> > >>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> > >>>> >> >> > >>>> _______________________________________________ >> >> > >>>> QuantLib-users mailing list >> >> > >>>> Qua...@li... >> >> > >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> > >>> >> >> > >>> >> >> > >>> _______________________________________________ >> >> > >>> QuantLib-users mailing list >> >> > >>> Qua...@li... >> >> > >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > >> > _______________________________________________ >> > QuantLib-users mailing list >> > Qua...@li... >> > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Luigi B. <lui...@gm...> - 2022-05-04 09:44:55
|
Ok, here it is: configure:17302: checking for Boost development files configure:17318: g++ -c -std=c++11 conftest.cpp >&5 ./configure: line 1801: g++: command not found It looks like your VM has a minimal setup that doesn't include g++. Installing it should solve the problem. Luigi On Wed, May 4, 2022 at 10:23 AM Christofer Bogaso < bog...@gm...> wrote: > Hi, > > I am running ./configure within Home/QuantLib-1.26 folder. > > Attached is a snapshot of all files and folders within that folder. I > fail to see any file with name config.log. There is a folder called > config, but within that also the log is not present. Could you please > help me to identify the exact location? > > On Wed, May 4, 2022 at 1:28 PM Luigi Ballabio <lui...@gm...> > wrote: > > > > configure.ac is an input used to build configure itself. > > > > You need to look at config.log in the directory where you ran ./configure > > > > > > On Wed, May 4, 2022 at 6:50 AM Daniel Lobo <dan...@gm...> > wrote: > >> > >> Hi, > >> > >> I still get the same error message as below, > >> > >> $ ./configure --with-boost-include=usr/include/boost > >> --with-boost-lib=/usr/lib/x86_64-linux-gnu > >> checking for a BSD-compatible install... /usr/bin/install -c > >> checking whether build environment is sane... yes > >> checking for a race-free mkdir -p... /usr/bin/mkdir -p > >> checking for gawk... no > >> checking for mawk... mawk > >> checking whether make sets $(MAKE)... no > >> checking whether make supports nested variables... no > >> checking whether UID '1000' is supported by ustar format... yes > >> checking whether GID '1000' is supported by ustar format... yes > >> checking how to create a ustar tar archive... gnutar > >> checking for gawk... (cached) mawk > >> checking for gcc... gcc > >> checking whether the C compiler works... yes > >> checking for C compiler default output file name... a.out > >> checking for suffix of executables... > >> checking whether we are cross compiling... no > >> checking for suffix of object files... o > >> checking whether the compiler supports GNU C... yes > >> checking whether gcc accepts -g... yes > >> checking for gcc option to enable C11 features... none needed > >> checking whether gcc understands -c and -o together... yes > >> checking whether make supports the include directive... no > >> checking dependency style of gcc... none > >> checking for g++... no > >> checking for c++... no > >> checking for gpp... no > >> checking for aCC... no > >> checking for CC... no > >> checking for cxx... no > >> checking for cc++... no > >> checking for cl.exe... no > >> checking for FCC... no > >> checking for KCC... no > >> checking for RCC... no > >> checking for xlC_r... no > >> checking for xlC... no > >> checking for clang++... no > >> checking whether the compiler supports GNU C++... no > >> checking whether g++ accepts -g... no > >> checking for g++ option to enable C++11 features... none needed > >> checking dependency style of g++... none > >> checking how to run the C preprocessor... gcc -E > >> checking build system type... x86_64-pc-linux-gnu > >> checking host system type... x86_64-pc-linux-gnu > >> checking how to print strings... printf > >> checking for a sed that does not truncate output... /usr/bin/sed > >> checking for grep that handles long lines and -e... /usr/bin/grep > >> checking for egrep... /usr/bin/grep -E > >> checking for fgrep... /usr/bin/grep -F > >> checking for ld used by gcc... /usr/bin/ld > >> checking if the linker (/usr/bin/ld) is GNU ld... yes > >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > >> checking the name lister (/usr/bin/nm -B) interface... BSD nm > >> checking whether ln -s works... yes > >> checking the maximum length of command line arguments... 1572864 > >> checking how to convert x86_64-pc-linux-gnu file names to > >> x86_64-pc-linux-gnu format... func_convert_file_noop > >> checking how to convert x86_64-pc-linux-gnu file names to toolchain > >> format... func_convert_file_noop > >> checking for /usr/bin/ld option to reload object files... -r > >> checking for objdump... objdump > >> checking how to recognize dependent libraries... pass_all > >> checking for dlltool... no > >> checking how to associate runtime and link libraries... printf %s\n > >> checking for ar... ar > >> checking for archiver @FILE support... @ > >> checking for strip... strip > >> checking for ranlib... ranlib > >> checking command to parse /usr/bin/nm -B output from gcc object... ok > >> checking for sysroot... no > >> checking for a working dd... /usr/bin/dd > >> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 > >> checking for mt... mt > >> checking if mt is a manifest tool... no > >> checking for stdio.h... yes > >> checking for stdlib.h... yes > >> checking for string.h... yes > >> checking for inttypes.h... yes > >> checking for stdint.h... yes > >> checking for strings.h... yes > >> checking for sys/stat.h... yes > >> checking for sys/types.h... yes > >> checking for unistd.h... yes > >> checking for dlfcn.h... yes > >> checking for objdir... .libs > >> checking if gcc supports -fno-rtti -fno-exceptions... no > >> checking for gcc option to produce PIC... -fPIC -DPIC > >> checking if gcc PIC flag -fPIC -DPIC works... yes > >> checking if gcc static flag -static works... yes > >> checking if gcc supports -c -o file.o... yes > >> checking if gcc supports -c -o file.o... (cached) yes > >> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports > >> shared libraries... yes > >> checking whether -lc should be explicitly linked in... no > >> checking dynamic linker characteristics... GNU/Linux ld.so > >> checking how to hardcode library paths into programs... immediate > >> checking whether stripping libraries is possible... yes > >> checking if libtool supports shared libraries... yes > >> checking whether to build shared libraries... yes > >> checking whether to build static libraries... yes > >> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS > >> checking for Boost development files... no > >> configure: error: Boost development files not found > >> > >> Below is the outputs from configure file (configure.ac) > >> > >> # Process this file with autoconf to produce a configure script. > >> AC_INIT([QuantLib], [1.26], > >> [qua...@li...], > >> [QuantLib]) > >> AC_PREREQ(2.62) > >> AC_CONFIG_SRCDIR([ql/qldefines.hpp]) > >> AC_CONFIG_AUX_DIR([config]) > >> AC_CONFIG_HEADERS([ql/config.hpp]) > >> AM_INIT_AUTOMAKE([foreign nostdinc subdir-objects tar-ustar]) > >> AC_CONFIG_MACRO_DIR([m4]) > >> > >> AC_COPYRIGHT([ > >> Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl > >> Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 StatPro > Italia srl > >> Copyright (C) 2004, 2005 Ferdinando Ametrano > >> > >> This file is part of QuantLib, a free-software/open-source library > >> for financial quantitative analysts and developers - > http://quantlib.org/ > >> > >> QuantLib is free software: you can redistribute it and/or modify it > >> under the terms of the QuantLib license. You should have received a > >> copy of the license along with this program; if not, please email > >> <qua...@li...>. The license is also available online at > >> <http://quantlib.org/license.shtml>. > >> > >> This program is distributed in the hope that it will be useful, but > WITHOUT > >> ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > FITNESS > >> FOR A PARTICULAR PURPOSE. See the license for more details.]) > >> > >> AC_PROG_AWK > >> AC_PROG_INSTALL > >> > >> # Help the compiler find external software > >> > >> AC_ARG_WITH([boost-include], > >> AS_HELP_STRING([--with-boost-include=INCLUDE_PATH], > >> [Supply the location of Boost header files]), > >> [ql_boost_include_path="`cd ${withval} 2>/dev/null && > pwd`"], > >> [ql_boost_include_path=""]) > >> if test [ -n "$ql_boost_include_path" ] ; then > >> AC_SUBST([BOOST_INCLUDE],["-I${ql_boost_include_path}"]) > >> AC_SUBST([CPPFLAGS],["${CPPFLAGS} -I${ql_boost_include_path}"]) > >> fi > >> AC_ARG_WITH([boost-lib], > >> AS_HELP_STRING([--with-boost-lib=LIB_PATH], > >> [Supply the location of Boost libraries]), > >> [ql_boost_lib_path="`cd ${withval} 2>/dev/null && pwd`"], > >> [ql_boost_lib_path=""]) > >> if test [ -n "$ql_boost_lib_path" ] ; then > >> AC_SUBST([BOOST_LIB],["-L${ql_boost_lib_path}"]) > >> AC_SUBST([LDFLAGS],["${LDFLAGS} -L${ql_boost_lib_path}"]) > >> fi > >> > >> > >> # Continue setup > >> > >> AC_PROG_CC > >> AC_PROG_CXX > >> AC_PROG_CPP > >> LT_INIT > >> > >> AM_CONDITIONAL(ENABLE_STATIC, test "${enable_static}" == "yes") > >> > >> AC_LANG([C++]) > >> > >> AC_ARG_ENABLE([openmp], > >> AS_HELP_STRING([--enable-openmp], > >> [If enabled, configure will try to detect > >> and enable OpenMP support.]), > >> [ql_openmp=$enableval], > >> [ql_openmp=no]) > >> if test "$ql_openmp" = "yes" ; then > >> AC_OPENMP > >> AC_SUBST([CXXFLAGS],["${CXXFLAGS} ${OPENMP_CXXFLAGS}"]) > >> fi > >> > >> # Check for C++11 support > >> QL_CHECK_CPP11 > >> > >> # Check for Boost components > >> QL_CHECK_BOOST > >> AM_CONDITIONAL(BOOST_UNIT_TEST_FOUND, test "x${BOOST_UNIT_TEST_LIB}" != > "x") > >> > >> # Check for Emacs > >> AM_PATH_LISPDIR > >> AM_CONDITIONAL(EMACS_FOUND, test "${EMACS}" != "no") > >> > >> # Check for tools needed for building documentation > >> AC_PATH_PROG([DOXYGEN], [doxygen]) > >> AC_PATH_PROG([SED], [sed]) > >> AC_PATH_PROG([LATEX], [latex]) > >> AC_PATH_PROG([PDFLATEX], [pdflatex]) > >> AC_PATH_PROG([MAKEINDEX], [makeindex]) > >> AC_PATH_PROG([DVIPS], [dvips]) > >> > >> > >> # site configuration > >> > >> # AC_ARG_WITH([real], > >> # AS_HELP_STRING([--with-real=type], > >> # [The given type will be used for > floating-point > >> # calculations. > >> # In case this option is not invoked, double > >> # will be used.]), > >> # [AC_DEFINE_UNQUOTED([QL_REAL],[$withval], > >> # [Define this as the type to be used > for > >> # floating-point calculations.])], > >> # [AC_DEFINE_UNQUOTED([QL_REAL],[double], > >> # [Define this as the type to be used > for > >> # floating-point calculations.])]) > >> > >> # AC_ARG_WITH([integer], > >> # AS_HELP_STRING([--with-integer=type], > >> # [The given type will be used for integer > >> # calculations. At least an int is required. > >> # In case this option is not invoked, int > >> # will be used.]), > >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[$withval], > >> # [Define this as the type to be used > for > >> # integer calculations. At least an int > >> # is required.])], > >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[int], > >> # [Define this as the type to be used > for > >> # integer calculations. At least an int > >> # is required.])]) > >> > >> # AC_ARG_WITH([big-integer], > >> # AS_HELP_STRING([--with-big-integer=type], > >> # [The given type will be used for large > integer > >> # calculations. At least 4 bytes are > required. > >> # In case this option is not invoked, long > >> # will be used.]), > >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[$withval], > >> # [Define this as the type to be used > for > >> # large integer calculations. At least > >> # 4 bytes are required.])], > >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[long], > >> # [Define this as the type to be used > for > >> # large integer calculations. At least > >> # 4 bytes are required.])]) > >> > >> > >> AC_ARG_ENABLE([error-lines], > >> AS_HELP_STRING([--enable-error-lines], > >> [If enabled, file and line information is > >> added to the error messages thrown by > >> the library.]), > >> [ql_error_lines=$enableval], > >> [ql_error_lines=no]) > >> AC_MSG_CHECKING([whether to add file and line information to errors]) > >> if test "$ql_error_lines" = "yes" ; then > >> AC_DEFINE([QL_ERROR_LINES],[1], > >> [Define this if error messages should include file and line > >> information.]) > >> fi > >> AC_MSG_RESULT([$ql_error_lines]) > >> > >> AC_ARG_ENABLE([error-functions], > >> AS_HELP_STRING([--enable-error-functions], > >> [If enabled, current function information > >> is added to the error messages thrown by > >> the library.]), > >> [ql_error_functions=$enableval], > >> [ql_error_functions=no]) > >> AC_MSG_CHECKING([whether to add function information to errors]) > >> if test "$ql_error_functions" = "yes" ; then > >> AC_DEFINE([QL_ERROR_FUNCTIONS],[1], > >> [Define this if error messages should include current > function > >> information.]) > >> fi > >> AC_MSG_RESULT([$ql_error_functions]) > >> > >> AC_ARG_ENABLE([tracing], > >> AS_HELP_STRING([--enable-tracing], > >> [If enabled, tracing messages might be > emitted > >> by the library depending on run-time > >> settings. Enabling this option can degrade > >> performance.]), > >> [ql_tracing=$enableval], > >> [ql_tracing=no]) > >> AC_MSG_CHECKING([whether to enable tracing]) > >> if test "$ql_tracing" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_TRACING],[1], > >> [Define this if tracing messages should allowed (whether > they > >> are actually emitted will depend on run-time settings.)]) > >> fi > >> AC_MSG_RESULT([$ql_tracing]) > >> > >> AC_MSG_CHECKING([whether to enable indexed coupons]) > >> AC_ARG_ENABLE([indexed-coupons], > >> AS_HELP_STRING([--enable-indexed-coupons], > >> [If enabled, indexed coupons (see the > >> documentation) are used in floating legs. > >> If disabled (the default), par coupons > >> are used.]), > >> [ql_indexed_coupon=$enableval], > >> [ql_indexed_coupon=no]) > >> if test "$ql_indexed_coupon" = "yes" ; then > >> AC_DEFINE([QL_USE_INDEXED_COUPON],[1], > >> [Define this to use indexed coupons instead of par coupons > in > >> floating legs.]) > >> fi > >> AC_MSG_RESULT([$ql_indexed_coupon]) > >> > >> AC_MSG_CHECKING([whether to enable extra safety checks]) > >> AC_ARG_ENABLE([extra-safety-checks], > >> AS_HELP_STRING([--enable-extra-safety-checks], > >> [If enabled, extra run-time checks are > added > >> to a few functions. This can prevent their > >> inlining and degrade performance.]), > >> [ql_belt_and_braces=$enableval], > >> [ql_belt_and_braces=no]) > >> if test "$ql_belt_and_braces" = "yes" ; then > >> AC_DEFINE([QL_EXTRA_SAFETY_CHECKS],[1], > >> [Define this if extra safety checks should be performed. > >> This can degrade performance.]) > >> fi > >> AC_MSG_RESULT([$ql_belt_and_braces]) > >> > >> AC_MSG_CHECKING([whether to enable sessions]) > >> AC_ARG_ENABLE([sessions], > >> AS_HELP_STRING([--enable-sessions], > >> [If enabled, singletons will return > different > >> instances for different sessions. You will > >> have to provide and link with the library > >> a sessionId() function in namespace > QuantLib, > >> returning a different session id for each > >> session. This also implies thread-safe > >> Singleton initialization.]), > >> [ql_use_sessions=$enableval], > >> [ql_use_sessions=no]) > >> if test "$ql_use_sessions" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_SESSIONS],[1], > >> [Define this if you want to enable sessions.]) > >> fi > >> AC_MSG_RESULT([$ql_use_sessions]) > >> > >> AC_MSG_CHECKING([whether to enable thread-safe observer pattern]) > >> AC_ARG_ENABLE([thread-safe-observer-pattern], > >> AS_HELP_STRING([--enable-thread-safe-observer-pattern], > >> [If enabled, thread-safe version of the > >> observer pattern will be used. You should > >> enable it if you want to use QuantLib > >> via the SWIG layer within the JVM or .NET > >> eco system or any environment with an > >> async garbage collector. C++-17 is > required > >> if this option is used together with > >> --enable-std-pointers]), > >> [ql_use_tsop=$enableval], > >> [ql_use_tsop=no]) > >> AC_MSG_RESULT([$ql_use_tsop]) > >> if test "$ql_use_tsop" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN],[1], > >> [Define this if you want to enable > >> thread-safe observer pattern.]) > >> fi > >> > >> AC_MSG_CHECKING([whether to enable thread-safe singleton > initialization]) > >> AC_ARG_ENABLE([thread-safe-singleton-init], > >> AS_HELP_STRING([--enable-thread-safe-singleton-init], > >> [If enabled, singleton initialization will > >> be thread-safe. This requires Boost 1.58 > >> or later. Note that --enable-sessions > >> implies thread-safe initialization, > >> whether this is defined or not]), > >> [ql_use_safe_singleton_init=$enableval], > >> [ql_use_safe_singleton_init=no]) > >> if test "$ql_use_safe_singleton_init" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_SINGLETON_THREAD_SAFE_INIT],[1], > >> [Define this if you want thread-safe singleton > initialization.]) > >> fi > >> AC_MSG_RESULT([$ql_use_safe_singleton_init]) > >> > >> if test "$ql_use_sessions" = "yes" || test "$ql_use_tsop" = "yes" || > >> test "$ql_use_safe_singleton_init" = "yes"; then > >> QL_CHECK_BOOST_VERSION_1_58_OR_HIGHER > >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM > >> else > >> AC_SUBST([BOOST_THREAD_LIB],[""]) > >> fi > >> > >> AC_MSG_CHECKING([whether to enable parallel unit test runner]) > >> AC_ARG_ENABLE([parallel-unit-test-runner], > >> AS_HELP_STRING([--enable-parallel-unit-test-runner], > >> [If enabled, a parallel unit test runner > is used > >> to execute the C++ test suite. This will > reduce > >> the runtime on multi core CPUs.]), > >> [ql_use_parallel_test=$enableval], > >> [ql_use_parallel_test=no]) > >> AC_MSG_RESULT([$ql_use_parallel_test]) > >> if test "$ql_use_parallel_test" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER],[1], > >> [Define this if you want to enable > >> the parallel unit test runner.]) > >> QL_CHECK_BOOST_VERSION_1_59_OR_HIGHER > >> if test "$ql_use_tsop" != "yes" ; then > >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM > >> fi > >> QL_CHECK_BOOST_TEST_INTERPROCESS > >> else > >> AC_SUBST([BOOST_INTERPROCESS_LIB],[""]) > >> fi > >> > >> AC_MSG_CHECKING([whether to install examples]) > >> AC_ARG_ENABLE([examples], > >> AS_HELP_STRING([--enable-examples], > >> [If enabled, examples are built and > installed > >> when "make" and "make install" are > invoked. > >> If disabled (the default) they are built > >> but not installed.]), > >> [ql_install_examples=$enableval], > >> [ql_install_examples=no]) > >> AM_CONDITIONAL(AUTO_EXAMPLES, test "$ql_install_examples" != "no") > >> AC_MSG_RESULT([$ql_install_examples]) > >> > >> AC_MSG_CHECKING([whether to install the benchmark]) > >> AC_ARG_ENABLE([benchmark], > >> AS_HELP_STRING([--enable-benchmark], > >> [If enabled, the benchmark is built and > >> installed when "make" and "make install" > >> are invoked. If disabled (the default) > >> it is built but not installed.]), > >> [ql_install_benchmark=$enableval], > >> [ql_install_benchmark=no]) > >> AM_CONDITIONAL(AUTO_BENCHMARK, test "$ql_install_benchmark" != "no") > >> AC_MSG_RESULT([$ql_install_benchmark]) > >> > >> AC_MSG_CHECKING([whether to use unity build]) > >> AC_ARG_ENABLE([unity-build], > >> AS_HELP_STRING([--enable-unity-build], > >> [If enabled, the source files in each > directory > >> are collected into one single source file > and > >> compiled together. This can speed up the > >> compilation of the library. > >> If disabled (the default) each source > file is > >> compiled separately..]), > >> [ql_use_unity_build=$enableval], > >> [ql_use_unity_build=no]) > >> AM_CONDITIONAL(UNITY_BUILD, test "$ql_use_unity_build" != "no") > >> AC_MSG_RESULT([$ql_use_unity_build]) > >> > >> AC_MSG_CHECKING([whether to enable intraday date and daycounters]) > >> AC_ARG_ENABLE([intraday], > >> AS_HELP_STRING([--enable-intraday], > >> [If enabled, date objects will support an > intraday > >> datetime resolution down to microseconds. > >> Strickly monotone daycounters (Actual360, > >> Actual365Fixed and ActualActual) will take > >> the additional information into account > >> and allow for accurate intraday pricing. > >> If disabled (the default) the smallest > >> resolution of date objects will be a > single day. > >> Intraday datetime resolution is > experimental.]), > >> [ql_use_intraday=$enableval], > >> [ql_use_intraday=no]) > >> if test "$ql_use_intraday" = "yes" ; then > >> AC_DEFINE([QL_HIGH_RESOLUTION_DATE],[1], > >> [Define this if you want to enable high resolution date > class.]) > >> fi > >> AC_MSG_RESULT([$ql_use_intraday]) > >> > >> AC_MSG_CHECKING([whether to enable standard smart pointers]) > >> AC_ARG_ENABLE([std-pointers], > >> AS_HELP_STRING([--enable-std-pointers], > >> [If enabled, std::shared_ptr and related > >> classes and functions will be used instead > >> of boost::shared_ptr. > >> If disabled (the default) the Boost > facilities > >> are used. > >> Note that std::shared_ptr does not check > >> access and can cause segmentation > faults.]), > >> [ql_use_std_pointers=$enableval], > >> [ql_use_std_pointers=no]) > >> if test "$ql_use_std_pointers" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], > >> [Define this if you want to use standard smart pointers.]) > >> fi > >> AC_MSG_RESULT([$ql_use_std_pointers]) > >> > >> AC_MSG_CHECKING([whether to enable std::unique_ptr instead of > std::auto_ptr]) > >> AC_ARG_ENABLE([std-unique-ptr], > >> AS_HELP_STRING([--enable-std-unique-ptr], > >> [If enabled (the default), std::unique_ptr > will > >> be used instead of the deprecated > std::auto_ptr. > >> If disabled, std::auto_ptr will still be > used.]), > >> [ql_use_unique_ptr=$enableval], > >> [ql_use_unique_ptr=yes]) > >> if test "$ql_use_unique_ptr" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], > >> [Define this if you want to replace std::auto_ptr with > >> std::unique_ptr.]) > >> fi > >> AC_MSG_RESULT([$ql_use_unique_ptr]) > >> > >> AC_MSG_CHECKING([whether to enable std::function]) > >> AC_ARG_ENABLE([std-function], > >> AS_HELP_STRING([--enable-std-function], > >> [If enabled, std::function and std::bind > will be > >> used instead of boost::function and > boost::bind. > >> If disabled (the default) the Boost > facilities > >> are used.]), > >> [ql_use_std_function=$enableval], > >> [ql_use_std_function=no]) > >> if test "$ql_use_std_function" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_FUNCTION],[1], > >> [Define this if you want to use std::function and > std::bind.]) > >> fi > >> AC_MSG_RESULT([$ql_use_std_function]) > >> > >> > >> AC_MSG_CHECKING([whether to enable std::tuple]) > >> AC_ARG_ENABLE([std-tuple], > >> AS_HELP_STRING([--enable-std-tuple], > >> [If enabled, std::tuple and related > functions > >> will be used instead of boost::tuple. > >> If disabled (the default) the Boost > facilities > >> are used.]), > >> [ql_use_std_tuple=$enableval], > >> [ql_use_std_tuple=no]) > >> if test "$ql_use_std_tuple" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_TUPLE],[1], > >> [Define this if you want to use std::tuple.]) > >> fi > >> AC_MSG_RESULT([$ql_use_std_pointers]) > >> > >> AC_MSG_CHECKING([whether to enable available std classes]) > >> AC_ARG_ENABLE([std-classes], > >> AS_HELP_STRING([--enable-std-classes], > >> [This is a shortcut for > --enable-std-pointers > >> --enable-std-unique-ptr > --enable-std-function > >> --enable-std-tuple. > >> If enabled, this supersedes any --disable > >> option passed for the above.]), > >> [ql_use_std_classes=$enableval], > >> [ql_use_std_classes=no]) > >> if test "$ql_use_std_classes" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], > >> [Define this if you want to use standard smart pointers.]) > >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], > >> [Define this if you want to replace std::auto_ptr with > >> std::unique_ptr.]) > >> AC_DEFINE([QL_USE_STD_FUNCTION],[1], > >> [Define this if you want to use std::function and > std::bind.]) > >> AC_DEFINE([QL_USE_STD_TUPLE],[1], > >> [Define this if you want to use std::tuple.]) > >> fi > >> AC_MSG_RESULT([$ql_use_std_classes]) > >> > >> > >> AC_MSG_CHECKING([whether to enable the Disposable class template]) > >> AC_ARG_ENABLE([disposable], > >> AS_HELP_STRING([--enable-disposable], > >> [If enabled, the Disposable class > >> template will be used; > >> this should be no longer necessary in > C++11 > >> and might interfere with compiler > optimizations. > >> If disabled (the default) the class will > only > >> be an alias for the underlying type.]), > >> [ql_use_disposable=$enableval], > >> [ql_use_disposable=no]) > >> if test "$ql_use_disposable" = "yes" ; then > >> AC_DEFINE([QL_USE_DISPOSABLE],[1], > >> [Define this if you want to use the Disposable class > template.]) > >> fi > >> AC_MSG_RESULT([$ql_use_disposable]) > >> > >> > >> # manual configurations for specific hosts > >> case $host in > >> powerpc-apple-darwin*) > >> AC_DEFINE([QL_PATCH_DARWIN],[1], > >> [Define if running on a Mac OS X machine.]) > >> ;; > >> sparc-sun-solaris*) > >> AC_DEFINE([QL_PATCH_SOLARIS],[1], > >> [Define if running on a Sun Solaris machine.]) > >> ;; > >> esac > >> > >> > >> # done, output the configured files > >> AC_CONFIG_FILES([ > >> Makefile > >> ql/Makefile > >> ql/cashflows/Makefile > >> ql/currencies/Makefile > >> ql/experimental/Makefile > >> ql/experimental/amortizingbonds/Makefile > >> ql/experimental/asian/Makefile > >> ql/experimental/averageois/Makefile > >> ql/experimental/barrieroption/Makefile > >> ql/experimental/basismodels/Makefile > >> ql/experimental/callablebonds/Makefile > >> ql/experimental/catbonds/Makefile > >> ql/experimental/commodities/Makefile > >> ql/experimental/coupons/Makefile > >> ql/experimental/credit/Makefile > >> ql/experimental/exoticoptions/Makefile > >> ql/experimental/finitedifferences/Makefile > >> ql/experimental/forward/Makefile > >> ql/experimental/fx/Makefile > >> ql/experimental/inflation/Makefile > >> ql/experimental/lattices/Makefile > >> ql/experimental/math/Makefile > >> ql/experimental/mcbasket/Makefile > >> ql/experimental/models/Makefile > >> ql/experimental/processes/Makefile > >> ql/experimental/risk/Makefile > >> ql/experimental/shortrate/Makefile > >> ql/experimental/swaptions/Makefile > >> ql/experimental/termstructures/Makefile > >> ql/experimental/variancegamma/Makefile > >> ql/experimental/varianceoption/Makefile > >> ql/experimental/volatility/Makefile > >> ql/indexes/Makefile > >> ql/indexes/ibor/Makefile > >> ql/indexes/inflation/Makefile > >> ql/indexes/swap/Makefile > >> ql/instruments/Makefile > >> ql/instruments/bonds/Makefile > >> ql/legacy/Makefile > >> ql/legacy/libormarketmodels/Makefile > >> ql/math/Makefile > >> ql/math/copulas/Makefile > >> ql/math/distributions/Makefile > >> ql/math/integrals/Makefile > >> ql/math/interpolations/Makefile > >> ql/math/matrixutilities/Makefile > >> ql/math/ode/Makefile > >> ql/math/optimization/Makefile > >> ql/math/randomnumbers/Makefile > >> ql/math/solvers1d/Makefile > >> ql/math/statistics/Makefile > >> ql/methods/Makefile > >> ql/methods/finitedifferences/Makefile > >> ql/methods/finitedifferences/meshers/Makefile > >> ql/methods/finitedifferences/operators/Makefile > >> ql/methods/finitedifferences/schemes/Makefile > >> ql/methods/finitedifferences/solvers/Makefile > >> ql/methods/finitedifferences/stepconditions/Makefile > >> ql/methods/finitedifferences/utilities/Makefile > >> ql/methods/lattices/Makefile > >> ql/methods/montecarlo/Makefile > >> ql/models/Makefile > >> ql/models/equity/Makefile > >> ql/models/marketmodels/Makefile > >> ql/models/marketmodels/browniangenerators/Makefile > >> ql/models/marketmodels/callability/Makefile > >> ql/models/marketmodels/correlations/Makefile > >> ql/models/marketmodels/curvestates/Makefile > >> ql/models/marketmodels/driftcomputation/Makefile > >> ql/models/marketmodels/evolvers/Makefile > >> ql/models/marketmodels/evolvers/volprocesses/Makefile > >> ql/models/marketmodels/models/Makefile > >> ql/models/marketmodels/pathwisegreeks/Makefile > >> ql/models/marketmodels/products/Makefile > >> ql/models/marketmodels/products/onestep/Makefile > >> ql/models/marketmodels/products/multistep/Makefile > >> ql/models/marketmodels/products/pathwise/Makefile > >> ql/models/shortrate/Makefile > >> ql/models/shortrate/calibrationhelpers/Makefile > >> ql/models/shortrate/onefactormodels/Makefile > >> ql/models/shortrate/twofactormodels/Makefile > >> ql/models/volatility/Makefile > >> ql/patterns/Makefile > >> ql/pricingengines/Makefile > >> ql/pricingengines/asian/Makefile > >> ql/pricingengines/barrier/Makefile > >> ql/pricingengines/basket/Makefile > >> ql/pricingengines/bond/Makefile > >> ql/pricingengines/capfloor/Makefile > >> ql/pricingengines/cliquet/Makefile > >> ql/pricingengines/credit/Makefile > >> ql/pricingengines/forward/Makefile > >> ql/pricingengines/inflation/Makefile > >> ql/pricingengines/lookback/Makefile > >> ql/pricingengines/quanto/Makefile > >> ql/pricingengines/swap/Makefile > >> ql/pricingengines/swaption/Makefile > >> ql/pricingengines/vanilla/Makefile > >> ql/processes/Makefile > >> ql/quotes/Makefile > >> ql/termstructures/Makefile > >> ql/termstructures/credit/Makefile > >> ql/termstructures/inflation/Makefile > >> ql/termstructures/volatility/Makefile > >> ql/termstructures/volatility/equityfx/Makefile > >> ql/termstructures/volatility/capfloor/Makefile > >> ql/termstructures/volatility/inflation/Makefile > >> ql/termstructures/volatility/optionlet/Makefile > >> ql/termstructures/volatility/swaption/Makefile > >> ql/termstructures/yield/Makefile > >> ql/time/Makefile > >> ql/time/calendars/Makefile > >> ql/time/daycounters/Makefile > >> ql/utilities/Makefile > >> man/Makefile > >> m4/Makefile > >> Docs/Makefile > >> Examples/Makefile > >> test-suite/Makefile]) > >> AC_CONFIG_FILES([quantlib-config],[chmod +x quantlib-config]) > >> AC_CONFIG_FILES([QuantLib.spec]) > >> AC_CONFIG_FILES([quantlib.pc]) > >> AC_OUTPUT > >> > >> On Tue, 3 May 2022 at 16:43, Conrad Cole <con...@gm...> > wrote: > >> > > >> > ./configure --with-boost-include=usr/include/boost > >> > --with-boost-lib=/usr/lib/x86_64-linux-gnu > >> > > >> > The config.log file should be in whatever directory you ran the > >> > configure script. > >> > > >> > On 5/3/22 06:55, Daniel Lobo wrote: > >> > > Also, given that my boost location is /usr/include/boost, how can I > >> > > execute ./configure again with the boost lib and include flags using > >> > > the proper directories? What will be the right code? > >> > > > >> > > Thanks, > >> > > > >> > > On Tue, 3 May 2022 at 15:54, Daniel Lobo <dan...@gm...> > wrote: > >> > >> Many thanks for your responses. > >> > >> > >> > >> whereis boost returns below location, > >> > >> > >> > >> $ whereis boost > >> > >> boost: /usr/include/boost > >> > >> > >> > >> Where can I see the generated config.log file? > >> > >> > >> > >> Thanks for your time. > >> > >> > >> > >> > >> > >> On Tue, 3 May 2022 at 03:29, Conrad Cole <con...@gm...> > wrote: > >> > >>> whereis boost is the command to find the location of the > installed boost header files. > >> > >>> > >> > >>> On 5/2/22 17:08, Luigi Ballabio wrote: > >> > >>> > >> > >>> Can you look inside the generated config.log file and see what > compiler error you're getting exactly? > >> > >>> > >> > >>> Luigi > >> > >>> > >> > >>> > >> > >>> On Mon, May 2, 2022 at 7:49 PM Daniel Lobo < > dan...@gm...> wrote: > >> > >>>> Many thanks. > >> > >>>> > >> > >>>> I ran below codes to remove and reinstall boost > >> > >>>> > >> > >>>> sudo apt-get remove libboost-all-dev > >> > >>>> sudo apt-get install libboost-all-dev > >> > >>>> > >> > >>>> boost installed in /usr/include > >> > >>>> > >> > >>>> :/usr/include$ ls > >> > >>>> aio.h complex.h error.h features-time64.h > getopt.h > >> > >>>> langinfo.h math.h netdb.h numa.h > >> > >>>> python3.10 setjmp.h string.h time.h video > >> > >>>> aliases.h cpio.h evdns.h fenv.h > glob.h > >> > >>>> lastlog.h mcheck.h neteconet numaif.h > rdma > >> > >>>> sgtty.h strings.h tirpc wait.h > >> > >>>> alloca.h crypt.h event2 finclude > >> > >>>> gnu-versions.h libgen.h memory.h netinet obstack.h > >> > >>>> re_comp.h shadow.h sudo_plugin.h ttyent.h wchar.h > >> > >>>> argp.h ctype.h event.h fmtmsg.h > grp.h > >> > >>>> libintl.h misc netipx openvpn > regex.h > >> > >>>> signal.h syscall.h uchar.h wctype.h > >> > >>>> argz.h dirent.h evhttp.h fnmatch.h > gshadow.h > >> > >>>> libltdl mntent.h netiucv paths.h > regexp.h > >> > >>>> sound sysexits.h ucontext.h wordexp.h > >> > >>>> ar.h dlfcn.h evrpc.h fstab.h > hwloc > >> > >>>> libnl3 monetary.h netpacket poll.h > resolv.h > >> > >>>> spawn.h syslog.h ulimit.h X11 > >> > >>>> arpa drm evutil.h fts.h > hwloc.h > >> > >>>> limits.h mqueue.h netrom printf.h rpc > >> > >>>> stab.h tar.h unicode x86_64-linux-gnu > >> > >>>> asm-generic elf.h execinfo.h ftw.h > iconv.h > >> > >>>> link.h mtd netrose proc_service.h > rpcsvc > >> > >>>> stdc-predef.h termio.h unistd.h xen > >> > >>>> assert.h endian.h expat_external.h gcalc-2 > ifaddrs.h > >> > >>>> linux net nfs protocols > sched.h > >> > >>>> stdint.h termios.h utime.h xorg > >> > >>>> boost > >> > >>>> > >> > >>>> But still get error when I run ./configure > >> > >>>> > >> > >>>> Below is the log that I get > >> > >>>> > >> > >>>> $ ./configure > >> > >>>> checking for a BSD-compatible install... /usr/bin/install -c > >> > >>>> checking whether build environment is sane... yes > >> > >>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p > >> > >>>> checking for gawk... no > >> > >>>> checking for mawk... mawk > >> > >>>> checking whether make sets $(MAKE)... no > >> > >>>> checking whether make supports nested variables... no > >> > >>>> checking whether UID '1000' is supported by ustar format... yes > >> > >>>> checking whether GID '1000' is supported by ustar format... yes > >> > >>>> checking how to create a ustar tar archive... gnutar > >> > >>>> checking for gawk... (cached) mawk > >> > >>>> checking for gcc... gcc > >> > >>>> checking whether the C compiler works... yes > >> > >>>> checking for C compiler default output file name... a.out > >> > >>>> checking for suffix of executables... > >> > >>>> checking whether we are cross compiling... no > >> > >>>> checking for suffix of object files... o > >> > >>>> checking whether the compiler supports GNU C... yes > >> > >>>> checking whether gcc accepts -g... yes > >> > >>>> checking for gcc option to enable C11 features... none needed > >> > >>>> checking whether gcc understands -c and -o together... yes > >> > >>>> checking whether make supports the include directive... no > >> > >>>> checking dependency style of gcc... none > >> > >>>> checking for g++... no > >> > >>>> checking for c++... no > >> > >>>> checking for gpp... no > >> > >>>> checking for aCC... no > >> > >>>> checking for CC... no > >> > >>>> checking for cxx... no > >> > >>>> checking for cc++... no > >> > >>>> checking for cl.exe... no > >> > >>>> checking for FCC... no > >> > >>>> checking for KCC... no > >> > >>>> checking for RCC... no > >> > >>>> checking for xlC_r... no > >> > >>>> checking for xlC... no > >> > >>>> checking for clang++... no > >> > >>>> checking whether the compiler supports GNU C++... no > >> > >>>> checking whether g++ accepts -g... no > >> > >>>> checking for g++ option to enable C++11 features... none needed > >> > >>>> checking dependency style of g++... none > >> > >>>> checking how to run the C preprocessor... gcc -E > >> > >>>> checking build system type... x86_64-pc-linux-gnu > >> > >>>> checking host system type... x86_64-pc-linux-gnu > >> > >>>> checking how to print strings... printf > >> > >>>> checking for a sed that does not truncate output... /usr/bin/sed > >> > >>>> checking for grep that handles long lines and -e... /usr/bin/grep > >> > >>>> checking for egrep... /usr/bin/grep -E > >> > >>>> checking for fgrep... /usr/bin/grep -F > >> > >>>> checking for ld used by gcc... /usr/bin/ld > >> > >>>> checking if the linker (/usr/bin/ld) is GNU ld... yes > >> > >>>> checking for BSD- or MS-compatible name lister (nm)... > /usr/bin/nm -B > >> > >>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm > >> > >>>> checking whether ln -s works... yes > >> > >>>> checking the maximum length of command line arguments... 1572864 > >> > >>>> checking how to convert x86_64-pc-linux-gnu file names to > >> > >>>> x86_64-pc-linux-gnu format... func_convert_file_noop > >> > >>>> checking how to convert x86_64-pc-linux-gnu file names to > toolchain > >> > >>>> format... func_convert_file_noop > >> > >>>> checking for /usr/bin/ld option to reload object files... -r > >> > >>>> checking for objdump... objdump > >> > >>>> checking how to recognize dependent libraries... pass_all > >> > >>>> checking for dlltool... no > >> > >>>> checking how to associate runtime and link libraries... printf > %s\n > >> > >>>> checking for ar... ar > >> > >>>> checking for archiver @FILE support... @ > >> > >>>> checking for strip... strip > >> > >>>> checking for ranlib... ranlib > >> > >>>> checking command to parse /usr/bin/nm -B output from gcc > object... ok > >> > >>>> checking for sysroot... no > >> > >>>> checking for a working dd... /usr/bin/dd > >> > >>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 > count=1 > >> > >>>> checking for mt... mt > >> > >>>> checking if mt is a manifest tool... no > >> > >>>> checking for stdio.h... yes > >> > >>>> checking for stdlib.h... yes > >> > >>>> checking for string.h... yes > >> > >>>> checking for inttypes.h... yes > >> > >>>> checking for stdint.h... yes > >> > >>>> checking for strings.h... yes > >> > >>>> checking for sys/stat.h... yes > >> > >>>> checking for sys/types.h... yes > >> > >>>> checking for unistd.h... yes > >> > >>>> checking for dlfcn.h... yes > >> > >>>> checking for objdir... .libs > >> > >>>> checking if gcc supports -fno-rtti -fno-exceptions... no > >> > >>>> checking for gcc option to produce PIC... -fPIC -DPIC > >> > >>>> checking if gcc PIC flag -fPIC -DPIC works... yes > >> > >>>> checking if gcc static flag -static works... yes > >> > >>>> checking if gcc supports -c -o file.o... yes > >> > >>>> checking if gcc supports -c -o file.o... (cached) yes > >> > >>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) > supports > >> > >>>> shared libraries... yes > >> > >>>> checking whether -lc should be explicitly linked in... no > >> > >>>> checking dynamic linker characteristics... GNU/Linux ld.so > >> > >>>> checking how to hardcode library paths into programs... immediate > >> > >>>> checking whether stripping libraries is possible... yes > >> > >>>> checking if libtool supports shared libraries... yes > >> > >>>> checking whether to build shared libraries... yes > >> > >>>> checking whether to build static libraries... yes > >> > >>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS > >> > >>>> checking for Boost development files... no > >> > >>>> configure: error: Boost development files not found > >> > >>>> > >> > >>>> > >> > >>>> Any pointer how to resolve this will be very helpful. > >> > >>>> > >> > >>>> Thanks > >> > >>>> > >> > >>>> On Sun, 1 May 2022 at 13:16, Jonathan Sweemer <sw...@gm...> > wrote: > >> > >>>>> Hi Daniel, > >> > >>>>> > >> > >>>>> Just to confirm, you’re no longer running ./configure with the > —with-boost-include and —with-boost-lib flags right? > >> > >>>>> > >> > >>>>> If so then I would expect the configure script to find your > boost installation. Please check that you see boost headers in > /usr/include/boost and if not, try reinstalling boost. > >> > >>>>> > >> > >>>>> If you’re still unable to get ./configure to find boost then > please attach the full output including all the commands that you ran. > >> > >>>>> > >> > >>>>> Jonathan > >> > >>>>> > >> > >>>>> > >> > >>>>> 2022년 5월 1일 (일) 15:41, Daniel Lobo <dan...@gm...>님이 > 작성: > >> > >>>>>> Hi, > >> > >>>>>> > >> > >>>>>> Many thanks for your response. > >> > >>>>>> > >> > >>>>>> Yes I ran 'sudo apt-get install libboost-all-dev' to install > boost. > >> > >>>>>> However still I get this error. > >> > >>>>>> > >> > >>>>>> How can I find where the boost is installed and how can I pass > that > >> > >>>>>> information './configure ' line? > >> > >>>>>> > >> > >>>>>> Apologies for trivial question if any, as I am not very expert > in > >> > >>>>>> Linux ecosystem. > >> > >>>>>> > >> > >>>>>> Thanks and regards, > >> > >>>>>> > >> > >>>>>> On Sun, 1 May 2022 at 11:53, Jonathan Sweemer < > sw...@gm...> wrote: > >> > >>>>>>> Hi Daniel, > >> > >>>>>>> > >> > >>>>>>> When you say that you “install[ed] boost already as provided > in the instruction page” do you mean that you ran the following command? > >> > >>>>>>> > >> > >>>>>>> sudo apt-get install libboost-all-dev > >> > >>>>>>> > >> > >>>>>>> If so then you shouldn’t need to use the —with-boost-include > and —with-boost-lib flags when configuring QuantLib. As the install guide > mentions, you only need those flags when you install boost in a > non-standard location. > >> > >>>>>>> > >> > >>>>>>> Jonathan > >> > >>>>>>> > >> > >>>>>>> > >> > >>>>>>> 2022년 5월 1일 (일) 02:25, Daniel Lobo <dan...@gm...>님이 > 작성: > >> > >>>>>>>> Hi, > >> > >>>>>>>> > >> > >>>>>>>> I am trying to install Quantlib in my Ubuntu VM. I was > following the > >> > >>>>>>>> instructions as provided in > >> > >>>>>>>> https://www.quantlib.org/install/linux.shtml > >> > >>>>>>>> > >> > >>>>>>>> But this installation failed when I executed > >> > >>>>>>>> > >> > >>>>>>>> ./configure --with-boost-include=/home/foo/include > >> > >>>>>>>> --with-boost-lib=/home/foo/lib > >> > >>>>>>>> > >> > >>>>>>>> > >> > >>>>>>>> > >> > >>>>>>>> The error I got is > >> > >>>>>>>> > >> > >>>>>>>> $ ./configure --with-boost-include=/home/foo/include > >> > >>>>>>>> --with-boost-lib=/home/foo/lib > >> > >>>>>>>> checking for a BSD-compatible install... /usr/bin/install -c > >> > >>>>>>>> checking whether build environment is sane... yes > >> > >>>>>>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p > >> > >>>>>>>> checking for gawk... no > >> > >>>>>>>> checking for mawk... mawk > >> > >>>>>>>> checking whether make sets $(MAKE)... no > >> > >>>>>>>> checking whether make supports nested variables... no > >> > >>>>>>>> checking whether UID '1000' is supported by ustar format... > yes > >> > >>>>>>>> checking whether GID '1000' is supported by ustar format... > yes > >> > >>>>>>>> checking how to create a ustar tar archive... gnutar > >> > >>>>>>>> checking for gawk... (cached) mawk > >> > >>>>>>>> checking for gcc... gcc > >> > >>>>>>>> checking whether the C compiler works... yes > >> > >>>>>>>> checking for C compiler default output file name... a.out > >> > >>>>>>>> checking for suffix of executables... > >> > >>>>>>>> checking whether we are cross compiling... no > >> > >>>>>>>> checking for suffix of object files... o > >> > >>>>>>>> checking whether the compiler supports GNU C... yes > >> > >>>>>>>> checking whether gcc accepts -g... yes > >> > >>>>>>>> checking for gcc option to enable C11 features... none needed > >> > >>>>>>>> checking whether gcc understands -c and -o together... yes > >> > >>>>>>>> checking whether make supports the include directive... no > >> > >>>>>>>> checking dependency style of gcc... none > >> > >>>>>>>> checking for g++... no > >> > >>>>>>>> checking for c++... no > >> > >>>>>>>> checking for gpp... no > >> > >>>>>>>> checking for aCC... no > >> > >>>>>>>> checking for CC... no > >> > >>>>>>>> checking for cxx... no > >> > >>>>>>>> checking for cc++... no > >> > >>>>>>>> checking for cl.exe... no > >> > >>>>>>>> checking for FCC... no > >> > >>>>>>>> checking for KCC... no > >> > >>>>>>>> checking for RCC... no > >> > >>>>>>>> checking for xlC_r... no > >> > >>>>>>>> checking for xlC... no > >> > >>>>>>>> checking for clang++... no > >> > >>>>>>>> checking whether the compiler supports GNU C++... no > >> > >>>>>>>> checking whether g++ accepts -g... no > >> > >>>>>>>> checking for g++ option to enable C++11 features... none > needed > >> > >>>>>>>> checking dependency style of g++... none > >> > >>>>>>>> checking how to run the C preprocessor... gcc -E > >> > >>>>>>>> checking build system type... x86_64-pc-linux-gnu > >> > >>>>>>>> checking host system type... x86_64-pc-linux-gnu > >> > >>>>>>>> checking how to print strings... printf > >> > >>>>>>>> checking for a sed that does not truncate output... > /usr/bin/sed > >> > >>>>>>>> checking for grep that handles long lines and -e... > /usr/bin/grep > >> > >>>>>>>> checking for egrep... /usr/bin/grep -E > >> > >>>>>>>> checking for fgrep... /usr/bin/grep -F > >> > >>>>>>>> checking for ld used by gcc... /usr/bin/ld > >> > >>>>>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes > >> > >>>>>>>> checking for BSD- or MS-compatible name lister (nm)... > /usr/bin/nm -B > >> > >>>>>>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm > >> > >>>>>>>> checking whether ln -s works... yes > >> > >>>>>>>> checking the maximum length of command line arguments... > 1572864 > >> > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to > >> > >>>>>>>> x86_64-pc-linux-gnu format... func_convert_file_noop > >> > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to > toolchain > >> > >>>>>>>> format... func_convert_file_noop > >> > >>>>>>>> checking for /usr/bin/ld option to reload object files... -r > >> > >>>>>>>> checking for objdump... objdump > >> > >>>>>>>> checking how to recognize dependent libraries... pass_all > >> > >>>>>>>> checking for dlltool... no > >> > >>>>>>>> checking how to associate runtime and link libraries... > printf %s\n > >> > >>>>>>>> checking for ar... ar > >> > >>>>>>>> checking for archiver @FILE support... @ > >> > >>>>>>>> checking for strip... strip > >> > >>>>>>>> checking for ranlib... ranlib > >> > >>>>>>>> checking command to parse /usr/bin/nm -B output from gcc > object... ok > >> > >>>>>>>> checking for sysroot... no > >> > >>>>>>>> checking for a working dd... /usr/bin/dd > >> > >>>>>>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 > count=1 > >> > >>>>>>>> checking for mt... mt > >> > >>>>>>>> checking if mt is a manifest tool... no > >> > >>>>>>>> checking for stdio.h... yes > >> > >>>>>>>> checking for stdlib.h... yes > >> > >>>>>>>> checking for string.h... yes > >> > >>>>>>>> checking for inttypes.h... yes > >> > >>>>>>>> checking for stdint.h... yes > >> > >>>>>>>> checking for strings.h... yes > >> > >>>>>>>> checking for sys/stat.h... yes > >> > >>>>>>>> checking for sys/types.h... yes > >> > >>>>>>>> checking for unistd.h... yes > >> > >>>>>>>> checking for dlfcn.h... yes > >> > >>>>>>>> checking for objdir... .libs > >> > >>>>>>>> checking if gcc supports -fno-rtti -fno-exceptions... no > >> > >>>>>>>> checking for gcc option to produce PIC... -fPIC -DPIC > >> > >>>>>>>> checking if gcc PIC flag -fPIC -DPIC works... yes > >> > >>>>>>>> checking if gcc static flag -static works... yes > >> > >>>>>>>> checking if gcc supports -c -o file.o... yes > >> > >>>>>>>> checking if gcc supports -c -o file.o... (cached) yes > >> > >>>>>>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) > supports > >> > >>>>>>>> shared libraries... yes > >> > >>>>>>>> checking whether -lc should be explicitly linked in... no > >> > >>>>>>>> checking dynamic linker characteristics... GNU/Linux ld.so > >> > >>>>>>>> checking how to hardcode library paths into programs... > immediate > >> > >>>>>>>> checking whether stripping libraries is possible... yes > >> > >>>>>>>> checking if libtool supports shared libraries... yes > >> > >>>>>>>> checking whether to build shared libraries... yes > >> > >>>>>>>> checking whether to build static libraries... yes > >> > >>>>>>>> checking for C++11 support... no: adding -std=c++11 to > CXXFLAGS > >> > >>>>>>>> checking for Boost development files... no > >> > >>>>>>>> configure: error: Boost development files not found > >> > >>>>>>>> > >> > >>>>>>>> Could you please help how to resolve this error. I executed > the code > >> > >>>>>>>> to install boost already as provided in the instruction page. > >> > >>>>>>>> > >> > >>>>>>>> > >> > >>>>>>>> _______________________________________________ > >> > >>>>>>>> QuantLib-users mailing list > >> > >>>>>>>> Qua...@li... > >> > >>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > >> > >>>> > >> > >>>> _______________________________________________ > >> > >>>> QuantLib-users mailing list > >> > >>>> Qua...@li... > >> > >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > >> > >>> > >> > >>> > >> > >>> _______________________________________________ > >> > >>> QuantLib-users mailing list > >> > >>> Qua...@li... > >> > >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > > _______________________________________________ > > QuantLib-users mailing list > > Qua...@li... > > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Christofer B. <bog...@gm...> - 2022-05-04 08:41:14
|
Hi, Please discard my earlier message. Please find below contents of the log file This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by QuantLib configure 1.26, which was generated by GNU Autoconf 2.71. Invocation command line was $ ./configure --with-boost-include=usr/include/boost ## --------- ## ## Platform. ## ## --------- ## hostname = xxx uname -m = x86_64 uname -r = 5.15.0-27-generic uname -s = Linux uname -v = #28-Ubuntu SMP Thu Apr 14 04:55:28 UTC 2022 /usr/bin/uname -p = x86_64 /bin/uname -X = unknown /bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown /usr/bin/hostinfo = unknown /bin/machine = unknown /usr/bin/oslevel = unknown /bin/universe = unknown PATH: /usr/local/sbin/ PATH: /usr/local/bin/ PATH: /usr/sbin/ PATH: /usr/bin/ PATH: /sbin/ PATH: /bin/ PATH: /usr/games/ PATH: /usr/local/games/ PATH: /snap/bin/ PATH: /snap/bin/ ## ----------- ## ## Core tests. ## ## ----------- ## configure:2932: looking for aux files: config.guess config.sub ltmain.sh compile missing install-sh configure:2945: trying ./config/ configure:2974: ./config/config.guess found configure:2974: ./config/config.sub found configure:2974: ./config/ltmain.sh found configure:2974: ./config/compile found configure:2974: ./config/missing found configure:2956: ./config/install-sh found configure:3108: checking for a BSD-compatible install configure:3181: result: /usr/bin/install -c configure:3192: checking whether build environment is sane configure:3247: result: yes configure:3406: checking for a race-free mkdir -p configure:3450: result: /usr/bin/mkdir -p configure:3457: checking for gawk configure:3492: result: no configure:3457: checking for mawk configure:3478: found /usr/bin/mawk configure:3489: result: mawk configure:3500: checking whether make sets $(MAKE) configure:3527: result: no configure:3553: checking whether make supports nested variables configure:3571: result: no configure:3656: checking whether UID '1000' is supported by ustar format configure:3659: result: yes configure:3666: checking whether GID '1000' is supported by ustar format configure:3669: result: yes configure:3677: checking how to create a ustar tar archive configure:3688: tar --version tar (GNU tar) 1.34 Copyright (C) 2021 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by John Gilmore and Jay Fenlason. configure:3691: $? = 0 configure:3731: tardir=conftest.dir && eval tar --format=ustar -chf - "$tardir" >conftest.tar configure:3734: $? = 0 configure:3738: tar -xf - <conftest.tar configure:3741: $? = 0 configure:3743: cat conftest.dir/file GrepMe configure:3746: $? = 0 configure:3760: result: gnutar configure:3832: checking for gawk configure:3864: result: mawk configure:3975: checking for gcc configure:3996: found /usr/bin/gcc configure:4007: result: gcc configure:4360: checking for C compiler version configure:4369: gcc --version >&5 gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0 Copyright (C) 2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:4380: $? = 0 configure:4369: gcc -v >&5 Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/11/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.2.0-19ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-11-gBFGDP/gcc-11-11.2.0/debian/tmp-nvptx/usr,amdgcn-amdhsa=/build/gcc-11-gBFGDP/gcc-11-11.2.0/debian/tmp-gcn/usr --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 11.2.0 (Ubuntu 11.2.0-19ubuntu1) ... rest of stderr output deleted ... configure:4380: $? = 0 configure:4369: gcc -V >&5 gcc: error: unrecognized command-line option '-V' gcc: fatal error: no input files compilation terminated. configure:4380: $? = 1 configure:4369: gcc -qversion >&5 gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'? gcc: fatal error: no input files compilation terminated. configure:4380: $? = 1 configure:4369: gcc -version >&5 gcc: error: unrecognized command-line option '-version' gcc: fatal error: no input files compilation terminated. configure:4380: $? = 1 configure:4400: checking whether the C compiler works configure:4422: gcc conftest.c >&5 configure:4426: $? = 0 configure:4476: result: yes configure:4479: checking for C compiler default output file name configure:4481: result: a.out configure:4487: checking for suffix of executables configure:4494: gcc -o conftest conftest.c >&5 configure:4498: $? = 0 configure:4521: result: configure:4543: checking whether we are cross compiling configure:4551: gcc -o conftest conftest.c >&5 configure:4555: $? = 0 configure:4562: ./conftest configure:4566: $? = 0 configure:4581: result: no configure:4586: checking for suffix of object files configure:4609: gcc -c conftest.c >&5 configure:4613: $? = 0 configure:4635: result: o configure:4639: checking whether the compiler supports GNU C configure:4659: gcc -c conftest.c >&5 configure:4659: $? = 0 configure:4669: result: yes configure:4680: checking whether gcc accepts -g configure:4701: gcc -c -g conftest.c >&5 configure:4701: $? = 0 configure:4745: result: yes configure:4765: checking for gcc option to enable C11 features configure:4780: gcc -c -g -O2 conftest.c >&5 configure:4780: $? = 0 configure:4798: result: none needed configure:4914: checking whether gcc understands -c and -o together configure:4937: gcc -c conftest.c -o conftest2.o configure:4940: $? = 0 configure:4937: gcc -c conftest.c -o conftest2.o configure:4940: $? = 0 configure:4952: result: yes configure:4972: checking whether make supports the include directive configure:4987: make -f confmf.GNU && cat confinc.out ./configure: line 4988: make: command not found configure:4990: $? = 127 configure:4987: make -f confmf.BSD && cat confinc.out ./configure: line 4988: make: command not found configure:4990: $? = 127 configure:5009: result: no configure:5035: checking dependency style of gcc configure:5147: result: none configure:5231: checking for g++ configure:5266: result: no configure:5231: checking for c++ configure:5266: result: no configure:5231: checking for gpp configure:5266: result: no configure:5231: checking for aCC configure:5266: result: no configure:5231: checking for CC configure:5266: result: no configure:5231: checking for cxx configure:5266: result: no configure:5231: checking for cc++ configure:5266: result: no configure:5231: checking for cl.exe configure:5266: result: no configure:5231: checking for FCC configure:5266: result: no configure:5231: checking for KCC configure:5266: result: no configure:5231: checking for RCC configure:5266: result: no configure:5231: checking for xlC_r configure:5266: result: no configure:5231: checking for xlC configure:5266: result: no configure:5231: checking for clang++ configure:5266: result: no configure:5290: checking for C++ compiler version configure:5299: g++ --version >&5 ./configure: line 5301: g++: command not found configure:5310: $? = 127 configure:5299: g++ -v >&5 ./configure: line 5301: g++: command not found configure:5310: $? = 127 configure:5299: g++ -V >&5 ./configure: line 5301: g++: command not found configure:5310: $? = 127 configure:5299: g++ -qversion >&5 ./configure: line 5301: g++: command not found configure:5310: $? = 127 configure:5314: checking whether the compiler supports GNU C++ configure:5334: g++ -c conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:5334: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | | int | main (void) | { | #ifndef __GNUC__ | choke me | #endif | | ; | return 0; | } configure:5344: result: no configure:5355: checking whether g++ accepts -g configure:5376: g++ -c -g conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:5376: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | | int | main (void) | { | | ; | return 0; | } configure:5392: g++ -c conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:5392: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | | int | main (void) | { | | ; | return 0; | } configure:5409: g++ -c -g conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:5409: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | | int | main (void) | { | | ; | return 0; | } configure:5420: result: no configure:5440: checking for g++ option to enable C++11 features configure:5455: g++ -c conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:5455: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | | // Does the compiler advertise C++98 conformance? | #if !defined __cplusplus || __cplusplus < 199711L | # error "Compiler does not advertise C++98 conformance" | #endif | | // These inclusions are to reject old compilers that | // lack the unsuffixed header files. | #include <cstdlib> | #include <exception> | | // <cassert> and <cstring> are *not* freestanding headers in C++98. | extern void assert (int); | namespace std { | extern int strcmp (const char *, const char *); | } | | // Namespaces, exceptions, and templates were all added after "C++ 2.0". | using std::exception; | using std::strcmp; | | namespace { | | void test_exception_syntax() | { | try { | throw "test"; | } catch (const char *s) { | // Extra parentheses suppress a warning when building autoconf itself, | // due to lint rules shared with more typical C programs. | assert (!(strcmp) (s, "test")); | } | } | | template <typename T> struct test_template | { | T const val; | explicit test_template(T t) : val(t) {} | template <typename U> T add(U u) { return static_cast<T>(u) + val; } | }; | | } // anonymous namespace | | | // Does the compiler advertise C++ 2011 conformance? | #if !defined __cplusplus || __cplusplus < 201103L | # error "Compiler does not advertise C++11 conformance" | #endif | | namespace cxx11test | { | constexpr int get_val() { return 20; } | | struct testinit | { | int i; | double d; | }; | | class delegate | { | public: | delegate(int n) : n(n) {} | delegate(): delegate(2354) {} | | virtual int getval() { return this->n; }; | protected: | int n; | }; | | class overridden : public delegate | { | public: | overridden(int n): delegate(n) {} | virtual int getval() override final { return this->n * 2; } | }; | | class nocopy | { | public: | nocopy(int i): i(i) {} | nocopy() = default; | nocopy(const nocopy&) = delete; | nocopy & operator=(const nocopy&) = delete; | private: | int i; | }; | | // for testing lambda expressions | template <typename Ret, typename Fn> Ret eval(Fn f, Ret v) | { | return f(v); | } | | // for testing variadic templates and trailing return types | template <typename V> auto sum(V first) -> V | { | return first; | } | template <typename V, typename... Args> auto sum(V first, Args... rest) -> V | { | return first + sum(rest...); | } | } | | | int | main (int argc, char **argv) | { | int ok = 0; | | assert (argc); | assert (! argv[0]); | { | test_exception_syntax (); | test_template<double> tt (2.0); | assert (tt.add (4) == 6.0); | assert (true && !false); | } | | | { | // Test auto and decltype | auto a1 = 6538; | auto a2 = 48573953.4; | auto a3 = "String literal"; | | int total = 0; | for (auto i = a3; *i; ++i) { total += *i; } | | decltype(a2) a4 = 34895.034; | } | { | // Test constexpr | short sa[cxx11test::get_val()] = { 0 }; | } | { | // Test initializer lists | cxx11test::testinit il = { 4323, 435234.23544 }; | } | { | // Test range-based for | int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, | 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; | for (auto &x : array) { x += 23; } | } | { | // Test lambda expressions | using cxx11test::eval; | assert (eval ([](int x) { return x*2; }, 21) == 42); | double d = 2.0; | assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); | assert (d == 5.0); | assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); | assert (d == 5.0); | } | { | // Test use of variadic templates | using cxx11test::sum; | auto a = sum(1); | auto b = sum(1, 2); | auto c = sum(1.0, 2.0, 3.0); | } | { | // Test constructor delegation | cxx11test::delegate d1; | cxx11test::delegate d2(); | cxx11test::delegate d3(45); | } | { | // Test override and final | cxx11test::overridden o1(55464); | } | { | // Test nullptr | char *c = nullptr; | } | { | // Test template brackets | test_template<::test_template<int>> v(test_template<int>(12)); | } | { | // Unicode literals | char const *utf8 = u8"UTF-8 string \u2500"; | char16_t const *utf16 = u"UTF-8 string \u2500"; | char32_t const *utf32 = U"UTF-32 string \u2500"; | } | | return ok; | } | configure:5473: result: none needed configure:5539: checking dependency style of g++ configure:5651: result: none configure:5671: checking how to run the C preprocessor configure:5697: gcc -E conftest.c configure:5697: $? = 0 configure:5712: gcc -E conftest.c conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory 11 | #include <ac_nonexistent.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:5712: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | #include <ac_nonexistent.h> configure:5739: result: gcc -E configure:5753: gcc -E conftest.c configure:5753: $? = 0 configure:5768: gcc -E conftest.c conftest.c:11:10: fatal error: ac_nonexistent.h: No such file or directory 11 | #include <ac_nonexistent.h> | ^~~~~~~~~~~~~~~~~~ compilation terminated. configure:5768: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | /* end confdefs.h. */ | #include <ac_nonexistent.h> configure:5830: checking build system type configure:5845: result: x86_64-pc-linux-gnu configure:5865: checking host system type configure:5879: result: x86_64-pc-linux-gnu configure:5920: checking how to print strings configure:5947: result: printf configure:5968: checking for a sed that does not truncate output configure:6038: result: /usr/bin/sed configure:6056: checking for grep that handles long lines and -e configure:6120: result: /usr/bin/grep configure:6125: checking for egrep configure:6193: result: /usr/bin/grep -E configure:6198: checking for fgrep configure:6266: result: /usr/bin/grep -F configure:6302: checking for ld used by gcc configure:6370: result: /usr/bin/ld configure:6377: checking if the linker (/usr/bin/ld) is GNU ld configure:6393: result: yes configure:6405: checking for BSD- or MS-compatible name lister (nm) configure:6460: result: /usr/bin/nm -B configure:6600: checking the name lister (/usr/bin/nm -B) interface configure:6608: gcc -c -g -O2 conftest.c >&5 configure:6611: /usr/bin/nm -B "conftest.o" configure:6614: output 0000000000000000 B some_variable configure:6621: result: BSD nm configure:6624: checking whether ln -s works configure:6628: result: yes configure:6636: checking the maximum length of command line arguments configure:6768: result: 1572864 configure:6816: checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format configure:6857: result: func_convert_file_noop configure:6864: checking how to convert x86_64-pc-linux-gnu file names to toolchain format configure:6885: result: func_convert_file_noop configure:6892: checking for /usr/bin/ld option to reload object files configure:6900: result: -r configure:6979: checking for objdump configure:7000: found /usr/bin/objdump configure:7011: result: objdump configure:7043: checking how to recognize dependent libraries configure:7244: result: pass_all configure:7334: checking for dlltool configure:7369: result: no configure:7399: checking how to associate runtime and link libraries configure:7427: result: printf %s\n configure:7493: checking for ar configure:7514: found /usr/bin/ar configure:7525: result: ar configure:7562: checking for archiver @FILE support configure:7580: gcc -c -g -O2 conftest.c >&5 configure:7580: $? = 0 configure:7584: ar cru libconftest.a @conftest.lst >&5 ar: `u' modifier ignored since `D' is the default (see `U') configure:7587: $? = 0 configure:7592: ar cru libconftest.a @conftest.lst >&5 ar: `u' modifier ignored since `D' is the default (see `U') ar: conftest.o: No such file or directory configure:7595: $? = 1 configure:7607: result: @ configure:7670: checking for strip configure:7691: found /usr/bin/strip configure:7702: result: strip configure:7779: checking for ranlib configure:7800: found /usr/bin/ranlib configure:7811: result: ranlib configure:7913: checking command to parse /usr/bin/nm -B output from gcc object configure:8067: gcc -c -g -O2 conftest.c >&5 configure:8070: $? = 0 configure:8074: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' \> conftest.nm configure:8077: $? = 0 configure:8143: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 configure:8146: $? = 0 configure:8184: result: ok configure:8231: checking for sysroot configure:8262: result: no configure:8269: checking for a working dd configure:8313: result: /usr/bin/dd configure:8317: checking how to truncate binary pipes configure:8333: result: /usr/bin/dd bs=4096 count=1 configure:8470: gcc -c -g -O2 conftest.c >&5 configure:8473: $? = 0 configure:8670: checking for mt configure:8691: found /usr/bin/mt configure:8702: result: mt configure:8725: checking if mt is a manifest tool configure:8732: mt '-?' configure:8740: result: no configure:9465: checking for stdio.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for stdlib.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for string.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for inttypes.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for stdint.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for strings.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for sys/stat.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for sys/types.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9465: checking for unistd.h configure:9465: gcc -c -g -O2 conftest.c >&5 configure:9465: $? = 0 configure:9465: result: yes configure:9490: checking for dlfcn.h configure:9490: gcc -c -g -O2 conftest.c >&5 configure:9490: $? = 0 configure:9490: result: yes configure:9760: checking for objdir configure:9776: result: .libs configure:10040: checking if gcc supports -fno-rtti -fno-exceptions configure:10059: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 cc1: warning: command-line option '-fno-rtti' is valid for C++/D/ObjC++ but not for C configure:10063: $? = 0 configure:10076: result: no configure:10434: checking for gcc option to produce PIC configure:10442: result: -fPIC -DPIC configure:10450: checking if gcc PIC flag -fPIC -DPIC works configure:10469: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 configure:10473: $? = 0 configure:10486: result: yes configure:10515: checking if gcc static flag -static works configure:10544: result: yes configure:10559: checking if gcc supports -c -o file.o configure:10581: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 configure:10585: $? = 0 configure:10607: result: yes configure:10615: checking if gcc supports -c -o file.o configure:10663: result: yes configure:10696: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries configure:11962: result: yes configure:11999: checking whether -lc should be explicitly linked in configure:12008: gcc -c -g -O2 conftest.c >&5 configure:12011: $? = 0 configure:12026: gcc -shared -fPIC -DPIC conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /usr/bin/grep -lc \>/dev/null 2\>\&1 configure:12029: $? = 0 configure:12043: result: no configure:12203: checking dynamic linker characteristics configure:12785: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 configure:12785: $? = 0 configure:13024: result: GNU/Linux ld.so configure:13146: checking how to hardcode library paths into programs configure:13171: result: immediate configure:13723: checking whether stripping libraries is possible configure:13728: result: yes configure:13763: checking if libtool supports shared libraries configure:13765: result: yes configure:13768: checking whether to build shared libraries configure:13793: result: yes configure:13796: checking whether to build static libraries configure:13800: result: yes configure:17260: checking for C++11 support configure:17285: g++ -c conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:17285: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | #define HAVE_STDIO_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_UNISTD_H 1 | #define STDC_HEADERS 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | #include <initializer_list> | struct S { | int i = 3; | double x = 3.5; | }; | | class C { | public: | C(int) noexcept; | C(std::initializer_list<int>); | S f() { return { 2, 1.5 }; } | }; | | int | main (void) | { | | ; | return 0; | } configure:17290: result: no: adding -std=c++11 to CXXFLAGS configure:17302: checking for Boost development files configure:17318: g++ -c -std=c++11 conftest.cpp >&5 ./configure: line 1801: g++: command not found configure:17318: $? = 127 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "QuantLib" | #define PACKAGE_TARNAME "QuantLib" | #define PACKAGE_VERSION "1.26" | #define PACKAGE_STRING "QuantLib 1.26" | #define PACKAGE_BUGREPORT "qua...@li..." | #define PACKAGE_URL "" | #define PACKAGE "QuantLib" | #define VERSION "1.26" | #define HAVE_STDIO_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_UNISTD_H 1 | #define STDC_HEADERS 1 | #define HAVE_DLFCN_H 1 | #define LT_OBJDIR ".libs/" | /* end confdefs.h. */ | #include <boost/version.hpp> | #include <boost/shared_ptr.hpp> | #include <boost/assert.hpp> | #include <boost/current_function.hpp> | int | main (void) | { | | ; | return 0; | } configure:17323: result: no configure:17325: error: Boost development files not found ## ---------------- ## ## Cache variables. ## ## ---------------- ## ac_cv_build=x86_64-pc-linux-gnu ac_cv_c_compiler_gnu=yes ac_cv_cxx_compiler_gnu=no ac_cv_env_CCC_set= ac_cv_env_CCC_value= ac_cv_env_CC_set= ac_cv_env_CC_value= ac_cv_env_CFLAGS_set= ac_cv_env_CFLAGS_value= ac_cv_env_CPPFLAGS_set= ac_cv_env_CPPFLAGS_value= ac_cv_env_CPP_set= ac_cv_env_CPP_value= ac_cv_env_CXXCPP_set= ac_cv_env_CXXCPP_value= ac_cv_env_CXXFLAGS_set= ac_cv_env_CXXFLAGS_value= ac_cv_env_CXX_set= ac_cv_env_CXX_value= ac_cv_env_EMACSLOADPATH_set= ac_cv_env_EMACSLOADPATH_value= ac_cv_env_EMACS_set= ac_cv_env_EMACS_value= ac_cv_env_LDFLAGS_set= ac_cv_env_LDFLAGS_value= ac_cv_env_LIBS_set= ac_cv_env_LIBS_value= ac_cv_env_LT_SYS_LIBRARY_PATH_set= ac_cv_env_LT_SYS_LIBRARY_PATH_value= ac_cv_env_build_alias_set= ac_cv_env_build_alias_value= ac_cv_env_host_alias_set= ac_cv_env_host_alias_value= ac_cv_env_target_alias_set= ac_cv_env_target_alias_value= ac_cv_header_dlfcn_h=yes ac_cv_header_inttypes_h=yes ac_cv_header_stdint_h=yes ac_cv_header_stdio_h=yes ac_cv_header_stdlib_h=yes ac_cv_header_string_h=yes ac_cv_header_strings_h=yes ac_cv_header_sys_stat_h=yes ac_cv_header_sys_types_h=yes ac_cv_header_unistd_h=yes ac_cv_host=x86_64-pc-linux-gnu ac_cv_objext=o ac_cv_path_EGREP='/usr/bin/grep -E' ac_cv_path_FGREP='/usr/bin/grep -F' ac_cv_path_GREP=/usr/bin/grep ac_cv_path_SED=/usr/bin/sed ac_cv_path_install='/usr/bin/install -c' ac_cv_path_lt_DD=/usr/bin/dd ac_cv_path_mkdir=/usr/bin/mkdir ac_cv_prog_AWK=mawk ac_cv_prog_CPP='gcc -E' ac_cv_prog_ac_ct_AR=ar ac_cv_prog_ac_ct_CC=gcc ac_cv_prog_ac_ct_MANIFEST_TOOL=mt ac_cv_prog_ac_ct_OBJDUMP=objdump ac_cv_prog_ac_ct_RANLIB=ranlib ac_cv_prog_ac_ct_STRIP=strip ac_cv_prog_cc_c11= ac_cv_prog_cc_g=yes ac_cv_prog_cc_stdc= ac_cv_prog_cxx_11=no ac_cv_prog_cxx_g=no ac_cv_prog_cxx_stdcxx= ac_cv_prog_make_make_set=no am_cv_CC_dependencies_compiler_type=none am_cv_CXX_dependencies_compiler_type=none am_cv_make_support_nested_variables=no am_cv_prog_cc_c_o=yes am_cv_prog_tar_ustar=gnutar lt_cv_ar_at_file=@ lt_cv_archive_cmds_need_lc=no lt_cv_deplibs_check_method=pass_all lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_ld_reload_flag=-r lt_cv_nm_interface='BSD nm' lt_cv_objdir=.libs lt_cv_path_LD=/usr/bin/ld lt_cv_path_NM='/usr/bin/nm -B' lt_cv_path_mainfest_tool=no lt_cv_prog_compiler_c_o=yes lt_cv_prog_compiler_pic='-fPIC -DPIC' lt_cv_prog_compiler_pic_works=yes lt_cv_prog_compiler_rtti_exceptions=no lt_cv_prog_compiler_static_works=yes lt_cv_prog_gnu_ld=yes lt_cv_sharedlib_from_linklib_cmd='printf %s\n' lt_cv_shlibpath_overrides_runpath=yes lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\'' | sed '\''/ __gnu_lto/d'\''' lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"\1", (void *) \&\1},/p'\''' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='sed -n -e '\''s/^: \(.*\) .*$/ {"\1", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(lib.*\)$/ {"\1", (void *) \&\1},/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/ {"lib\1", (void *) \&\1},/p'\''' lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW][ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' lt_cv_sys_global_symbol_to_import= lt_cv_sys_max_cmd_len=1572864 lt_cv_to_host_file_cmd=func_convert_file_noop lt_cv_to_tool_file_cmd=func_convert_file_noop lt_cv_truncate_bin='/usr/bin/dd bs=4096 count=1' ## ----------------- ## ## Output variables. ## ## ----------------- ## ACLOCAL='${SHELL} '\''/home/xxx/QuantLib-1.26/config/missing'\'' aclocal-1.16' AMDEPBACKSLASH='\' AMDEP_FALSE='#' AMDEP_TRUE='' AMTAR='$${TAR-tar}' AM_BACKSLASH='\' AM_DEFAULT_V='1' AM_DEFAULT_VERBOSITY='1' AM_V='1' AR='ar' AUTOCONF='${SHELL} '\''/home/xxx/QuantLib-1.26/config/missing'\'' autoconf' AUTOHEADER='${SHELL} '\''/home/xxx/QuantLib-1.26/config/missing'\'' autoheader' AUTOMAKE='${SHELL} '\''/home/xxx/QuantLib-1.26/config/missing'\'' automake-1.16' AUTO_BENCHMARK_FALSE='' AUTO_BENCHMARK_TRUE='' AUTO_EXAMPLES_FALSE='' AUTO_EXAMPLES_TRUE='' AWK='mawk' BOOST_INCLUDE='' BOOST_INTERPROCESS_LIB='' BOOST_LIB='' BOOST_THREAD_LIB='' BOOST_UNIT_TEST_FOUND_FALSE='' BOOST_UNIT_TEST_FOUND_TRUE='' BOOST_UNIT_TEST_LIB='' BOOST_UNIT_TEST_MAIN_CXXFLAGS='' CC='gcc' CCDEPMODE='depmode=none' CFLAGS='-g -O2' CPP11_CXXFLAGS='-std=c++11' CPP='gcc -E' CPPFLAGS='' CSCOPE='cscope' CTAGS='ctags' CXX='g++' CXXCPP='' CXXDEPMODE='depmode=none' CXXFLAGS=' -std=c++11' CYGPATH_W='echo' DEFS='' DEPDIR='.deps' DLLTOOL='false' DOXYGEN='' DSYMUTIL='' DUMPBIN='' DVIPS='' ECHO_C='' ECHO_N='-n' ECHO_T='' EGREP='/usr/bin/grep -E' EMACS='' EMACSLOADPATH='' EMACS_FOUND_FALSE='' EMACS_FOUND_TRUE='' ENABLE_STATIC_FALSE='#' ENABLE_STATIC_TRUE='' ETAGS='etags' EXEEXT='' FGREP='/usr/bin/grep -F' GREP='/usr/bin/grep' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL}' INSTALL_SCRIPT='${INSTALL}' INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' LATEX='' LD='/usr/bin/ld -m elf_x86_64' LDFLAGS='' LIBOBJS='' LIBS='' LIBTOOL='$(SHELL) $(top_builddir)/libtool' LIPO='' LN_S='ln -s' LTLIBOBJS='' LT_SYS_LIBRARY_PATH='' MAKEINDEX='' MAKEINFO='${SHELL} '\''/home/xxx/QuantLib-1.26/config/missing'\'' makeinfo' MANIFEST_TOOL=':' MKDIR_P='/usr/bin/mkdir -p' NM='/usr/bin/nm -B' NMEDIT='' OBJDUMP='objdump' OBJEXT='o' OPENMP_CXXFLAGS='' OTOOL64='' OTOOL='' PACKAGE='QuantLib' PACKAGE_BUGREPORT='qua...@li...' PACKAGE_NAME='QuantLib' PACKAGE_STRING='QuantLib 1.26' PACKAGE_TARNAME='QuantLib' PACKAGE_URL='' PACKAGE_VERSION='1.26' PATH_SEPARATOR=':' PDFLATEX='' PTHREAD_CXXFLAGS='' RANLIB='ranlib' SED='/usr/bin/sed' SET_MAKE='MAKE=make' SHELL='/bin/bash' STRIP='strip' UNITY_BUILD_FALSE='' UNITY_BUILD_TRUE='' VERSION='1.26' ac_ct_AR='ar' ac_ct_CC='gcc' ac_ct_CXX='' ac_ct_DUMPBIN='' am__EXEEXT_FALSE='' am__EXEEXT_TRUE='' am__fastdepCC_FALSE='' am__fastdepCC_TRUE='#' am__fastdepCXX_FALSE='' am__fastdepCXX_TRUE='#' am__include='#' am__isrc='' am__leading_dot='.' am__nodep='_no' am__quote='' am__tar='tar --format=ustar -chf - "$$tardir"' am__untar='tar -xf -' bindir='${exec_prefix}/bin' build='x86_64-pc-linux-gnu' build_alias='' build_cpu='x86_64' build_os='linux-gnu' build_vendor='pc' datadir='${datarootdir}' datarootdir='${prefix}/share' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' dvidir='${docdir}' exec_prefix='NONE' host='x86_64-pc-linux-gnu' host_alias='' host_cpu='x86_64' host_os='linux-gnu' host_vendor='pc' htmldir='${docdir}' includedir='${prefix}/include' infodir='${datarootdir}/info' install_sh='${SHELL} /home/xxx/QuantLib-1.26/config/install-sh' libdir='${exec_prefix}/lib' libexecdir='${exec_prefix}/libexec' lispdir='' localedir='${datarootdir}/locale' localstatedir='${prefix}/var' mandir='${datarootdir}/man' mkdir_p='$(MKDIR_P)' oldincludedir='/usr/include' pdfdir='${docdir}' prefix='NONE' program_transform_name='s,x,x,' psdir='${docdir}' runstatedir='${localstatedir}/run' sbindir='${exec_prefix}/sbin' sharedstatedir='${prefix}/com' sysconfdir='${prefix}/etc' target_alias='' ## ----------- ## ## confdefs.h. ## ## ----------- ## /* confdefs.h */ #define PACKAGE_NAME "QuantLib" #define PACKAGE_TARNAME "QuantLib" #define PACKAGE_VERSION "1.26" #define PACKAGE_STRING "QuantLib 1.26" #define PACKAGE_BUGREPORT "qua...@li..." #define PACKAGE_URL "" #define PACKAGE "QuantLib" #define VERSION "1.26" #define HAVE_STDIO_H 1 #define HAVE_STDLIB_H 1 #define HAVE_STRING_H 1 #define HAVE_INTTYPES_H 1 #define HAVE_STDINT_H 1 #define HAVE_STRINGS_H 1 #define HAVE_SYS_STAT_H 1 #define HAVE_SYS_TYPES_H 1 #define HAVE_UNISTD_H 1 #define STDC_HEADERS 1 #define HAVE_DLFCN_H 1 #define LT_OBJDIR ".libs/" configure: exit 1 On Wed, May 4, 2022 at 1:53 PM Christofer Bogaso <bog...@gm...> wrote: > > Hi, > > I am running ./configure within Home/QuantLib-1.26 folder. > > Attached is a snapshot of all files and folders within that folder. I > fail to see any file with name config.log. There is a folder called > config, but within that also the log is not present. Could you please > help me to identify the exact location? > > On Wed, May 4, 2022 at 1:28 PM Luigi Ballabio <lui...@gm...> wrote: > > > > configure.ac is an input used to build configure itself. > > > > You need to look at config.log in the directory where you ran ./configure > > > > > > On Wed, May 4, 2022 at 6:50 AM Daniel Lobo <dan...@gm...> wrote: > >> > >> Hi, > >> > >> I still get the same error message as below, > >> > >> $ ./configure --with-boost-include=usr/include/boost > >> --with-boost-lib=/usr/lib/x86_64-linux-gnu > >> checking for a BSD-compatible install... /usr/bin/install -c > >> checking whether build environment is sane... yes > >> checking for a race-free mkdir -p... /usr/bin/mkdir -p > >> checking for gawk... no > >> checking for mawk... mawk > >> checking whether make sets $(MAKE)... no > >> checking whether make supports nested variables... no > >> checking whether UID '1000' is supported by ustar format... yes > >> checking whether GID '1000' is supported by ustar format... yes > >> checking how to create a ustar tar archive... gnutar > >> checking for gawk... (cached) mawk > >> checking for gcc... gcc > >> checking whether the C compiler works... yes > >> checking for C compiler default output file name... a.out > >> checking for suffix of executables... > >> checking whether we are cross compiling... no > >> checking for suffix of object files... o > >> checking whether the compiler supports GNU C... yes > >> checking whether gcc accepts -g... yes > >> checking for gcc option to enable C11 features... none needed > >> checking whether gcc understands -c and -o together... yes > >> checking whether make supports the include directive... no > >> checking dependency style of gcc... none > >> checking for g++... no > >> checking for c++... no > >> checking for gpp... no > >> checking for aCC... no > >> checking for CC... no > >> checking for cxx... no > >> checking for cc++... no > >> checking for cl.exe... no > >> checking for FCC... no > >> checking for KCC... no > >> checking for RCC... no > >> checking for xlC_r... no > >> checking for xlC... no > >> checking for clang++... no > >> checking whether the compiler supports GNU C++... no > >> checking whether g++ accepts -g... no > >> checking for g++ option to enable C++11 features... none needed > >> checking dependency style of g++... none > >> checking how to run the C preprocessor... gcc -E > >> checking build system type... x86_64-pc-linux-gnu > >> checking host system type... x86_64-pc-linux-gnu > >> checking how to print strings... printf > >> checking for a sed that does not truncate output... /usr/bin/sed > >> checking for grep that handles long lines and -e... /usr/bin/grep > >> checking for egrep... /usr/bin/grep -E > >> checking for fgrep... /usr/bin/grep -F > >> checking for ld used by gcc... /usr/bin/ld > >> checking if the linker (/usr/bin/ld) is GNU ld... yes > >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > >> checking the name lister (/usr/bin/nm -B) interface... BSD nm > >> checking whether ln -s works... yes > >> checking the maximum length of command line arguments... 1572864 > >> checking how to convert x86_64-pc-linux-gnu file names to > >> x86_64-pc-linux-gnu format... func_convert_file_noop > >> checking how to convert x86_64-pc-linux-gnu file names to toolchain > >> format... func_convert_file_noop > >> checking for /usr/bin/ld option to reload object files... -r > >> checking for objdump... objdump > >> checking how to recognize dependent libraries... pass_all > >> checking for dlltool... no > >> checking how to associate runtime and link libraries... printf %s\n > >> checking for ar... ar > >> checking for archiver @FILE support... @ > >> checking for strip... strip > >> checking for ranlib... ranlib > >> checking command to parse /usr/bin/nm -B output from gcc object... ok > >> checking for sysroot... no > >> checking for a working dd... /usr/bin/dd > >> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 > >> checking for mt... mt > >> checking if mt is a manifest tool... no > >> checking for stdio.h... yes > >> checking for stdlib.h... yes > >> checking for string.h... yes > >> checking for inttypes.h... yes > >> checking for stdint.h... yes > >> checking for strings.h... yes > >> checking for sys/stat.h... yes > >> checking for sys/types.h... yes > >> checking for unistd.h... yes > >> checking for dlfcn.h... yes > >> checking for objdir... .libs > >> checking if gcc supports -fno-rtti -fno-exceptions... no > >> checking for gcc option to produce PIC... -fPIC -DPIC > >> checking if gcc PIC flag -fPIC -DPIC works... yes > >> checking if gcc static flag -static works... yes > >> checking if gcc supports -c -o file.o... yes > >> checking if gcc supports -c -o file.o... (cached) yes > >> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports > >> shared libraries... yes > >> checking whether -lc should be explicitly linked in... no > >> checking dynamic linker characteristics... GNU/Linux ld.so > >> checking how to hardcode library paths into programs... immediate > >> checking whether stripping libraries is possible... yes > >> checking if libtool supports shared libraries... yes > >> checking whether to build shared libraries... yes > >> checking whether to build static libraries... yes > >> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS > >> checking for Boost development files... no > >> configure: error: Boost development files not found > >> > >> Below is the outputs from configure file (configure.ac) > >> > >> # Process this file with autoconf to produce a configure script. > >> AC_INIT([QuantLib], [1.26], > >> [qua...@li...], > >> [QuantLib]) > >> AC_PREREQ(2.62) > >> AC_CONFIG_SRCDIR([ql/qldefines.hpp]) > >> AC_CONFIG_AUX_DIR([config]) > >> AC_CONFIG_HEADERS([ql/config.hpp]) > >> AM_INIT_AUTOMAKE([foreign nostdinc subdir-objects tar-ustar]) > >> AC_CONFIG_MACRO_DIR([m4]) > >> > >> AC_COPYRIGHT([ > >> Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl > >> Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 StatPro Italia srl > >> Copyright (C) 2004, 2005 Ferdinando Ametrano > >> > >> This file is part of QuantLib, a free-software/open-source library > >> for financial quantitative analysts and developers - http://quantlib.org/ > >> > >> QuantLib is free software: you can redistribute it and/or modify it > >> under the terms of the QuantLib license. You should have received a > >> copy of the license along with this program; if not, please email > >> <qua...@li...>. The license is also available online at > >> <http://quantlib.org/license.shtml>. > >> > >> This program is distributed in the hope that it will be useful, but WITHOUT > >> ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS > >> FOR A PARTICULAR PURPOSE. See the license for more details.]) > >> > >> AC_PROG_AWK > >> AC_PROG_INSTALL > >> > >> # Help the compiler find external software > >> > >> AC_ARG_WITH([boost-include], > >> AS_HELP_STRING([--with-boost-include=INCLUDE_PATH], > >> [Supply the location of Boost header files]), > >> [ql_boost_include_path="`cd ${withval} 2>/dev/null && pwd`"], > >> [ql_boost_include_path=""]) > >> if test [ -n "$ql_boost_include_path" ] ; then > >> AC_SUBST([BOOST_INCLUDE],["-I${ql_boost_include_path}"]) > >> AC_SUBST([CPPFLAGS],["${CPPFLAGS} -I${ql_boost_include_path}"]) > >> fi > >> AC_ARG_WITH([boost-lib], > >> AS_HELP_STRING([--with-boost-lib=LIB_PATH], > >> [Supply the location of Boost libraries]), > >> [ql_boost_lib_path="`cd ${withval} 2>/dev/null && pwd`"], > >> [ql_boost_lib_path=""]) > >> if test [ -n "$ql_boost_lib_path" ] ; then > >> AC_SUBST([BOOST_LIB],["-L${ql_boost_lib_path}"]) > >> AC_SUBST([LDFLAGS],["${LDFLAGS} -L${ql_boost_lib_path}"]) > >> fi > >> > >> > >> # Continue setup > >> > >> AC_PROG_CC > >> AC_PROG_CXX > >> AC_PROG_CPP > >> LT_INIT > >> > >> AM_CONDITIONAL(ENABLE_STATIC, test "${enable_static}" == "yes") > >> > >> AC_LANG([C++]) > >> > >> AC_ARG_ENABLE([openmp], > >> AS_HELP_STRING([--enable-openmp], > >> [If enabled, configure will try to detect > >> and enable OpenMP support.]), > >> [ql_openmp=$enableval], > >> [ql_openmp=no]) > >> if test "$ql_openmp" = "yes" ; then > >> AC_OPENMP > >> AC_SUBST([CXXFLAGS],["${CXXFLAGS} ${OPENMP_CXXFLAGS}"]) > >> fi > >> > >> # Check for C++11 support > >> QL_CHECK_CPP11 > >> > >> # Check for Boost components > >> QL_CHECK_BOOST > >> AM_CONDITIONAL(BOOST_UNIT_TEST_FOUND, test "x${BOOST_UNIT_TEST_LIB}" != "x") > >> > >> # Check for Emacs > >> AM_PATH_LISPDIR > >> AM_CONDITIONAL(EMACS_FOUND, test "${EMACS}" != "no") > >> > >> # Check for tools needed for building documentation > >> AC_PATH_PROG([DOXYGEN], [doxygen]) > >> AC_PATH_PROG([SED], [sed]) > >> AC_PATH_PROG([LATEX], [latex]) > >> AC_PATH_PROG([PDFLATEX], [pdflatex]) > >> AC_PATH_PROG([MAKEINDEX], [makeindex]) > >> AC_PATH_PROG([DVIPS], [dvips]) > >> > >> > >> # site configuration > >> > >> # AC_ARG_WITH([real], > >> # AS_HELP_STRING([--with-real=type], > >> # [The given type will be used for floating-point > >> # calculations. > >> # In case this option is not invoked, double > >> # will be used.]), > >> # [AC_DEFINE_UNQUOTED([QL_REAL],[$withval], > >> # [Define this as the type to be used for > >> # floating-point calculations.])], > >> # [AC_DEFINE_UNQUOTED([QL_REAL],[double], > >> # [Define this as the type to be used for > >> # floating-point calculations.])]) > >> > >> # AC_ARG_WITH([integer], > >> # AS_HELP_STRING([--with-integer=type], > >> # [The given type will be used for integer > >> # calculations. At least an int is required. > >> # In case this option is not invoked, int > >> # will be used.]), > >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[$withval], > >> # [Define this as the type to be used for > >> # integer calculations. At least an int > >> # is required.])], > >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[int], > >> # [Define this as the type to be used for > >> # integer calculations. At least an int > >> # is required.])]) > >> > >> # AC_ARG_WITH([big-integer], > >> # AS_HELP_STRING([--with-big-integer=type], > >> # [The given type will be used for large integer > >> # calculations. At least 4 bytes are required. > >> # In case this option is not invoked, long > >> # will be used.]), > >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[$withval], > >> # [Define this as the type to be used for > >> # large integer calculations. At least > >> # 4 bytes are required.])], > >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[long], > >> # [Define this as the type to be used for > >> # large integer calculations. At least > >> # 4 bytes are required.])]) > >> > >> > >> AC_ARG_ENABLE([error-lines], > >> AS_HELP_STRING([--enable-error-lines], > >> [If enabled, file and line information is > >> added to the error messages thrown by > >> the library.]), > >> [ql_error_lines=$enableval], > >> [ql_error_lines=no]) > >> AC_MSG_CHECKING([whether to add file and line information to errors]) > >> if test "$ql_error_lines" = "yes" ; then > >> AC_DEFINE([QL_ERROR_LINES],[1], > >> [Define this if error messages should include file and line > >> information.]) > >> fi > >> AC_MSG_RESULT([$ql_error_lines]) > >> > >> AC_ARG_ENABLE([error-functions], > >> AS_HELP_STRING([--enable-error-functions], > >> [If enabled, current function information > >> is added to the error messages thrown by > >> the library.]), > >> [ql_error_functions=$enableval], > >> [ql_error_functions=no]) > >> AC_MSG_CHECKING([whether to add function information to errors]) > >> if test "$ql_error_functions" = "yes" ; then > >> AC_DEFINE([QL_ERROR_FUNCTIONS],[1], > >> [Define this if error messages should include current function > >> information.]) > >> fi > >> AC_MSG_RESULT([$ql_error_functions]) > >> > >> AC_ARG_ENABLE([tracing], > >> AS_HELP_STRING([--enable-tracing], > >> [If enabled, tracing messages might be emitted > >> by the library depending on run-time > >> settings. Enabling this option can degrade > >> performance.]), > >> [ql_tracing=$enableval], > >> [ql_tracing=no]) > >> AC_MSG_CHECKING([whether to enable tracing]) > >> if test "$ql_tracing" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_TRACING],[1], > >> [Define this if tracing messages should allowed (whether they > >> are actually emitted will depend on run-time settings.)]) > >> fi > >> AC_MSG_RESULT([$ql_tracing]) > >> > >> AC_MSG_CHECKING([whether to enable indexed coupons]) > >> AC_ARG_ENABLE([indexed-coupons], > >> AS_HELP_STRING([--enable-indexed-coupons], > >> [If enabled, indexed coupons (see the > >> documentation) are used in floating legs. > >> If disabled (the default), par coupons > >> are used.]), > >> [ql_indexed_coupon=$enableval], > >> [ql_indexed_coupon=no]) > >> if test "$ql_indexed_coupon" = "yes" ; then > >> AC_DEFINE([QL_USE_INDEXED_COUPON],[1], > >> [Define this to use indexed coupons instead of par coupons in > >> floating legs.]) > >> fi > >> AC_MSG_RESULT([$ql_indexed_coupon]) > >> > >> AC_MSG_CHECKING([whether to enable extra safety checks]) > >> AC_ARG_ENABLE([extra-safety-checks], > >> AS_HELP_STRING([--enable-extra-safety-checks], > >> [If enabled, extra run-time checks are added > >> to a few functions. This can prevent their > >> inlining and degrade performance.]), > >> [ql_belt_and_braces=$enableval], > >> [ql_belt_and_braces=no]) > >> if test "$ql_belt_and_braces" = "yes" ; then > >> AC_DEFINE([QL_EXTRA_SAFETY_CHECKS],[1], > >> [Define this if extra safety checks should be performed. > >> This can degrade performance.]) > >> fi > >> AC_MSG_RESULT([$ql_belt_and_braces]) > >> > >> AC_MSG_CHECKING([whether to enable sessions]) > >> AC_ARG_ENABLE([sessions], > >> AS_HELP_STRING([--enable-sessions], > >> [If enabled, singletons will return different > >> instances for different sessions. You will > >> have to provide and link with the library > >> a sessionId() function in namespace QuantLib, > >> returning a different session id for each > >> session. This also implies thread-safe > >> Singleton initialization.]), > >> [ql_use_sessions=$enableval], > >> [ql_use_sessions=no]) > >> if test "$ql_use_sessions" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_SESSIONS],[1], > >> [Define this if you want to enable sessions.]) > >> fi > >> AC_MSG_RESULT([$ql_use_sessions]) > >> > >> AC_MSG_CHECKING([whether to enable thread-safe observer pattern]) > >> AC_ARG_ENABLE([thread-safe-observer-pattern], > >> AS_HELP_STRING([--enable-thread-safe-observer-pattern], > >> [If enabled, thread-safe version of the > >> observer pattern will be used. You should > >> enable it if you want to use QuantLib > >> via the SWIG layer within the JVM or .NET > >> eco system or any environment with an > >> async garbage collector. C++-17 is required > >> if this option is used together with > >> --enable-std-pointers]), > >> [ql_use_tsop=$enableval], > >> [ql_use_tsop=no]) > >> AC_MSG_RESULT([$ql_use_tsop]) > >> if test "$ql_use_tsop" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN],[1], > >> [Define this if you want to enable > >> thread-safe observer pattern.]) > >> fi > >> > >> AC_MSG_CHECKING([whether to enable thread-safe singleton initialization]) > >> AC_ARG_ENABLE([thread-safe-singleton-init], > >> AS_HELP_STRING([--enable-thread-safe-singleton-init], > >> [If enabled, singleton initialization will > >> be thread-safe. This requires Boost 1.58 > >> or later. Note that --enable-sessions > >> implies thread-safe initialization, > >> whether this is defined or not]), > >> [ql_use_safe_singleton_init=$enableval], > >> [ql_use_safe_singleton_init=no]) > >> if test "$ql_use_safe_singleton_init" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_SINGLETON_THREAD_SAFE_INIT],[1], > >> [Define this if you want thread-safe singleton initialization.]) > >> fi > >> AC_MSG_RESULT([$ql_use_safe_singleton_init]) > >> > >> if test "$ql_use_sessions" = "yes" || test "$ql_use_tsop" = "yes" || > >> test "$ql_use_safe_singleton_init" = "yes"; then > >> QL_CHECK_BOOST_VERSION_1_58_OR_HIGHER > >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM > >> else > >> AC_SUBST([BOOST_THREAD_LIB],[""]) > >> fi > >> > >> AC_MSG_CHECKING([whether to enable parallel unit test runner]) > >> AC_ARG_ENABLE([parallel-unit-test-runner], > >> AS_HELP_STRING([--enable-parallel-unit-test-runner], > >> [If enabled, a parallel unit test runner is used > >> to execute the C++ test suite. This will reduce > >> the runtime on multi core CPUs.]), > >> [ql_use_parallel_test=$enableval], > >> [ql_use_parallel_test=no]) > >> AC_MSG_RESULT([$ql_use_parallel_test]) > >> if test "$ql_use_parallel_test" = "yes" ; then > >> AC_DEFINE([QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER],[1], > >> [Define this if you want to enable > >> the parallel unit test runner.]) > >> QL_CHECK_BOOST_VERSION_1_59_OR_HIGHER > >> if test "$ql_use_tsop" != "yes" ; then > >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM > >> fi > >> QL_CHECK_BOOST_TEST_INTERPROCESS > >> else > >> AC_SUBST([BOOST_INTERPROCESS_LIB],[""]) > >> fi > >> > >> AC_MSG_CHECKING([whether to install examples]) > >> AC_ARG_ENABLE([examples], > >> AS_HELP_STRING([--enable-examples], > >> [If enabled, examples are built and installed > >> when "make" and "make install" are invoked. > >> If disabled (the default) they are built > >> but not installed.]), > >> [ql_install_examples=$enableval], > >> [ql_install_examples=no]) > >> AM_CONDITIONAL(AUTO_EXAMPLES, test "$ql_install_examples" != "no") > >> AC_MSG_RESULT([$ql_install_examples]) > >> > >> AC_MSG_CHECKING([whether to install the benchmark]) > >> AC_ARG_ENABLE([benchmark], > >> AS_HELP_STRING([--enable-benchmark], > >> [If enabled, the benchmark is built and > >> installed when "make" and "make install" > >> are invoked. If disabled (the default) > >> it is built but not installed.]), > >> [ql_install_benchmark=$enableval], > >> [ql_install_benchmark=no]) > >> AM_CONDITIONAL(AUTO_BENCHMARK, test "$ql_install_benchmark" != "no") > >> AC_MSG_RESULT([$ql_install_benchmark]) > >> > >> AC_MSG_CHECKING([whether to use unity build]) > >> AC_ARG_ENABLE([unity-build], > >> AS_HELP_STRING([--enable-unity-build], > >> [If enabled, the source files in each directory > >> are collected into one single source file and > >> compiled together. This can speed up the > >> compilation of the library. > >> If disabled (the default) each source file is > >> compiled separately..]), > >> [ql_use_unity_build=$enableval], > >> [ql_use_unity_build=no]) > >> AM_CONDITIONAL(UNITY_BUILD, test "$ql_use_unity_build" != "no") > >> AC_MSG_RESULT([$ql_use_unity_build]) > >> > >> AC_MSG_CHECKING([whether to enable intraday date and daycounters]) > >> AC_ARG_ENABLE([intraday], > >> AS_HELP_STRING([--enable-intraday], > >> [If enabled, date objects will support an intraday > >> datetime resolution down to microseconds. > >> Strickly monotone daycounters (Actual360, > >> Actual365Fixed and ActualActual) will take > >> the additional information into account > >> and allow for accurate intraday pricing. > >> If disabled (the default) the smallest > >> resolution of date objects will be a single day. > >> Intraday datetime resolution is experimental.]), > >> [ql_use_intraday=$enableval], > >> [ql_use_intraday=no]) > >> if test "$ql_use_intraday" = "yes" ; then > >> AC_DEFINE([QL_HIGH_RESOLUTION_DATE],[1], > >> [Define this if you want to enable high resolution date class.]) > >> fi > >> AC_MSG_RESULT([$ql_use_intraday]) > >> > >> AC_MSG_CHECKING([whether to enable standard smart pointers]) > >> AC_ARG_ENABLE([std-pointers], > >> AS_HELP_STRING([--enable-std-pointers], > >> [If enabled, std::shared_ptr and related > >> classes and functions will be used instead > >> of boost::shared_ptr. > >> If disabled (the default) the Boost facilities > >> are used. > >> Note that std::shared_ptr does not check > >> access and can cause segmentation faults.]), > >> [ql_use_std_pointers=$enableval], > >> [ql_use_std_pointers=no]) > >> if test "$ql_use_std_pointers" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], > >> [Define this if you want to use standard smart pointers.]) > >> fi > >> AC_MSG_RESULT([$ql_use_std_pointers]) > >> > >> AC_MSG_CHECKING([whether to enable std::unique_ptr instead of std::auto_ptr]) > >> AC_ARG_ENABLE([std-unique-ptr], > >> AS_HELP_STRING([--enable-std-unique-ptr], > >> [If enabled (the default), std::unique_ptr will > >> be used instead of the deprecated std::auto_ptr. > >> If disabled, std::auto_ptr will still be used.]), > >> [ql_use_unique_ptr=$enableval], > >> [ql_use_unique_ptr=yes]) > >> if test "$ql_use_unique_ptr" = "yes" ; then > >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], > >> [Define this if you want to replace std::auto_ptr with > >> std::unique_ptr.]) > >> fi > >> AC_MSG_RESULT([$ql_use_unique_ptr]) > >> > >> AC_MSG_CHECKING([whether to enable ... [truncated message content] |
|
From: Christofer B. <bog...@gm...> - 2022-05-04 08:23:41
|
Hi, I am running ./configure within Home/QuantLib-1.26 folder. Attached is a snapshot of all files and folders within that folder. I fail to see any file with name config.log. There is a folder called config, but within that also the log is not present. Could you please help me to identify the exact location? On Wed, May 4, 2022 at 1:28 PM Luigi Ballabio <lui...@gm...> wrote: > > configure.ac is an input used to build configure itself. > > You need to look at config.log in the directory where you ran ./configure > > > On Wed, May 4, 2022 at 6:50 AM Daniel Lobo <dan...@gm...> wrote: >> >> Hi, >> >> I still get the same error message as below, >> >> $ ./configure --with-boost-include=usr/include/boost >> --with-boost-lib=/usr/lib/x86_64-linux-gnu >> checking for a BSD-compatible install... /usr/bin/install -c >> checking whether build environment is sane... yes >> checking for a race-free mkdir -p... /usr/bin/mkdir -p >> checking for gawk... no >> checking for mawk... mawk >> checking whether make sets $(MAKE)... no >> checking whether make supports nested variables... no >> checking whether UID '1000' is supported by ustar format... yes >> checking whether GID '1000' is supported by ustar format... yes >> checking how to create a ustar tar archive... gnutar >> checking for gawk... (cached) mawk >> checking for gcc... gcc >> checking whether the C compiler works... yes >> checking for C compiler default output file name... a.out >> checking for suffix of executables... >> checking whether we are cross compiling... no >> checking for suffix of object files... o >> checking whether the compiler supports GNU C... yes >> checking whether gcc accepts -g... yes >> checking for gcc option to enable C11 features... none needed >> checking whether gcc understands -c and -o together... yes >> checking whether make supports the include directive... no >> checking dependency style of gcc... none >> checking for g++... no >> checking for c++... no >> checking for gpp... no >> checking for aCC... no >> checking for CC... no >> checking for cxx... no >> checking for cc++... no >> checking for cl.exe... no >> checking for FCC... no >> checking for KCC... no >> checking for RCC... no >> checking for xlC_r... no >> checking for xlC... no >> checking for clang++... no >> checking whether the compiler supports GNU C++... no >> checking whether g++ accepts -g... no >> checking for g++ option to enable C++11 features... none needed >> checking dependency style of g++... none >> checking how to run the C preprocessor... gcc -E >> checking build system type... x86_64-pc-linux-gnu >> checking host system type... x86_64-pc-linux-gnu >> checking how to print strings... printf >> checking for a sed that does not truncate output... /usr/bin/sed >> checking for grep that handles long lines and -e... /usr/bin/grep >> checking for egrep... /usr/bin/grep -E >> checking for fgrep... /usr/bin/grep -F >> checking for ld used by gcc... /usr/bin/ld >> checking if the linker (/usr/bin/ld) is GNU ld... yes >> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> checking whether ln -s works... yes >> checking the maximum length of command line arguments... 1572864 >> checking how to convert x86_64-pc-linux-gnu file names to >> x86_64-pc-linux-gnu format... func_convert_file_noop >> checking how to convert x86_64-pc-linux-gnu file names to toolchain >> format... func_convert_file_noop >> checking for /usr/bin/ld option to reload object files... -r >> checking for objdump... objdump >> checking how to recognize dependent libraries... pass_all >> checking for dlltool... no >> checking how to associate runtime and link libraries... printf %s\n >> checking for ar... ar >> checking for archiver @FILE support... @ >> checking for strip... strip >> checking for ranlib... ranlib >> checking command to parse /usr/bin/nm -B output from gcc object... ok >> checking for sysroot... no >> checking for a working dd... /usr/bin/dd >> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 >> checking for mt... mt >> checking if mt is a manifest tool... no >> checking for stdio.h... yes >> checking for stdlib.h... yes >> checking for string.h... yes >> checking for inttypes.h... yes >> checking for stdint.h... yes >> checking for strings.h... yes >> checking for sys/stat.h... yes >> checking for sys/types.h... yes >> checking for unistd.h... yes >> checking for dlfcn.h... yes >> checking for objdir... .libs >> checking if gcc supports -fno-rtti -fno-exceptions... no >> checking for gcc option to produce PIC... -fPIC -DPIC >> checking if gcc PIC flag -fPIC -DPIC works... yes >> checking if gcc static flag -static works... yes >> checking if gcc supports -c -o file.o... yes >> checking if gcc supports -c -o file.o... (cached) yes >> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> shared libraries... yes >> checking whether -lc should be explicitly linked in... no >> checking dynamic linker characteristics... GNU/Linux ld.so >> checking how to hardcode library paths into programs... immediate >> checking whether stripping libraries is possible... yes >> checking if libtool supports shared libraries... yes >> checking whether to build shared libraries... yes >> checking whether to build static libraries... yes >> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS >> checking for Boost development files... no >> configure: error: Boost development files not found >> >> Below is the outputs from configure file (configure.ac) >> >> # Process this file with autoconf to produce a configure script. >> AC_INIT([QuantLib], [1.26], >> [qua...@li...], >> [QuantLib]) >> AC_PREREQ(2.62) >> AC_CONFIG_SRCDIR([ql/qldefines.hpp]) >> AC_CONFIG_AUX_DIR([config]) >> AC_CONFIG_HEADERS([ql/config.hpp]) >> AM_INIT_AUTOMAKE([foreign nostdinc subdir-objects tar-ustar]) >> AC_CONFIG_MACRO_DIR([m4]) >> >> AC_COPYRIGHT([ >> Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl >> Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 StatPro Italia srl >> Copyright (C) 2004, 2005 Ferdinando Ametrano >> >> This file is part of QuantLib, a free-software/open-source library >> for financial quantitative analysts and developers - http://quantlib.org/ >> >> QuantLib is free software: you can redistribute it and/or modify it >> under the terms of the QuantLib license. You should have received a >> copy of the license along with this program; if not, please email >> <qua...@li...>. The license is also available online at >> <http://quantlib.org/license.shtml>. >> >> This program is distributed in the hope that it will be useful, but WITHOUT >> ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS >> FOR A PARTICULAR PURPOSE. See the license for more details.]) >> >> AC_PROG_AWK >> AC_PROG_INSTALL >> >> # Help the compiler find external software >> >> AC_ARG_WITH([boost-include], >> AS_HELP_STRING([--with-boost-include=INCLUDE_PATH], >> [Supply the location of Boost header files]), >> [ql_boost_include_path="`cd ${withval} 2>/dev/null && pwd`"], >> [ql_boost_include_path=""]) >> if test [ -n "$ql_boost_include_path" ] ; then >> AC_SUBST([BOOST_INCLUDE],["-I${ql_boost_include_path}"]) >> AC_SUBST([CPPFLAGS],["${CPPFLAGS} -I${ql_boost_include_path}"]) >> fi >> AC_ARG_WITH([boost-lib], >> AS_HELP_STRING([--with-boost-lib=LIB_PATH], >> [Supply the location of Boost libraries]), >> [ql_boost_lib_path="`cd ${withval} 2>/dev/null && pwd`"], >> [ql_boost_lib_path=""]) >> if test [ -n "$ql_boost_lib_path" ] ; then >> AC_SUBST([BOOST_LIB],["-L${ql_boost_lib_path}"]) >> AC_SUBST([LDFLAGS],["${LDFLAGS} -L${ql_boost_lib_path}"]) >> fi >> >> >> # Continue setup >> >> AC_PROG_CC >> AC_PROG_CXX >> AC_PROG_CPP >> LT_INIT >> >> AM_CONDITIONAL(ENABLE_STATIC, test "${enable_static}" == "yes") >> >> AC_LANG([C++]) >> >> AC_ARG_ENABLE([openmp], >> AS_HELP_STRING([--enable-openmp], >> [If enabled, configure will try to detect >> and enable OpenMP support.]), >> [ql_openmp=$enableval], >> [ql_openmp=no]) >> if test "$ql_openmp" = "yes" ; then >> AC_OPENMP >> AC_SUBST([CXXFLAGS],["${CXXFLAGS} ${OPENMP_CXXFLAGS}"]) >> fi >> >> # Check for C++11 support >> QL_CHECK_CPP11 >> >> # Check for Boost components >> QL_CHECK_BOOST >> AM_CONDITIONAL(BOOST_UNIT_TEST_FOUND, test "x${BOOST_UNIT_TEST_LIB}" != "x") >> >> # Check for Emacs >> AM_PATH_LISPDIR >> AM_CONDITIONAL(EMACS_FOUND, test "${EMACS}" != "no") >> >> # Check for tools needed for building documentation >> AC_PATH_PROG([DOXYGEN], [doxygen]) >> AC_PATH_PROG([SED], [sed]) >> AC_PATH_PROG([LATEX], [latex]) >> AC_PATH_PROG([PDFLATEX], [pdflatex]) >> AC_PATH_PROG([MAKEINDEX], [makeindex]) >> AC_PATH_PROG([DVIPS], [dvips]) >> >> >> # site configuration >> >> # AC_ARG_WITH([real], >> # AS_HELP_STRING([--with-real=type], >> # [The given type will be used for floating-point >> # calculations. >> # In case this option is not invoked, double >> # will be used.]), >> # [AC_DEFINE_UNQUOTED([QL_REAL],[$withval], >> # [Define this as the type to be used for >> # floating-point calculations.])], >> # [AC_DEFINE_UNQUOTED([QL_REAL],[double], >> # [Define this as the type to be used for >> # floating-point calculations.])]) >> >> # AC_ARG_WITH([integer], >> # AS_HELP_STRING([--with-integer=type], >> # [The given type will be used for integer >> # calculations. At least an int is required. >> # In case this option is not invoked, int >> # will be used.]), >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[$withval], >> # [Define this as the type to be used for >> # integer calculations. At least an int >> # is required.])], >> # [AC_DEFINE_UNQUOTED([QL_INTEGER],[int], >> # [Define this as the type to be used for >> # integer calculations. At least an int >> # is required.])]) >> >> # AC_ARG_WITH([big-integer], >> # AS_HELP_STRING([--with-big-integer=type], >> # [The given type will be used for large integer >> # calculations. At least 4 bytes are required. >> # In case this option is not invoked, long >> # will be used.]), >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[$withval], >> # [Define this as the type to be used for >> # large integer calculations. At least >> # 4 bytes are required.])], >> # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[long], >> # [Define this as the type to be used for >> # large integer calculations. At least >> # 4 bytes are required.])]) >> >> >> AC_ARG_ENABLE([error-lines], >> AS_HELP_STRING([--enable-error-lines], >> [If enabled, file and line information is >> added to the error messages thrown by >> the library.]), >> [ql_error_lines=$enableval], >> [ql_error_lines=no]) >> AC_MSG_CHECKING([whether to add file and line information to errors]) >> if test "$ql_error_lines" = "yes" ; then >> AC_DEFINE([QL_ERROR_LINES],[1], >> [Define this if error messages should include file and line >> information.]) >> fi >> AC_MSG_RESULT([$ql_error_lines]) >> >> AC_ARG_ENABLE([error-functions], >> AS_HELP_STRING([--enable-error-functions], >> [If enabled, current function information >> is added to the error messages thrown by >> the library.]), >> [ql_error_functions=$enableval], >> [ql_error_functions=no]) >> AC_MSG_CHECKING([whether to add function information to errors]) >> if test "$ql_error_functions" = "yes" ; then >> AC_DEFINE([QL_ERROR_FUNCTIONS],[1], >> [Define this if error messages should include current function >> information.]) >> fi >> AC_MSG_RESULT([$ql_error_functions]) >> >> AC_ARG_ENABLE([tracing], >> AS_HELP_STRING([--enable-tracing], >> [If enabled, tracing messages might be emitted >> by the library depending on run-time >> settings. Enabling this option can degrade >> performance.]), >> [ql_tracing=$enableval], >> [ql_tracing=no]) >> AC_MSG_CHECKING([whether to enable tracing]) >> if test "$ql_tracing" = "yes" ; then >> AC_DEFINE([QL_ENABLE_TRACING],[1], >> [Define this if tracing messages should allowed (whether they >> are actually emitted will depend on run-time settings.)]) >> fi >> AC_MSG_RESULT([$ql_tracing]) >> >> AC_MSG_CHECKING([whether to enable indexed coupons]) >> AC_ARG_ENABLE([indexed-coupons], >> AS_HELP_STRING([--enable-indexed-coupons], >> [If enabled, indexed coupons (see the >> documentation) are used in floating legs. >> If disabled (the default), par coupons >> are used.]), >> [ql_indexed_coupon=$enableval], >> [ql_indexed_coupon=no]) >> if test "$ql_indexed_coupon" = "yes" ; then >> AC_DEFINE([QL_USE_INDEXED_COUPON],[1], >> [Define this to use indexed coupons instead of par coupons in >> floating legs.]) >> fi >> AC_MSG_RESULT([$ql_indexed_coupon]) >> >> AC_MSG_CHECKING([whether to enable extra safety checks]) >> AC_ARG_ENABLE([extra-safety-checks], >> AS_HELP_STRING([--enable-extra-safety-checks], >> [If enabled, extra run-time checks are added >> to a few functions. This can prevent their >> inlining and degrade performance.]), >> [ql_belt_and_braces=$enableval], >> [ql_belt_and_braces=no]) >> if test "$ql_belt_and_braces" = "yes" ; then >> AC_DEFINE([QL_EXTRA_SAFETY_CHECKS],[1], >> [Define this if extra safety checks should be performed. >> This can degrade performance.]) >> fi >> AC_MSG_RESULT([$ql_belt_and_braces]) >> >> AC_MSG_CHECKING([whether to enable sessions]) >> AC_ARG_ENABLE([sessions], >> AS_HELP_STRING([--enable-sessions], >> [If enabled, singletons will return different >> instances for different sessions. You will >> have to provide and link with the library >> a sessionId() function in namespace QuantLib, >> returning a different session id for each >> session. This also implies thread-safe >> Singleton initialization.]), >> [ql_use_sessions=$enableval], >> [ql_use_sessions=no]) >> if test "$ql_use_sessions" = "yes" ; then >> AC_DEFINE([QL_ENABLE_SESSIONS],[1], >> [Define this if you want to enable sessions.]) >> fi >> AC_MSG_RESULT([$ql_use_sessions]) >> >> AC_MSG_CHECKING([whether to enable thread-safe observer pattern]) >> AC_ARG_ENABLE([thread-safe-observer-pattern], >> AS_HELP_STRING([--enable-thread-safe-observer-pattern], >> [If enabled, thread-safe version of the >> observer pattern will be used. You should >> enable it if you want to use QuantLib >> via the SWIG layer within the JVM or .NET >> eco system or any environment with an >> async garbage collector. C++-17 is required >> if this option is used together with >> --enable-std-pointers]), >> [ql_use_tsop=$enableval], >> [ql_use_tsop=no]) >> AC_MSG_RESULT([$ql_use_tsop]) >> if test "$ql_use_tsop" = "yes" ; then >> AC_DEFINE([QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN],[1], >> [Define this if you want to enable >> thread-safe observer pattern.]) >> fi >> >> AC_MSG_CHECKING([whether to enable thread-safe singleton initialization]) >> AC_ARG_ENABLE([thread-safe-singleton-init], >> AS_HELP_STRING([--enable-thread-safe-singleton-init], >> [If enabled, singleton initialization will >> be thread-safe. This requires Boost 1.58 >> or later. Note that --enable-sessions >> implies thread-safe initialization, >> whether this is defined or not]), >> [ql_use_safe_singleton_init=$enableval], >> [ql_use_safe_singleton_init=no]) >> if test "$ql_use_safe_singleton_init" = "yes" ; then >> AC_DEFINE([QL_ENABLE_SINGLETON_THREAD_SAFE_INIT],[1], >> [Define this if you want thread-safe singleton initialization.]) >> fi >> AC_MSG_RESULT([$ql_use_safe_singleton_init]) >> >> if test "$ql_use_sessions" = "yes" || test "$ql_use_tsop" = "yes" || >> test "$ql_use_safe_singleton_init" = "yes"; then >> QL_CHECK_BOOST_VERSION_1_58_OR_HIGHER >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM >> else >> AC_SUBST([BOOST_THREAD_LIB],[""]) >> fi >> >> AC_MSG_CHECKING([whether to enable parallel unit test runner]) >> AC_ARG_ENABLE([parallel-unit-test-runner], >> AS_HELP_STRING([--enable-parallel-unit-test-runner], >> [If enabled, a parallel unit test runner is used >> to execute the C++ test suite. This will reduce >> the runtime on multi core CPUs.]), >> [ql_use_parallel_test=$enableval], >> [ql_use_parallel_test=no]) >> AC_MSG_RESULT([$ql_use_parallel_test]) >> if test "$ql_use_parallel_test" = "yes" ; then >> AC_DEFINE([QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER],[1], >> [Define this if you want to enable >> the parallel unit test runner.]) >> QL_CHECK_BOOST_VERSION_1_59_OR_HIGHER >> if test "$ql_use_tsop" != "yes" ; then >> QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM >> fi >> QL_CHECK_BOOST_TEST_INTERPROCESS >> else >> AC_SUBST([BOOST_INTERPROCESS_LIB],[""]) >> fi >> >> AC_MSG_CHECKING([whether to install examples]) >> AC_ARG_ENABLE([examples], >> AS_HELP_STRING([--enable-examples], >> [If enabled, examples are built and installed >> when "make" and "make install" are invoked. >> If disabled (the default) they are built >> but not installed.]), >> [ql_install_examples=$enableval], >> [ql_install_examples=no]) >> AM_CONDITIONAL(AUTO_EXAMPLES, test "$ql_install_examples" != "no") >> AC_MSG_RESULT([$ql_install_examples]) >> >> AC_MSG_CHECKING([whether to install the benchmark]) >> AC_ARG_ENABLE([benchmark], >> AS_HELP_STRING([--enable-benchmark], >> [If enabled, the benchmark is built and >> installed when "make" and "make install" >> are invoked. If disabled (the default) >> it is built but not installed.]), >> [ql_install_benchmark=$enableval], >> [ql_install_benchmark=no]) >> AM_CONDITIONAL(AUTO_BENCHMARK, test "$ql_install_benchmark" != "no") >> AC_MSG_RESULT([$ql_install_benchmark]) >> >> AC_MSG_CHECKING([whether to use unity build]) >> AC_ARG_ENABLE([unity-build], >> AS_HELP_STRING([--enable-unity-build], >> [If enabled, the source files in each directory >> are collected into one single source file and >> compiled together. This can speed up the >> compilation of the library. >> If disabled (the default) each source file is >> compiled separately..]), >> [ql_use_unity_build=$enableval], >> [ql_use_unity_build=no]) >> AM_CONDITIONAL(UNITY_BUILD, test "$ql_use_unity_build" != "no") >> AC_MSG_RESULT([$ql_use_unity_build]) >> >> AC_MSG_CHECKING([whether to enable intraday date and daycounters]) >> AC_ARG_ENABLE([intraday], >> AS_HELP_STRING([--enable-intraday], >> [If enabled, date objects will support an intraday >> datetime resolution down to microseconds. >> Strickly monotone daycounters (Actual360, >> Actual365Fixed and ActualActual) will take >> the additional information into account >> and allow for accurate intraday pricing. >> If disabled (the default) the smallest >> resolution of date objects will be a single day. >> Intraday datetime resolution is experimental.]), >> [ql_use_intraday=$enableval], >> [ql_use_intraday=no]) >> if test "$ql_use_intraday" = "yes" ; then >> AC_DEFINE([QL_HIGH_RESOLUTION_DATE],[1], >> [Define this if you want to enable high resolution date class.]) >> fi >> AC_MSG_RESULT([$ql_use_intraday]) >> >> AC_MSG_CHECKING([whether to enable standard smart pointers]) >> AC_ARG_ENABLE([std-pointers], >> AS_HELP_STRING([--enable-std-pointers], >> [If enabled, std::shared_ptr and related >> classes and functions will be used instead >> of boost::shared_ptr. >> If disabled (the default) the Boost facilities >> are used. >> Note that std::shared_ptr does not check >> access and can cause segmentation faults.]), >> [ql_use_std_pointers=$enableval], >> [ql_use_std_pointers=no]) >> if test "$ql_use_std_pointers" = "yes" ; then >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], >> [Define this if you want to use standard smart pointers.]) >> fi >> AC_MSG_RESULT([$ql_use_std_pointers]) >> >> AC_MSG_CHECKING([whether to enable std::unique_ptr instead of std::auto_ptr]) >> AC_ARG_ENABLE([std-unique-ptr], >> AS_HELP_STRING([--enable-std-unique-ptr], >> [If enabled (the default), std::unique_ptr will >> be used instead of the deprecated std::auto_ptr. >> If disabled, std::auto_ptr will still be used.]), >> [ql_use_unique_ptr=$enableval], >> [ql_use_unique_ptr=yes]) >> if test "$ql_use_unique_ptr" = "yes" ; then >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], >> [Define this if you want to replace std::auto_ptr with >> std::unique_ptr.]) >> fi >> AC_MSG_RESULT([$ql_use_unique_ptr]) >> >> AC_MSG_CHECKING([whether to enable std::function]) >> AC_ARG_ENABLE([std-function], >> AS_HELP_STRING([--enable-std-function], >> [If enabled, std::function and std::bind will be >> used instead of boost::function and boost::bind. >> If disabled (the default) the Boost facilities >> are used.]), >> [ql_use_std_function=$enableval], >> [ql_use_std_function=no]) >> if test "$ql_use_std_function" = "yes" ; then >> AC_DEFINE([QL_USE_STD_FUNCTION],[1], >> [Define this if you want to use std::function and std::bind.]) >> fi >> AC_MSG_RESULT([$ql_use_std_function]) >> >> >> AC_MSG_CHECKING([whether to enable std::tuple]) >> AC_ARG_ENABLE([std-tuple], >> AS_HELP_STRING([--enable-std-tuple], >> [If enabled, std::tuple and related functions >> will be used instead of boost::tuple. >> If disabled (the default) the Boost facilities >> are used.]), >> [ql_use_std_tuple=$enableval], >> [ql_use_std_tuple=no]) >> if test "$ql_use_std_tuple" = "yes" ; then >> AC_DEFINE([QL_USE_STD_TUPLE],[1], >> [Define this if you want to use std::tuple.]) >> fi >> AC_MSG_RESULT([$ql_use_std_pointers]) >> >> AC_MSG_CHECKING([whether to enable available std classes]) >> AC_ARG_ENABLE([std-classes], >> AS_HELP_STRING([--enable-std-classes], >> [This is a shortcut for --enable-std-pointers >> --enable-std-unique-ptr --enable-std-function >> --enable-std-tuple. >> If enabled, this supersedes any --disable >> option passed for the above.]), >> [ql_use_std_classes=$enableval], >> [ql_use_std_classes=no]) >> if test "$ql_use_std_classes" = "yes" ; then >> AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], >> [Define this if you want to use standard smart pointers.]) >> AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], >> [Define this if you want to replace std::auto_ptr with >> std::unique_ptr.]) >> AC_DEFINE([QL_USE_STD_FUNCTION],[1], >> [Define this if you want to use std::function and std::bind.]) >> AC_DEFINE([QL_USE_STD_TUPLE],[1], >> [Define this if you want to use std::tuple.]) >> fi >> AC_MSG_RESULT([$ql_use_std_classes]) >> >> >> AC_MSG_CHECKING([whether to enable the Disposable class template]) >> AC_ARG_ENABLE([disposable], >> AS_HELP_STRING([--enable-disposable], >> [If enabled, the Disposable class >> template will be used; >> this should be no longer necessary in C++11 >> and might interfere with compiler optimizations. >> If disabled (the default) the class will only >> be an alias for the underlying type.]), >> [ql_use_disposable=$enableval], >> [ql_use_disposable=no]) >> if test "$ql_use_disposable" = "yes" ; then >> AC_DEFINE([QL_USE_DISPOSABLE],[1], >> [Define this if you want to use the Disposable class template.]) >> fi >> AC_MSG_RESULT([$ql_use_disposable]) >> >> >> # manual configurations for specific hosts >> case $host in >> powerpc-apple-darwin*) >> AC_DEFINE([QL_PATCH_DARWIN],[1], >> [Define if running on a Mac OS X machine.]) >> ;; >> sparc-sun-solaris*) >> AC_DEFINE([QL_PATCH_SOLARIS],[1], >> [Define if running on a Sun Solaris machine.]) >> ;; >> esac >> >> >> # done, output the configured files >> AC_CONFIG_FILES([ >> Makefile >> ql/Makefile >> ql/cashflows/Makefile >> ql/currencies/Makefile >> ql/experimental/Makefile >> ql/experimental/amortizingbonds/Makefile >> ql/experimental/asian/Makefile >> ql/experimental/averageois/Makefile >> ql/experimental/barrieroption/Makefile >> ql/experimental/basismodels/Makefile >> ql/experimental/callablebonds/Makefile >> ql/experimental/catbonds/Makefile >> ql/experimental/commodities/Makefile >> ql/experimental/coupons/Makefile >> ql/experimental/credit/Makefile >> ql/experimental/exoticoptions/Makefile >> ql/experimental/finitedifferences/Makefile >> ql/experimental/forward/Makefile >> ql/experimental/fx/Makefile >> ql/experimental/inflation/Makefile >> ql/experimental/lattices/Makefile >> ql/experimental/math/Makefile >> ql/experimental/mcbasket/Makefile >> ql/experimental/models/Makefile >> ql/experimental/processes/Makefile >> ql/experimental/risk/Makefile >> ql/experimental/shortrate/Makefile >> ql/experimental/swaptions/Makefile >> ql/experimental/termstructures/Makefile >> ql/experimental/variancegamma/Makefile >> ql/experimental/varianceoption/Makefile >> ql/experimental/volatility/Makefile >> ql/indexes/Makefile >> ql/indexes/ibor/Makefile >> ql/indexes/inflation/Makefile >> ql/indexes/swap/Makefile >> ql/instruments/Makefile >> ql/instruments/bonds/Makefile >> ql/legacy/Makefile >> ql/legacy/libormarketmodels/Makefile >> ql/math/Makefile >> ql/math/copulas/Makefile >> ql/math/distributions/Makefile >> ql/math/integrals/Makefile >> ql/math/interpolations/Makefile >> ql/math/matrixutilities/Makefile >> ql/math/ode/Makefile >> ql/math/optimization/Makefile >> ql/math/randomnumbers/Makefile >> ql/math/solvers1d/Makefile >> ql/math/statistics/Makefile >> ql/methods/Makefile >> ql/methods/finitedifferences/Makefile >> ql/methods/finitedifferences/meshers/Makefile >> ql/methods/finitedifferences/operators/Makefile >> ql/methods/finitedifferences/schemes/Makefile >> ql/methods/finitedifferences/solvers/Makefile >> ql/methods/finitedifferences/stepconditions/Makefile >> ql/methods/finitedifferences/utilities/Makefile >> ql/methods/lattices/Makefile >> ql/methods/montecarlo/Makefile >> ql/models/Makefile >> ql/models/equity/Makefile >> ql/models/marketmodels/Makefile >> ql/models/marketmodels/browniangenerators/Makefile >> ql/models/marketmodels/callability/Makefile >> ql/models/marketmodels/correlations/Makefile >> ql/models/marketmodels/curvestates/Makefile >> ql/models/marketmodels/driftcomputation/Makefile >> ql/models/marketmodels/evolvers/Makefile >> ql/models/marketmodels/evolvers/volprocesses/Makefile >> ql/models/marketmodels/models/Makefile >> ql/models/marketmodels/pathwisegreeks/Makefile >> ql/models/marketmodels/products/Makefile >> ql/models/marketmodels/products/onestep/Makefile >> ql/models/marketmodels/products/multistep/Makefile >> ql/models/marketmodels/products/pathwise/Makefile >> ql/models/shortrate/Makefile >> ql/models/shortrate/calibrationhelpers/Makefile >> ql/models/shortrate/onefactormodels/Makefile >> ql/models/shortrate/twofactormodels/Makefile >> ql/models/volatility/Makefile >> ql/patterns/Makefile >> ql/pricingengines/Makefile >> ql/pricingengines/asian/Makefile >> ql/pricingengines/barrier/Makefile >> ql/pricingengines/basket/Makefile >> ql/pricingengines/bond/Makefile >> ql/pricingengines/capfloor/Makefile >> ql/pricingengines/cliquet/Makefile >> ql/pricingengines/credit/Makefile >> ql/pricingengines/forward/Makefile >> ql/pricingengines/inflation/Makefile >> ql/pricingengines/lookback/Makefile >> ql/pricingengines/quanto/Makefile >> ql/pricingengines/swap/Makefile >> ql/pricingengines/swaption/Makefile >> ql/pricingengines/vanilla/Makefile >> ql/processes/Makefile >> ql/quotes/Makefile >> ql/termstructures/Makefile >> ql/termstructures/credit/Makefile >> ql/termstructures/inflation/Makefile >> ql/termstructures/volatility/Makefile >> ql/termstructures/volatility/equityfx/Makefile >> ql/termstructures/volatility/capfloor/Makefile >> ql/termstructures/volatility/inflation/Makefile >> ql/termstructures/volatility/optionlet/Makefile >> ql/termstructures/volatility/swaption/Makefile >> ql/termstructures/yield/Makefile >> ql/time/Makefile >> ql/time/calendars/Makefile >> ql/time/daycounters/Makefile >> ql/utilities/Makefile >> man/Makefile >> m4/Makefile >> Docs/Makefile >> Examples/Makefile >> test-suite/Makefile]) >> AC_CONFIG_FILES([quantlib-config],[chmod +x quantlib-config]) >> AC_CONFIG_FILES([QuantLib.spec]) >> AC_CONFIG_FILES([quantlib.pc]) >> AC_OUTPUT >> >> On Tue, 3 May 2022 at 16:43, Conrad Cole <con...@gm...> wrote: >> > >> > ./configure --with-boost-include=usr/include/boost >> > --with-boost-lib=/usr/lib/x86_64-linux-gnu >> > >> > The config.log file should be in whatever directory you ran the >> > configure script. >> > >> > On 5/3/22 06:55, Daniel Lobo wrote: >> > > Also, given that my boost location is /usr/include/boost, how can I >> > > execute ./configure again with the boost lib and include flags using >> > > the proper directories? What will be the right code? >> > > >> > > Thanks, >> > > >> > > On Tue, 3 May 2022 at 15:54, Daniel Lobo <dan...@gm...> wrote: >> > >> Many thanks for your responses. >> > >> >> > >> whereis boost returns below location, >> > >> >> > >> $ whereis boost >> > >> boost: /usr/include/boost >> > >> >> > >> Where can I see the generated config.log file? >> > >> >> > >> Thanks for your time. >> > >> >> > >> >> > >> On Tue, 3 May 2022 at 03:29, Conrad Cole <con...@gm...> wrote: >> > >>> whereis boost is the command to find the location of the installed boost header files. >> > >>> >> > >>> On 5/2/22 17:08, Luigi Ballabio wrote: >> > >>> >> > >>> Can you look inside the generated config.log file and see what compiler error you're getting exactly? >> > >>> >> > >>> Luigi >> > >>> >> > >>> >> > >>> On Mon, May 2, 2022 at 7:49 PM Daniel Lobo <dan...@gm...> wrote: >> > >>>> Many thanks. >> > >>>> >> > >>>> I ran below codes to remove and reinstall boost >> > >>>> >> > >>>> sudo apt-get remove libboost-all-dev >> > >>>> sudo apt-get install libboost-all-dev >> > >>>> >> > >>>> boost installed in /usr/include >> > >>>> >> > >>>> :/usr/include$ ls >> > >>>> aio.h complex.h error.h features-time64.h getopt.h >> > >>>> langinfo.h math.h netdb.h numa.h >> > >>>> python3.10 setjmp.h string.h time.h video >> > >>>> aliases.h cpio.h evdns.h fenv.h glob.h >> > >>>> lastlog.h mcheck.h neteconet numaif.h rdma >> > >>>> sgtty.h strings.h tirpc wait.h >> > >>>> alloca.h crypt.h event2 finclude >> > >>>> gnu-versions.h libgen.h memory.h netinet obstack.h >> > >>>> re_comp.h shadow.h sudo_plugin.h ttyent.h wchar.h >> > >>>> argp.h ctype.h event.h fmtmsg.h grp.h >> > >>>> libintl.h misc netipx openvpn regex.h >> > >>>> signal.h syscall.h uchar.h wctype.h >> > >>>> argz.h dirent.h evhttp.h fnmatch.h gshadow.h >> > >>>> libltdl mntent.h netiucv paths.h regexp.h >> > >>>> sound sysexits.h ucontext.h wordexp.h >> > >>>> ar.h dlfcn.h evrpc.h fstab.h hwloc >> > >>>> libnl3 monetary.h netpacket poll.h resolv.h >> > >>>> spawn.h syslog.h ulimit.h X11 >> > >>>> arpa drm evutil.h fts.h hwloc.h >> > >>>> limits.h mqueue.h netrom printf.h rpc >> > >>>> stab.h tar.h unicode x86_64-linux-gnu >> > >>>> asm-generic elf.h execinfo.h ftw.h iconv.h >> > >>>> link.h mtd netrose proc_service.h rpcsvc >> > >>>> stdc-predef.h termio.h unistd.h xen >> > >>>> assert.h endian.h expat_external.h gcalc-2 ifaddrs.h >> > >>>> linux net nfs protocols sched.h >> > >>>> stdint.h termios.h utime.h xorg >> > >>>> boost >> > >>>> >> > >>>> But still get error when I run ./configure >> > >>>> >> > >>>> Below is the log that I get >> > >>>> >> > >>>> $ ./configure >> > >>>> checking for a BSD-compatible install... /usr/bin/install -c >> > >>>> checking whether build environment is sane... yes >> > >>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p >> > >>>> checking for gawk... no >> > >>>> checking for mawk... mawk >> > >>>> checking whether make sets $(MAKE)... no >> > >>>> checking whether make supports nested variables... no >> > >>>> checking whether UID '1000' is supported by ustar format... yes >> > >>>> checking whether GID '1000' is supported by ustar format... yes >> > >>>> checking how to create a ustar tar archive... gnutar >> > >>>> checking for gawk... (cached) mawk >> > >>>> checking for gcc... gcc >> > >>>> checking whether the C compiler works... yes >> > >>>> checking for C compiler default output file name... a.out >> > >>>> checking for suffix of executables... >> > >>>> checking whether we are cross compiling... no >> > >>>> checking for suffix of object files... o >> > >>>> checking whether the compiler supports GNU C... yes >> > >>>> checking whether gcc accepts -g... yes >> > >>>> checking for gcc option to enable C11 features... none needed >> > >>>> checking whether gcc understands -c and -o together... yes >> > >>>> checking whether make supports the include directive... no >> > >>>> checking dependency style of gcc... none >> > >>>> checking for g++... no >> > >>>> checking for c++... no >> > >>>> checking for gpp... no >> > >>>> checking for aCC... no >> > >>>> checking for CC... no >> > >>>> checking for cxx... no >> > >>>> checking for cc++... no >> > >>>> checking for cl.exe... no >> > >>>> checking for FCC... no >> > >>>> checking for KCC... no >> > >>>> checking for RCC... no >> > >>>> checking for xlC_r... no >> > >>>> checking for xlC... no >> > >>>> checking for clang++... no >> > >>>> checking whether the compiler supports GNU C++... no >> > >>>> checking whether g++ accepts -g... no >> > >>>> checking for g++ option to enable C++11 features... none needed >> > >>>> checking dependency style of g++... none >> > >>>> checking how to run the C preprocessor... gcc -E >> > >>>> checking build system type... x86_64-pc-linux-gnu >> > >>>> checking host system type... x86_64-pc-linux-gnu >> > >>>> checking how to print strings... printf >> > >>>> checking for a sed that does not truncate output... /usr/bin/sed >> > >>>> checking for grep that handles long lines and -e... /usr/bin/grep >> > >>>> checking for egrep... /usr/bin/grep -E >> > >>>> checking for fgrep... /usr/bin/grep -F >> > >>>> checking for ld used by gcc... /usr/bin/ld >> > >>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >> > >>>> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> > >>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> > >>>> checking whether ln -s works... yes >> > >>>> checking the maximum length of command line arguments... 1572864 >> > >>>> checking how to convert x86_64-pc-linux-gnu file names to >> > >>>> x86_64-pc-linux-gnu format... func_convert_file_noop >> > >>>> checking how to convert x86_64-pc-linux-gnu file names to toolchain >> > >>>> format... func_convert_file_noop >> > >>>> checking for /usr/bin/ld option to reload object files... -r >> > >>>> checking for objdump... objdump >> > >>>> checking how to recognize dependent libraries... pass_all >> > >>>> checking for dlltool... no >> > >>>> checking how to associate runtime and link libraries... printf %s\n >> > >>>> checking for ar... ar >> > >>>> checking for archiver @FILE support... @ >> > >>>> checking for strip... strip >> > >>>> checking for ranlib... ranlib >> > >>>> checking command to parse /usr/bin/nm -B output from gcc object... ok >> > >>>> checking for sysroot... no >> > >>>> checking for a working dd... /usr/bin/dd >> > >>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 >> > >>>> checking for mt... mt >> > >>>> checking if mt is a manifest tool... no >> > >>>> checking for stdio.h... yes >> > >>>> checking for stdlib.h... yes >> > >>>> checking for string.h... yes >> > >>>> checking for inttypes.h... yes >> > >>>> checking for stdint.h... yes >> > >>>> checking for strings.h... yes >> > >>>> checking for sys/stat.h... yes >> > >>>> checking for sys/types.h... yes >> > >>>> checking for unistd.h... yes >> > >>>> checking for dlfcn.h... yes >> > >>>> checking for objdir... .libs >> > >>>> checking if gcc supports -fno-rtti -fno-exceptions... no >> > >>>> checking for gcc option to produce PIC... -fPIC -DPIC >> > >>>> checking if gcc PIC flag -fPIC -DPIC works... yes >> > >>>> checking if gcc static flag -static works... yes >> > >>>> checking if gcc supports -c -o file.o... yes >> > >>>> checking if gcc supports -c -o file.o... (cached) yes >> > >>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> > >>>> shared libraries... yes >> > >>>> checking whether -lc should be explicitly linked in... no >> > >>>> checking dynamic linker characteristics... GNU/Linux ld.so >> > >>>> checking how to hardcode library paths into programs... immediate >> > >>>> checking whether stripping libraries is possible... yes >> > >>>> checking if libtool supports shared libraries... yes >> > >>>> checking whether to build shared libraries... yes >> > >>>> checking whether to build static libraries... yes >> > >>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS >> > >>>> checking for Boost development files... no >> > >>>> configure: error: Boost development files not found >> > >>>> >> > >>>> >> > >>>> Any pointer how to resolve this will be very helpful. >> > >>>> >> > >>>> Thanks >> > >>>> >> > >>>> On Sun, 1 May 2022 at 13:16, Jonathan Sweemer <sw...@gm...> wrote: >> > >>>>> Hi Daniel, >> > >>>>> >> > >>>>> Just to confirm, you’re no longer running ./configure with the —with-boost-include and —with-boost-lib flags right? >> > >>>>> >> > >>>>> If so then I would expect the configure script to find your boost installation. Please check that you see boost headers in /usr/include/boost and if not, try reinstalling boost. >> > >>>>> >> > >>>>> If you’re still unable to get ./configure to find boost then please attach the full output including all the commands that you ran. >> > >>>>> >> > >>>>> Jonathan >> > >>>>> >> > >>>>> >> > >>>>> 2022년 5월 1일 (일) 15:41, Daniel Lobo <dan...@gm...>님이 작성: >> > >>>>>> Hi, >> > >>>>>> >> > >>>>>> Many thanks for your response. >> > >>>>>> >> > >>>>>> Yes I ran 'sudo apt-get install libboost-all-dev' to install boost. >> > >>>>>> However still I get this error. >> > >>>>>> >> > >>>>>> How can I find where the boost is installed and how can I pass that >> > >>>>>> information './configure ' line? >> > >>>>>> >> > >>>>>> Apologies for trivial question if any, as I am not very expert in >> > >>>>>> Linux ecosystem. >> > >>>>>> >> > >>>>>> Thanks and regards, >> > >>>>>> >> > >>>>>> On Sun, 1 May 2022 at 11:53, Jonathan Sweemer <sw...@gm...> wrote: >> > >>>>>>> Hi Daniel, >> > >>>>>>> >> > >>>>>>> When you say that you “install[ed] boost already as provided in the instruction page” do you mean that you ran the following command? >> > >>>>>>> >> > >>>>>>> sudo apt-get install libboost-all-dev >> > >>>>>>> >> > >>>>>>> If so then you shouldn’t need to use the —with-boost-include and —with-boost-lib flags when configuring QuantLib. As the install guide mentions, you only need those flags when you install boost in a non-standard location. >> > >>>>>>> >> > >>>>>>> Jonathan >> > >>>>>>> >> > >>>>>>> >> > >>>>>>> 2022년 5월 1일 (일) 02:25, Daniel Lobo <dan...@gm...>님이 작성: >> > >>>>>>>> Hi, >> > >>>>>>>> >> > >>>>>>>> I am trying to install Quantlib in my Ubuntu VM. I was following the >> > >>>>>>>> instructions as provided in >> > >>>>>>>> https://www.quantlib.org/install/linux.shtml >> > >>>>>>>> >> > >>>>>>>> But this installation failed when I executed >> > >>>>>>>> >> > >>>>>>>> ./configure --with-boost-include=/home/foo/include >> > >>>>>>>> --with-boost-lib=/home/foo/lib >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>> The error I got is >> > >>>>>>>> >> > >>>>>>>> $ ./configure --with-boost-include=/home/foo/include >> > >>>>>>>> --with-boost-lib=/home/foo/lib >> > >>>>>>>> checking for a BSD-compatible install... /usr/bin/install -c >> > >>>>>>>> checking whether build environment is sane... yes >> > >>>>>>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p >> > >>>>>>>> checking for gawk... no >> > >>>>>>>> checking for mawk... mawk >> > >>>>>>>> checking whether make sets $(MAKE)... no >> > >>>>>>>> checking whether make supports nested variables... no >> > >>>>>>>> checking whether UID '1000' is supported by ustar format... yes >> > >>>>>>>> checking whether GID '1000' is supported by ustar format... yes >> > >>>>>>>> checking how to create a ustar tar archive... gnutar >> > >>>>>>>> checking for gawk... (cached) mawk >> > >>>>>>>> checking for gcc... gcc >> > >>>>>>>> checking whether the C compiler works... yes >> > >>>>>>>> checking for C compiler default output file name... a.out >> > >>>>>>>> checking for suffix of executables... >> > >>>>>>>> checking whether we are cross compiling... no >> > >>>>>>>> checking for suffix of object files... o >> > >>>>>>>> checking whether the compiler supports GNU C... yes >> > >>>>>>>> checking whether gcc accepts -g... yes >> > >>>>>>>> checking for gcc option to enable C11 features... none needed >> > >>>>>>>> checking whether gcc understands -c and -o together... yes >> > >>>>>>>> checking whether make supports the include directive... no >> > >>>>>>>> checking dependency style of gcc... none >> > >>>>>>>> checking for g++... no >> > >>>>>>>> checking for c++... no >> > >>>>>>>> checking for gpp... no >> > >>>>>>>> checking for aCC... no >> > >>>>>>>> checking for CC... no >> > >>>>>>>> checking for cxx... no >> > >>>>>>>> checking for cc++... no >> > >>>>>>>> checking for cl.exe... no >> > >>>>>>>> checking for FCC... no >> > >>>>>>>> checking for KCC... no >> > >>>>>>>> checking for RCC... no >> > >>>>>>>> checking for xlC_r... no >> > >>>>>>>> checking for xlC... no >> > >>>>>>>> checking for clang++... no >> > >>>>>>>> checking whether the compiler supports GNU C++... no >> > >>>>>>>> checking whether g++ accepts -g... no >> > >>>>>>>> checking for g++ option to enable C++11 features... none needed >> > >>>>>>>> checking dependency style of g++... none >> > >>>>>>>> checking how to run the C preprocessor... gcc -E >> > >>>>>>>> checking build system type... x86_64-pc-linux-gnu >> > >>>>>>>> checking host system type... x86_64-pc-linux-gnu >> > >>>>>>>> checking how to print strings... printf >> > >>>>>>>> checking for a sed that does not truncate output... /usr/bin/sed >> > >>>>>>>> checking for grep that handles long lines and -e... /usr/bin/grep >> > >>>>>>>> checking for egrep... /usr/bin/grep -E >> > >>>>>>>> checking for fgrep... /usr/bin/grep -F >> > >>>>>>>> checking for ld used by gcc... /usr/bin/ld >> > >>>>>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes >> > >>>>>>>> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B >> > >>>>>>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm >> > >>>>>>>> checking whether ln -s works... yes >> > >>>>>>>> checking the maximum length of command line arguments... 1572864 >> > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to >> > >>>>>>>> x86_64-pc-linux-gnu format... func_convert_file_noop >> > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to toolchain >> > >>>>>>>> format... func_convert_file_noop >> > >>>>>>>> checking for /usr/bin/ld option to reload object files... -r >> > >>>>>>>> checking for objdump... objdump >> > >>>>>>>> checking how to recognize dependent libraries... pass_all >> > >>>>>>>> checking for dlltool... no >> > >>>>>>>> checking how to associate runtime and link libraries... printf %s\n >> > >>>>>>>> checking for ar... ar >> > >>>>>>>> checking for archiver @FILE support... @ >> > >>>>>>>> checking for strip... strip >> > >>>>>>>> checking for ranlib... ranlib >> > >>>>>>>> checking command to parse /usr/bin/nm -B output from gcc object... ok >> > >>>>>>>> checking for sysroot... no >> > >>>>>>>> checking for a working dd... /usr/bin/dd >> > >>>>>>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 >> > >>>>>>>> checking for mt... mt >> > >>>>>>>> checking if mt is a manifest tool... no >> > >>>>>>>> checking for stdio.h... yes >> > >>>>>>>> checking for stdlib.h... yes >> > >>>>>>>> checking for string.h... yes >> > >>>>>>>> checking for inttypes.h... yes >> > >>>>>>>> checking for stdint.h... yes >> > >>>>>>>> checking for strings.h... yes >> > >>>>>>>> checking for sys/stat.h... yes >> > >>>>>>>> checking for sys/types.h... yes >> > >>>>>>>> checking for unistd.h... yes >> > >>>>>>>> checking for dlfcn.h... yes >> > >>>>>>>> checking for objdir... .libs >> > >>>>>>>> checking if gcc supports -fno-rtti -fno-exceptions... no >> > >>>>>>>> checking for gcc option to produce PIC... -fPIC -DPIC >> > >>>>>>>> checking if gcc PIC flag -fPIC -DPIC works... yes >> > >>>>>>>> checking if gcc static flag -static works... yes >> > >>>>>>>> checking if gcc supports -c -o file.o... yes >> > >>>>>>>> checking if gcc supports -c -o file.o... (cached) yes >> > >>>>>>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports >> > >>>>>>>> shared libraries... yes >> > >>>>>>>> checking whether -lc should be explicitly linked in... no >> > >>>>>>>> checking dynamic linker characteristics... GNU/Linux ld.so >> > >>>>>>>> checking how to hardcode library paths into programs... immediate >> > >>>>>>>> checking whether stripping libraries is possible... yes >> > >>>>>>>> checking if libtool supports shared libraries... yes >> > >>>>>>>> checking whether to build shared libraries... yes >> > >>>>>>>> checking whether to build static libraries... yes >> > >>>>>>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS >> > >>>>>>>> checking for Boost development files... no >> > >>>>>>>> configure: error: Boost development files not found >> > >>>>>>>> >> > >>>>>>>> Could you please help how to resolve this error. I executed the code >> > >>>>>>>> to install boost already as provided in the instruction page. >> > >>>>>>>> >> > >>>>>>>> >> > >>>>>>>> _______________________________________________ >> > >>>>>>>> QuantLib-users mailing list >> > >>>>>>>> Qua...@li... >> > >>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > >>>> >> > >>>> _______________________________________________ >> > >>>> QuantLib-users mailing list >> > >>>> Qua...@li... >> > >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> > >>> >> > >>> >> > >>> _______________________________________________ >> > >>> QuantLib-users mailing list >> > >>> Qua...@li... >> > >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Luigi B. <lui...@gm...> - 2022-05-04 07:55:32
|
configure.ac is an input used to build configure itself. You need to look at config.log in the directory where you ran ./configure On Wed, May 4, 2022 at 6:50 AM Daniel Lobo <dan...@gm...> wrote: > Hi, > > I still get the same error message as below, > > $ ./configure --with-boost-include=usr/include/boost > --with-boost-lib=/usr/lib/x86_64-linux-gnu > checking for a BSD-compatible install... /usr/bin/install -c > checking whether build environment is sane... yes > checking for a race-free mkdir -p... /usr/bin/mkdir -p > checking for gawk... no > checking for mawk... mawk > checking whether make sets $(MAKE)... no > checking whether make supports nested variables... no > checking whether UID '1000' is supported by ustar format... yes > checking whether GID '1000' is supported by ustar format... yes > checking how to create a ustar tar archive... gnutar > checking for gawk... (cached) mawk > checking for gcc... gcc > checking whether the C compiler works... yes > checking for C compiler default output file name... a.out > checking for suffix of executables... > checking whether we are cross compiling... no > checking for suffix of object files... o > checking whether the compiler supports GNU C... yes > checking whether gcc accepts -g... yes > checking for gcc option to enable C11 features... none needed > checking whether gcc understands -c and -o together... yes > checking whether make supports the include directive... no > checking dependency style of gcc... none > checking for g++... no > checking for c++... no > checking for gpp... no > checking for aCC... no > checking for CC... no > checking for cxx... no > checking for cc++... no > checking for cl.exe... no > checking for FCC... no > checking for KCC... no > checking for RCC... no > checking for xlC_r... no > checking for xlC... no > checking for clang++... no > checking whether the compiler supports GNU C++... no > checking whether g++ accepts -g... no > checking for g++ option to enable C++11 features... none needed > checking dependency style of g++... none > checking how to run the C preprocessor... gcc -E > checking build system type... x86_64-pc-linux-gnu > checking host system type... x86_64-pc-linux-gnu > checking how to print strings... printf > checking for a sed that does not truncate output... /usr/bin/sed > checking for grep that handles long lines and -e... /usr/bin/grep > checking for egrep... /usr/bin/grep -E > checking for fgrep... /usr/bin/grep -F > checking for ld used by gcc... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B > checking the name lister (/usr/bin/nm -B) interface... BSD nm > checking whether ln -s works... yes > checking the maximum length of command line arguments... 1572864 > checking how to convert x86_64-pc-linux-gnu file names to > x86_64-pc-linux-gnu format... func_convert_file_noop > checking how to convert x86_64-pc-linux-gnu file names to toolchain > format... func_convert_file_noop > checking for /usr/bin/ld option to reload object files... -r > checking for objdump... objdump > checking how to recognize dependent libraries... pass_all > checking for dlltool... no > checking how to associate runtime and link libraries... printf %s\n > checking for ar... ar > checking for archiver @FILE support... @ > checking for strip... strip > checking for ranlib... ranlib > checking command to parse /usr/bin/nm -B output from gcc object... ok > checking for sysroot... no > checking for a working dd... /usr/bin/dd > checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 > checking for mt... mt > checking if mt is a manifest tool... no > checking for stdio.h... yes > checking for stdlib.h... yes > checking for string.h... yes > checking for inttypes.h... yes > checking for stdint.h... yes > checking for strings.h... yes > checking for sys/stat.h... yes > checking for sys/types.h... yes > checking for unistd.h... yes > checking for dlfcn.h... yes > checking for objdir... .libs > checking if gcc supports -fno-rtti -fno-exceptions... no > checking for gcc option to produce PIC... -fPIC -DPIC > checking if gcc PIC flag -fPIC -DPIC works... yes > checking if gcc static flag -static works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.o... (cached) yes > checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports > shared libraries... yes > checking whether -lc should be explicitly linked in... no > checking dynamic linker characteristics... GNU/Linux ld.so > checking how to hardcode library paths into programs... immediate > checking whether stripping libraries is possible... yes > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... yes > checking for C++11 support... no: adding -std=c++11 to CXXFLAGS > checking for Boost development files... no > configure: error: Boost development files not found > > Below is the outputs from configure file (configure.ac) > > # Process this file with autoconf to produce a configure script. > AC_INIT([QuantLib], [1.26], > [qua...@li...], > [QuantLib]) > AC_PREREQ(2.62) > AC_CONFIG_SRCDIR([ql/qldefines.hpp]) > AC_CONFIG_AUX_DIR([config]) > AC_CONFIG_HEADERS([ql/config.hpp]) > AM_INIT_AUTOMAKE([foreign nostdinc subdir-objects tar-ustar]) > AC_CONFIG_MACRO_DIR([m4]) > > AC_COPYRIGHT([ > Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl > Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 StatPro > Italia srl > Copyright (C) 2004, 2005 Ferdinando Ametrano > > This file is part of QuantLib, a free-software/open-source library > for financial quantitative analysts and developers - http://quantlib.org/ > > QuantLib is free software: you can redistribute it and/or modify it > under the terms of the QuantLib license. You should have received a > copy of the license along with this program; if not, please email > <qua...@li...>. The license is also available online at > <http://quantlib.org/license.shtml>. > > This program is distributed in the hope that it will be useful, but WITHOUT > ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or > FITNESS > FOR A PARTICULAR PURPOSE. See the license for more details.]) > > AC_PROG_AWK > AC_PROG_INSTALL > > # Help the compiler find external software > > AC_ARG_WITH([boost-include], > AS_HELP_STRING([--with-boost-include=INCLUDE_PATH], > [Supply the location of Boost header files]), > [ql_boost_include_path="`cd ${withval} 2>/dev/null && pwd`"], > [ql_boost_include_path=""]) > if test [ -n "$ql_boost_include_path" ] ; then > AC_SUBST([BOOST_INCLUDE],["-I${ql_boost_include_path}"]) > AC_SUBST([CPPFLAGS],["${CPPFLAGS} -I${ql_boost_include_path}"]) > fi > AC_ARG_WITH([boost-lib], > AS_HELP_STRING([--with-boost-lib=LIB_PATH], > [Supply the location of Boost libraries]), > [ql_boost_lib_path="`cd ${withval} 2>/dev/null && pwd`"], > [ql_boost_lib_path=""]) > if test [ -n "$ql_boost_lib_path" ] ; then > AC_SUBST([BOOST_LIB],["-L${ql_boost_lib_path}"]) > AC_SUBST([LDFLAGS],["${LDFLAGS} -L${ql_boost_lib_path}"]) > fi > > > # Continue setup > > AC_PROG_CC > AC_PROG_CXX > AC_PROG_CPP > LT_INIT > > AM_CONDITIONAL(ENABLE_STATIC, test "${enable_static}" == "yes") > > AC_LANG([C++]) > > AC_ARG_ENABLE([openmp], > AS_HELP_STRING([--enable-openmp], > [If enabled, configure will try to detect > and enable OpenMP support.]), > [ql_openmp=$enableval], > [ql_openmp=no]) > if test "$ql_openmp" = "yes" ; then > AC_OPENMP > AC_SUBST([CXXFLAGS],["${CXXFLAGS} ${OPENMP_CXXFLAGS}"]) > fi > > # Check for C++11 support > QL_CHECK_CPP11 > > # Check for Boost components > QL_CHECK_BOOST > AM_CONDITIONAL(BOOST_UNIT_TEST_FOUND, test "x${BOOST_UNIT_TEST_LIB}" != > "x") > > # Check for Emacs > AM_PATH_LISPDIR > AM_CONDITIONAL(EMACS_FOUND, test "${EMACS}" != "no") > > # Check for tools needed for building documentation > AC_PATH_PROG([DOXYGEN], [doxygen]) > AC_PATH_PROG([SED], [sed]) > AC_PATH_PROG([LATEX], [latex]) > AC_PATH_PROG([PDFLATEX], [pdflatex]) > AC_PATH_PROG([MAKEINDEX], [makeindex]) > AC_PATH_PROG([DVIPS], [dvips]) > > > # site configuration > > # AC_ARG_WITH([real], > # AS_HELP_STRING([--with-real=type], > # [The given type will be used for > floating-point > # calculations. > # In case this option is not invoked, double > # will be used.]), > # [AC_DEFINE_UNQUOTED([QL_REAL],[$withval], > # [Define this as the type to be used for > # floating-point calculations.])], > # [AC_DEFINE_UNQUOTED([QL_REAL],[double], > # [Define this as the type to be used for > # floating-point calculations.])]) > > # AC_ARG_WITH([integer], > # AS_HELP_STRING([--with-integer=type], > # [The given type will be used for integer > # calculations. At least an int is required. > # In case this option is not invoked, int > # will be used.]), > # [AC_DEFINE_UNQUOTED([QL_INTEGER],[$withval], > # [Define this as the type to be used for > # integer calculations. At least an int > # is required.])], > # [AC_DEFINE_UNQUOTED([QL_INTEGER],[int], > # [Define this as the type to be used for > # integer calculations. At least an int > # is required.])]) > > # AC_ARG_WITH([big-integer], > # AS_HELP_STRING([--with-big-integer=type], > # [The given type will be used for large integer > # calculations. At least 4 bytes are required. > # In case this option is not invoked, long > # will be used.]), > # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[$withval], > # [Define this as the type to be used for > # large integer calculations. At least > # 4 bytes are required.])], > # [AC_DEFINE_UNQUOTED([QL_BIG_INTEGER],[long], > # [Define this as the type to be used for > # large integer calculations. At least > # 4 bytes are required.])]) > > > AC_ARG_ENABLE([error-lines], > AS_HELP_STRING([--enable-error-lines], > [If enabled, file and line information is > added to the error messages thrown by > the library.]), > [ql_error_lines=$enableval], > [ql_error_lines=no]) > AC_MSG_CHECKING([whether to add file and line information to errors]) > if test "$ql_error_lines" = "yes" ; then > AC_DEFINE([QL_ERROR_LINES],[1], > [Define this if error messages should include file and line > information.]) > fi > AC_MSG_RESULT([$ql_error_lines]) > > AC_ARG_ENABLE([error-functions], > AS_HELP_STRING([--enable-error-functions], > [If enabled, current function information > is added to the error messages thrown by > the library.]), > [ql_error_functions=$enableval], > [ql_error_functions=no]) > AC_MSG_CHECKING([whether to add function information to errors]) > if test "$ql_error_functions" = "yes" ; then > AC_DEFINE([QL_ERROR_FUNCTIONS],[1], > [Define this if error messages should include current function > information.]) > fi > AC_MSG_RESULT([$ql_error_functions]) > > AC_ARG_ENABLE([tracing], > AS_HELP_STRING([--enable-tracing], > [If enabled, tracing messages might be emitted > by the library depending on run-time > settings. Enabling this option can degrade > performance.]), > [ql_tracing=$enableval], > [ql_tracing=no]) > AC_MSG_CHECKING([whether to enable tracing]) > if test "$ql_tracing" = "yes" ; then > AC_DEFINE([QL_ENABLE_TRACING],[1], > [Define this if tracing messages should allowed (whether they > are actually emitted will depend on run-time settings.)]) > fi > AC_MSG_RESULT([$ql_tracing]) > > AC_MSG_CHECKING([whether to enable indexed coupons]) > AC_ARG_ENABLE([indexed-coupons], > AS_HELP_STRING([--enable-indexed-coupons], > [If enabled, indexed coupons (see the > documentation) are used in floating legs. > If disabled (the default), par coupons > are used.]), > [ql_indexed_coupon=$enableval], > [ql_indexed_coupon=no]) > if test "$ql_indexed_coupon" = "yes" ; then > AC_DEFINE([QL_USE_INDEXED_COUPON],[1], > [Define this to use indexed coupons instead of par coupons in > floating legs.]) > fi > AC_MSG_RESULT([$ql_indexed_coupon]) > > AC_MSG_CHECKING([whether to enable extra safety checks]) > AC_ARG_ENABLE([extra-safety-checks], > AS_HELP_STRING([--enable-extra-safety-checks], > [If enabled, extra run-time checks are added > to a few functions. This can prevent their > inlining and degrade performance.]), > [ql_belt_and_braces=$enableval], > [ql_belt_and_braces=no]) > if test "$ql_belt_and_braces" = "yes" ; then > AC_DEFINE([QL_EXTRA_SAFETY_CHECKS],[1], > [Define this if extra safety checks should be performed. > This can degrade performance.]) > fi > AC_MSG_RESULT([$ql_belt_and_braces]) > > AC_MSG_CHECKING([whether to enable sessions]) > AC_ARG_ENABLE([sessions], > AS_HELP_STRING([--enable-sessions], > [If enabled, singletons will return different > instances for different sessions. You will > have to provide and link with the library > a sessionId() function in namespace QuantLib, > returning a different session id for each > session. This also implies thread-safe > Singleton initialization.]), > [ql_use_sessions=$enableval], > [ql_use_sessions=no]) > if test "$ql_use_sessions" = "yes" ; then > AC_DEFINE([QL_ENABLE_SESSIONS],[1], > [Define this if you want to enable sessions.]) > fi > AC_MSG_RESULT([$ql_use_sessions]) > > AC_MSG_CHECKING([whether to enable thread-safe observer pattern]) > AC_ARG_ENABLE([thread-safe-observer-pattern], > AS_HELP_STRING([--enable-thread-safe-observer-pattern], > [If enabled, thread-safe version of the > observer pattern will be used. You should > enable it if you want to use QuantLib > via the SWIG layer within the JVM or .NET > eco system or any environment with an > async garbage collector. C++-17 is required > if this option is used together with > --enable-std-pointers]), > [ql_use_tsop=$enableval], > [ql_use_tsop=no]) > AC_MSG_RESULT([$ql_use_tsop]) > if test "$ql_use_tsop" = "yes" ; then > AC_DEFINE([QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN],[1], > [Define this if you want to enable > thread-safe observer pattern.]) > fi > > AC_MSG_CHECKING([whether to enable thread-safe singleton initialization]) > AC_ARG_ENABLE([thread-safe-singleton-init], > AS_HELP_STRING([--enable-thread-safe-singleton-init], > [If enabled, singleton initialization will > be thread-safe. This requires Boost 1.58 > or later. Note that --enable-sessions > implies thread-safe initialization, > whether this is defined or not]), > [ql_use_safe_singleton_init=$enableval], > [ql_use_safe_singleton_init=no]) > if test "$ql_use_safe_singleton_init" = "yes" ; then > AC_DEFINE([QL_ENABLE_SINGLETON_THREAD_SAFE_INIT],[1], > [Define this if you want thread-safe singleton > initialization.]) > fi > AC_MSG_RESULT([$ql_use_safe_singleton_init]) > > if test "$ql_use_sessions" = "yes" || test "$ql_use_tsop" = "yes" || > test "$ql_use_safe_singleton_init" = "yes"; then > QL_CHECK_BOOST_VERSION_1_58_OR_HIGHER > QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM > else > AC_SUBST([BOOST_THREAD_LIB],[""]) > fi > > AC_MSG_CHECKING([whether to enable parallel unit test runner]) > AC_ARG_ENABLE([parallel-unit-test-runner], > AS_HELP_STRING([--enable-parallel-unit-test-runner], > [If enabled, a parallel unit test runner is > used > to execute the C++ test suite. This will > reduce > the runtime on multi core CPUs.]), > [ql_use_parallel_test=$enableval], > [ql_use_parallel_test=no]) > AC_MSG_RESULT([$ql_use_parallel_test]) > if test "$ql_use_parallel_test" = "yes" ; then > AC_DEFINE([QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER],[1], > [Define this if you want to enable > the parallel unit test runner.]) > QL_CHECK_BOOST_VERSION_1_59_OR_HIGHER > if test "$ql_use_tsop" != "yes" ; then > QL_CHECK_BOOST_TEST_THREAD_SIGNALS2_SYSTEM > fi > QL_CHECK_BOOST_TEST_INTERPROCESS > else > AC_SUBST([BOOST_INTERPROCESS_LIB],[""]) > fi > > AC_MSG_CHECKING([whether to install examples]) > AC_ARG_ENABLE([examples], > AS_HELP_STRING([--enable-examples], > [If enabled, examples are built and installed > when "make" and "make install" are invoked. > If disabled (the default) they are built > but not installed.]), > [ql_install_examples=$enableval], > [ql_install_examples=no]) > AM_CONDITIONAL(AUTO_EXAMPLES, test "$ql_install_examples" != "no") > AC_MSG_RESULT([$ql_install_examples]) > > AC_MSG_CHECKING([whether to install the benchmark]) > AC_ARG_ENABLE([benchmark], > AS_HELP_STRING([--enable-benchmark], > [If enabled, the benchmark is built and > installed when "make" and "make install" > are invoked. If disabled (the default) > it is built but not installed.]), > [ql_install_benchmark=$enableval], > [ql_install_benchmark=no]) > AM_CONDITIONAL(AUTO_BENCHMARK, test "$ql_install_benchmark" != "no") > AC_MSG_RESULT([$ql_install_benchmark]) > > AC_MSG_CHECKING([whether to use unity build]) > AC_ARG_ENABLE([unity-build], > AS_HELP_STRING([--enable-unity-build], > [If enabled, the source files in each > directory > are collected into one single source file and > compiled together. This can speed up the > compilation of the library. > If disabled (the default) each source file is > compiled separately..]), > [ql_use_unity_build=$enableval], > [ql_use_unity_build=no]) > AM_CONDITIONAL(UNITY_BUILD, test "$ql_use_unity_build" != "no") > AC_MSG_RESULT([$ql_use_unity_build]) > > AC_MSG_CHECKING([whether to enable intraday date and daycounters]) > AC_ARG_ENABLE([intraday], > AS_HELP_STRING([--enable-intraday], > [If enabled, date objects will support an > intraday > datetime resolution down to microseconds. > Strickly monotone daycounters (Actual360, > Actual365Fixed and ActualActual) will take > the additional information into account > and allow for accurate intraday pricing. > If disabled (the default) the smallest > resolution of date objects will be a single > day. > Intraday datetime resolution is > experimental.]), > [ql_use_intraday=$enableval], > [ql_use_intraday=no]) > if test "$ql_use_intraday" = "yes" ; then > AC_DEFINE([QL_HIGH_RESOLUTION_DATE],[1], > [Define this if you want to enable high resolution date > class.]) > fi > AC_MSG_RESULT([$ql_use_intraday]) > > AC_MSG_CHECKING([whether to enable standard smart pointers]) > AC_ARG_ENABLE([std-pointers], > AS_HELP_STRING([--enable-std-pointers], > [If enabled, std::shared_ptr and related > classes and functions will be used instead > of boost::shared_ptr. > If disabled (the default) the Boost > facilities > are used. > Note that std::shared_ptr does not check > access and can cause segmentation faults.]), > [ql_use_std_pointers=$enableval], > [ql_use_std_pointers=no]) > if test "$ql_use_std_pointers" = "yes" ; then > AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], > [Define this if you want to use standard smart pointers.]) > fi > AC_MSG_RESULT([$ql_use_std_pointers]) > > AC_MSG_CHECKING([whether to enable std::unique_ptr instead of > std::auto_ptr]) > AC_ARG_ENABLE([std-unique-ptr], > AS_HELP_STRING([--enable-std-unique-ptr], > [If enabled (the default), std::unique_ptr > will > be used instead of the deprecated > std::auto_ptr. > If disabled, std::auto_ptr will still be > used.]), > [ql_use_unique_ptr=$enableval], > [ql_use_unique_ptr=yes]) > if test "$ql_use_unique_ptr" = "yes" ; then > AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], > [Define this if you want to replace std::auto_ptr with > std::unique_ptr.]) > fi > AC_MSG_RESULT([$ql_use_unique_ptr]) > > AC_MSG_CHECKING([whether to enable std::function]) > AC_ARG_ENABLE([std-function], > AS_HELP_STRING([--enable-std-function], > [If enabled, std::function and std::bind will > be > used instead of boost::function and > boost::bind. > If disabled (the default) the Boost > facilities > are used.]), > [ql_use_std_function=$enableval], > [ql_use_std_function=no]) > if test "$ql_use_std_function" = "yes" ; then > AC_DEFINE([QL_USE_STD_FUNCTION],[1], > [Define this if you want to use std::function and std::bind.]) > fi > AC_MSG_RESULT([$ql_use_std_function]) > > > AC_MSG_CHECKING([whether to enable std::tuple]) > AC_ARG_ENABLE([std-tuple], > AS_HELP_STRING([--enable-std-tuple], > [If enabled, std::tuple and related functions > will be used instead of boost::tuple. > If disabled (the default) the Boost > facilities > are used.]), > [ql_use_std_tuple=$enableval], > [ql_use_std_tuple=no]) > if test "$ql_use_std_tuple" = "yes" ; then > AC_DEFINE([QL_USE_STD_TUPLE],[1], > [Define this if you want to use std::tuple.]) > fi > AC_MSG_RESULT([$ql_use_std_pointers]) > > AC_MSG_CHECKING([whether to enable available std classes]) > AC_ARG_ENABLE([std-classes], > AS_HELP_STRING([--enable-std-classes], > [This is a shortcut for --enable-std-pointers > --enable-std-unique-ptr --enable-std-function > --enable-std-tuple. > If enabled, this supersedes any --disable > option passed for the above.]), > [ql_use_std_classes=$enableval], > [ql_use_std_classes=no]) > if test "$ql_use_std_classes" = "yes" ; then > AC_DEFINE([QL_USE_STD_SHARED_PTR],[1], > [Define this if you want to use standard smart pointers.]) > AC_DEFINE([QL_USE_STD_UNIQUE_PTR],[1], > [Define this if you want to replace std::auto_ptr with > std::unique_ptr.]) > AC_DEFINE([QL_USE_STD_FUNCTION],[1], > [Define this if you want to use std::function and std::bind.]) > AC_DEFINE([QL_USE_STD_TUPLE],[1], > [Define this if you want to use std::tuple.]) > fi > AC_MSG_RESULT([$ql_use_std_classes]) > > > AC_MSG_CHECKING([whether to enable the Disposable class template]) > AC_ARG_ENABLE([disposable], > AS_HELP_STRING([--enable-disposable], > [If enabled, the Disposable class > template will be used; > this should be no longer necessary in C++11 > and might interfere with compiler > optimizations. > If disabled (the default) the class will only > be an alias for the underlying type.]), > [ql_use_disposable=$enableval], > [ql_use_disposable=no]) > if test "$ql_use_disposable" = "yes" ; then > AC_DEFINE([QL_USE_DISPOSABLE],[1], > [Define this if you want to use the Disposable class > template.]) > fi > AC_MSG_RESULT([$ql_use_disposable]) > > > # manual configurations for specific hosts > case $host in > powerpc-apple-darwin*) > AC_DEFINE([QL_PATCH_DARWIN],[1], > [Define if running on a Mac OS X machine.]) > ;; > sparc-sun-solaris*) > AC_DEFINE([QL_PATCH_SOLARIS],[1], > [Define if running on a Sun Solaris machine.]) > ;; > esac > > > # done, output the configured files > AC_CONFIG_FILES([ > Makefile > ql/Makefile > ql/cashflows/Makefile > ql/currencies/Makefile > ql/experimental/Makefile > ql/experimental/amortizingbonds/Makefile > ql/experimental/asian/Makefile > ql/experimental/averageois/Makefile > ql/experimental/barrieroption/Makefile > ql/experimental/basismodels/Makefile > ql/experimental/callablebonds/Makefile > ql/experimental/catbonds/Makefile > ql/experimental/commodities/Makefile > ql/experimental/coupons/Makefile > ql/experimental/credit/Makefile > ql/experimental/exoticoptions/Makefile > ql/experimental/finitedifferences/Makefile > ql/experimental/forward/Makefile > ql/experimental/fx/Makefile > ql/experimental/inflation/Makefile > ql/experimental/lattices/Makefile > ql/experimental/math/Makefile > ql/experimental/mcbasket/Makefile > ql/experimental/models/Makefile > ql/experimental/processes/Makefile > ql/experimental/risk/Makefile > ql/experimental/shortrate/Makefile > ql/experimental/swaptions/Makefile > ql/experimental/termstructures/Makefile > ql/experimental/variancegamma/Makefile > ql/experimental/varianceoption/Makefile > ql/experimental/volatility/Makefile > ql/indexes/Makefile > ql/indexes/ibor/Makefile > ql/indexes/inflation/Makefile > ql/indexes/swap/Makefile > ql/instruments/Makefile > ql/instruments/bonds/Makefile > ql/legacy/Makefile > ql/legacy/libormarketmodels/Makefile > ql/math/Makefile > ql/math/copulas/Makefile > ql/math/distributions/Makefile > ql/math/integrals/Makefile > ql/math/interpolations/Makefile > ql/math/matrixutilities/Makefile > ql/math/ode/Makefile > ql/math/optimization/Makefile > ql/math/randomnumbers/Makefile > ql/math/solvers1d/Makefile > ql/math/statistics/Makefile > ql/methods/Makefile > ql/methods/finitedifferences/Makefile > ql/methods/finitedifferences/meshers/Makefile > ql/methods/finitedifferences/operators/Makefile > ql/methods/finitedifferences/schemes/Makefile > ql/methods/finitedifferences/solvers/Makefile > ql/methods/finitedifferences/stepconditions/Makefile > ql/methods/finitedifferences/utilities/Makefile > ql/methods/lattices/Makefile > ql/methods/montecarlo/Makefile > ql/models/Makefile > ql/models/equity/Makefile > ql/models/marketmodels/Makefile > ql/models/marketmodels/browniangenerators/Makefile > ql/models/marketmodels/callability/Makefile > ql/models/marketmodels/correlations/Makefile > ql/models/marketmodels/curvestates/Makefile > ql/models/marketmodels/driftcomputation/Makefile > ql/models/marketmodels/evolvers/Makefile > ql/models/marketmodels/evolvers/volprocesses/Makefile > ql/models/marketmodels/models/Makefile > ql/models/marketmodels/pathwisegreeks/Makefile > ql/models/marketmodels/products/Makefile > ql/models/marketmodels/products/onestep/Makefile > ql/models/marketmodels/products/multistep/Makefile > ql/models/marketmodels/products/pathwise/Makefile > ql/models/shortrate/Makefile > ql/models/shortrate/calibrationhelpers/Makefile > ql/models/shortrate/onefactormodels/Makefile > ql/models/shortrate/twofactormodels/Makefile > ql/models/volatility/Makefile > ql/patterns/Makefile > ql/pricingengines/Makefile > ql/pricingengines/asian/Makefile > ql/pricingengines/barrier/Makefile > ql/pricingengines/basket/Makefile > ql/pricingengines/bond/Makefile > ql/pricingengines/capfloor/Makefile > ql/pricingengines/cliquet/Makefile > ql/pricingengines/credit/Makefile > ql/pricingengines/forward/Makefile > ql/pricingengines/inflation/Makefile > ql/pricingengines/lookback/Makefile > ql/pricingengines/quanto/Makefile > ql/pricingengines/swap/Makefile > ql/pricingengines/swaption/Makefile > ql/pricingengines/vanilla/Makefile > ql/processes/Makefile > ql/quotes/Makefile > ql/termstructures/Makefile > ql/termstructures/credit/Makefile > ql/termstructures/inflation/Makefile > ql/termstructures/volatility/Makefile > ql/termstructures/volatility/equityfx/Makefile > ql/termstructures/volatility/capfloor/Makefile > ql/termstructures/volatility/inflation/Makefile > ql/termstructures/volatility/optionlet/Makefile > ql/termstructures/volatility/swaption/Makefile > ql/termstructures/yield/Makefile > ql/time/Makefile > ql/time/calendars/Makefile > ql/time/daycounters/Makefile > ql/utilities/Makefile > man/Makefile > m4/Makefile > Docs/Makefile > Examples/Makefile > test-suite/Makefile]) > AC_CONFIG_FILES([quantlib-config],[chmod +x quantlib-config]) > AC_CONFIG_FILES([QuantLib.spec]) > AC_CONFIG_FILES([quantlib.pc]) > AC_OUTPUT > > On Tue, 3 May 2022 at 16:43, Conrad Cole <con...@gm...> wrote: > > > > ./configure --with-boost-include=usr/include/boost > > --with-boost-lib=/usr/lib/x86_64-linux-gnu > > > > The config.log file should be in whatever directory you ran the > > configure script. > > > > On 5/3/22 06:55, Daniel Lobo wrote: > > > Also, given that my boost location is /usr/include/boost, how can I > > > execute ./configure again with the boost lib and include flags using > > > the proper directories? What will be the right code? > > > > > > Thanks, > > > > > > On Tue, 3 May 2022 at 15:54, Daniel Lobo <dan...@gm...> > wrote: > > >> Many thanks for your responses. > > >> > > >> whereis boost returns below location, > > >> > > >> $ whereis boost > > >> boost: /usr/include/boost > > >> > > >> Where can I see the generated config.log file? > > >> > > >> Thanks for your time. > > >> > > >> > > >> On Tue, 3 May 2022 at 03:29, Conrad Cole <con...@gm...> > wrote: > > >>> whereis boost is the command to find the location of the installed > boost header files. > > >>> > > >>> On 5/2/22 17:08, Luigi Ballabio wrote: > > >>> > > >>> Can you look inside the generated config.log file and see what > compiler error you're getting exactly? > > >>> > > >>> Luigi > > >>> > > >>> > > >>> On Mon, May 2, 2022 at 7:49 PM Daniel Lobo <dan...@gm...> > wrote: > > >>>> Many thanks. > > >>>> > > >>>> I ran below codes to remove and reinstall boost > > >>>> > > >>>> sudo apt-get remove libboost-all-dev > > >>>> sudo apt-get install libboost-all-dev > > >>>> > > >>>> boost installed in /usr/include > > >>>> > > >>>> :/usr/include$ ls > > >>>> aio.h complex.h error.h features-time64.h > getopt.h > > >>>> langinfo.h math.h netdb.h numa.h > > >>>> python3.10 setjmp.h string.h time.h video > > >>>> aliases.h cpio.h evdns.h fenv.h glob.h > > >>>> lastlog.h mcheck.h neteconet numaif.h rdma > > >>>> sgtty.h strings.h tirpc wait.h > > >>>> alloca.h crypt.h event2 finclude > > >>>> gnu-versions.h libgen.h memory.h netinet obstack.h > > >>>> re_comp.h shadow.h sudo_plugin.h ttyent.h wchar.h > > >>>> argp.h ctype.h event.h fmtmsg.h grp.h > > >>>> libintl.h misc netipx openvpn > regex.h > > >>>> signal.h syscall.h uchar.h wctype.h > > >>>> argz.h dirent.h evhttp.h fnmatch.h > gshadow.h > > >>>> libltdl mntent.h netiucv paths.h > regexp.h > > >>>> sound sysexits.h ucontext.h wordexp.h > > >>>> ar.h dlfcn.h evrpc.h fstab.h hwloc > > >>>> libnl3 monetary.h netpacket poll.h > resolv.h > > >>>> spawn.h syslog.h ulimit.h X11 > > >>>> arpa drm evutil.h fts.h hwloc.h > > >>>> limits.h mqueue.h netrom printf.h rpc > > >>>> stab.h tar.h unicode x86_64-linux-gnu > > >>>> asm-generic elf.h execinfo.h ftw.h iconv.h > > >>>> link.h mtd netrose proc_service.h rpcsvc > > >>>> stdc-predef.h termio.h unistd.h xen > > >>>> assert.h endian.h expat_external.h gcalc-2 > ifaddrs.h > > >>>> linux net nfs protocols > sched.h > > >>>> stdint.h termios.h utime.h xorg > > >>>> boost > > >>>> > > >>>> But still get error when I run ./configure > > >>>> > > >>>> Below is the log that I get > > >>>> > > >>>> $ ./configure > > >>>> checking for a BSD-compatible install... /usr/bin/install -c > > >>>> checking whether build environment is sane... yes > > >>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p > > >>>> checking for gawk... no > > >>>> checking for mawk... mawk > > >>>> checking whether make sets $(MAKE)... no > > >>>> checking whether make supports nested variables... no > > >>>> checking whether UID '1000' is supported by ustar format... yes > > >>>> checking whether GID '1000' is supported by ustar format... yes > > >>>> checking how to create a ustar tar archive... gnutar > > >>>> checking for gawk... (cached) mawk > > >>>> checking for gcc... gcc > > >>>> checking whether the C compiler works... yes > > >>>> checking for C compiler default output file name... a.out > > >>>> checking for suffix of executables... > > >>>> checking whether we are cross compiling... no > > >>>> checking for suffix of object files... o > > >>>> checking whether the compiler supports GNU C... yes > > >>>> checking whether gcc accepts -g... yes > > >>>> checking for gcc option to enable C11 features... none needed > > >>>> checking whether gcc understands -c and -o together... yes > > >>>> checking whether make supports the include directive... no > > >>>> checking dependency style of gcc... none > > >>>> checking for g++... no > > >>>> checking for c++... no > > >>>> checking for gpp... no > > >>>> checking for aCC... no > > >>>> checking for CC... no > > >>>> checking for cxx... no > > >>>> checking for cc++... no > > >>>> checking for cl.exe... no > > >>>> checking for FCC... no > > >>>> checking for KCC... no > > >>>> checking for RCC... no > > >>>> checking for xlC_r... no > > >>>> checking for xlC... no > > >>>> checking for clang++... no > > >>>> checking whether the compiler supports GNU C++... no > > >>>> checking whether g++ accepts -g... no > > >>>> checking for g++ option to enable C++11 features... none needed > > >>>> checking dependency style of g++... none > > >>>> checking how to run the C preprocessor... gcc -E > > >>>> checking build system type... x86_64-pc-linux-gnu > > >>>> checking host system type... x86_64-pc-linux-gnu > > >>>> checking how to print strings... printf > > >>>> checking for a sed that does not truncate output... /usr/bin/sed > > >>>> checking for grep that handles long lines and -e... /usr/bin/grep > > >>>> checking for egrep... /usr/bin/grep -E > > >>>> checking for fgrep... /usr/bin/grep -F > > >>>> checking for ld used by gcc... /usr/bin/ld > > >>>> checking if the linker (/usr/bin/ld) is GNU ld... yes > > >>>> checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm > -B > > >>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm > > >>>> checking whether ln -s works... yes > > >>>> checking the maximum length of command line arguments... 1572864 > > >>>> checking how to convert x86_64-pc-linux-gnu file names to > > >>>> x86_64-pc-linux-gnu format... func_convert_file_noop > > >>>> checking how to convert x86_64-pc-linux-gnu file names to toolchain > > >>>> format... func_convert_file_noop > > >>>> checking for /usr/bin/ld option to reload object files... -r > > >>>> checking for objdump... objdump > > >>>> checking how to recognize dependent libraries... pass_all > > >>>> checking for dlltool... no > > >>>> checking how to associate runtime and link libraries... printf %s\n > > >>>> checking for ar... ar > > >>>> checking for archiver @FILE support... @ > > >>>> checking for strip... strip > > >>>> checking for ranlib... ranlib > > >>>> checking command to parse /usr/bin/nm -B output from gcc object... > ok > > >>>> checking for sysroot... no > > >>>> checking for a working dd... /usr/bin/dd > > >>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 count=1 > > >>>> checking for mt... mt > > >>>> checking if mt is a manifest tool... no > > >>>> checking for stdio.h... yes > > >>>> checking for stdlib.h... yes > > >>>> checking for string.h... yes > > >>>> checking for inttypes.h... yes > > >>>> checking for stdint.h... yes > > >>>> checking for strings.h... yes > > >>>> checking for sys/stat.h... yes > > >>>> checking for sys/types.h... yes > > >>>> checking for unistd.h... yes > > >>>> checking for dlfcn.h... yes > > >>>> checking for objdir... .libs > > >>>> checking if gcc supports -fno-rtti -fno-exceptions... no > > >>>> checking for gcc option to produce PIC... -fPIC -DPIC > > >>>> checking if gcc PIC flag -fPIC -DPIC works... yes > > >>>> checking if gcc static flag -static works... yes > > >>>> checking if gcc supports -c -o file.o... yes > > >>>> checking if gcc supports -c -o file.o... (cached) yes > > >>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports > > >>>> shared libraries... yes > > >>>> checking whether -lc should be explicitly linked in... no > > >>>> checking dynamic linker characteristics... GNU/Linux ld.so > > >>>> checking how to hardcode library paths into programs... immediate > > >>>> checking whether stripping libraries is possible... yes > > >>>> checking if libtool supports shared libraries... yes > > >>>> checking whether to build shared libraries... yes > > >>>> checking whether to build static libraries... yes > > >>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS > > >>>> checking for Boost development files... no > > >>>> configure: error: Boost development files not found > > >>>> > > >>>> > > >>>> Any pointer how to resolve this will be very helpful. > > >>>> > > >>>> Thanks > > >>>> > > >>>> On Sun, 1 May 2022 at 13:16, Jonathan Sweemer <sw...@gm...> > wrote: > > >>>>> Hi Daniel, > > >>>>> > > >>>>> Just to confirm, you’re no longer running ./configure with the > —with-boost-include and —with-boost-lib flags right? > > >>>>> > > >>>>> If so then I would expect the configure script to find your boost > installation. Please check that you see boost headers in /usr/include/boost > and if not, try reinstalling boost. > > >>>>> > > >>>>> If you’re still unable to get ./configure to find boost then > please attach the full output including all the commands that you ran. > > >>>>> > > >>>>> Jonathan > > >>>>> > > >>>>> > > >>>>> 2022년 5월 1일 (일) 15:41, Daniel Lobo <dan...@gm...>님이 작성: > > >>>>>> Hi, > > >>>>>> > > >>>>>> Many thanks for your response. > > >>>>>> > > >>>>>> Yes I ran 'sudo apt-get install libboost-all-dev' to install > boost. > > >>>>>> However still I get this error. > > >>>>>> > > >>>>>> How can I find where the boost is installed and how can I pass > that > > >>>>>> information './configure ' line? > > >>>>>> > > >>>>>> Apologies for trivial question if any, as I am not very expert in > > >>>>>> Linux ecosystem. > > >>>>>> > > >>>>>> Thanks and regards, > > >>>>>> > > >>>>>> On Sun, 1 May 2022 at 11:53, Jonathan Sweemer <sw...@gm...> > wrote: > > >>>>>>> Hi Daniel, > > >>>>>>> > > >>>>>>> When you say that you “install[ed] boost already as provided in > the instruction page” do you mean that you ran the following command? > > >>>>>>> > > >>>>>>> sudo apt-get install libboost-all-dev > > >>>>>>> > > >>>>>>> If so then you shouldn’t need to use the —with-boost-include and > —with-boost-lib flags when configuring QuantLib. As the install guide > mentions, you only need those flags when you install boost in a > non-standard location. > > >>>>>>> > > >>>>>>> Jonathan > > >>>>>>> > > >>>>>>> > > >>>>>>> 2022년 5월 1일 (일) 02:25, Daniel Lobo <dan...@gm...>님이 > 작성: > > >>>>>>>> Hi, > > >>>>>>>> > > >>>>>>>> I am trying to install Quantlib in my Ubuntu VM. I was > following the > > >>>>>>>> instructions as provided in > > >>>>>>>> https://www.quantlib.org/install/linux.shtml > > >>>>>>>> > > >>>>>>>> But this installation failed when I executed > > >>>>>>>> > > >>>>>>>> ./configure --with-boost-include=/home/foo/include > > >>>>>>>> --with-boost-lib=/home/foo/lib > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> The error I got is > > >>>>>>>> > > >>>>>>>> $ ./configure --with-boost-include=/home/foo/include > > >>>>>>>> --with-boost-lib=/home/foo/lib > > >>>>>>>> checking for a BSD-compatible install... /usr/bin/install -c > > >>>>>>>> checking whether build environment is sane... yes > > >>>>>>>> checking for a race-free mkdir -p... /usr/bin/mkdir -p > > >>>>>>>> checking for gawk... no > > >>>>>>>> checking for mawk... mawk > > >>>>>>>> checking whether make sets $(MAKE)... no > > >>>>>>>> checking whether make supports nested variables... no > > >>>>>>>> checking whether UID '1000' is supported by ustar format... yes > > >>>>>>>> checking whether GID '1000' is supported by ustar format... yes > > >>>>>>>> checking how to create a ustar tar archive... gnutar > > >>>>>>>> checking for gawk... (cached) mawk > > >>>>>>>> checking for gcc... gcc > > >>>>>>>> checking whether the C compiler works... yes > > >>>>>>>> checking for C compiler default output file name... a.out > > >>>>>>>> checking for suffix of executables... > > >>>>>>>> checking whether we are cross compiling... no > > >>>>>>>> checking for suffix of object files... o > > >>>>>>>> checking whether the compiler supports GNU C... yes > > >>>>>>>> checking whether gcc accepts -g... yes > > >>>>>>>> checking for gcc option to enable C11 features... none needed > > >>>>>>>> checking whether gcc understands -c and -o together... yes > > >>>>>>>> checking whether make supports the include directive... no > > >>>>>>>> checking dependency style of gcc... none > > >>>>>>>> checking for g++... no > > >>>>>>>> checking for c++... no > > >>>>>>>> checking for gpp... no > > >>>>>>>> checking for aCC... no > > >>>>>>>> checking for CC... no > > >>>>>>>> checking for cxx... no > > >>>>>>>> checking for cc++... no > > >>>>>>>> checking for cl.exe... no > > >>>>>>>> checking for FCC... no > > >>>>>>>> checking for KCC... no > > >>>>>>>> checking for RCC... no > > >>>>>>>> checking for xlC_r... no > > >>>>>>>> checking for xlC... no > > >>>>>>>> checking for clang++... no > > >>>>>>>> checking whether the compiler supports GNU C++... no > > >>>>>>>> checking whether g++ accepts -g... no > > >>>>>>>> checking for g++ option to enable C++11 features... none needed > > >>>>>>>> checking dependency style of g++... none > > >>>>>>>> checking how to run the C preprocessor... gcc -E > > >>>>>>>> checking build system type... x86_64-pc-linux-gnu > > >>>>>>>> checking host system type... x86_64-pc-linux-gnu > > >>>>>>>> checking how to print strings... printf > > >>>>>>>> checking for a sed that does not truncate output... /usr/bin/sed > > >>>>>>>> checking for grep that handles long lines and -e... > /usr/bin/grep > > >>>>>>>> checking for egrep... /usr/bin/grep -E > > >>>>>>>> checking for fgrep... /usr/bin/grep -F > > >>>>>>>> checking for ld used by gcc... /usr/bin/ld > > >>>>>>>> checking if the linker (/usr/bin/ld) is GNU ld... yes > > >>>>>>>> checking for BSD- or MS-compatible name lister (nm)... > /usr/bin/nm -B > > >>>>>>>> checking the name lister (/usr/bin/nm -B) interface... BSD nm > > >>>>>>>> checking whether ln -s works... yes > > >>>>>>>> checking the maximum length of command line arguments... 1572864 > > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to > > >>>>>>>> x86_64-pc-linux-gnu format... func_convert_file_noop > > >>>>>>>> checking how to convert x86_64-pc-linux-gnu file names to > toolchain > > >>>>>>>> format... func_convert_file_noop > > >>>>>>>> checking for /usr/bin/ld option to reload object files... -r > > >>>>>>>> checking for objdump... objdump > > >>>>>>>> checking how to recognize dependent libraries... pass_all > > >>>>>>>> checking for dlltool... no > > >>>>>>>> checking how to associate runtime and link libraries... printf > %s\n > > >>>>>>>> checking for ar... ar > > >>>>>>>> checking for archiver @FILE support... @ > > >>>>>>>> checking for strip... strip > > >>>>>>>> checking for ranlib... ranlib > > >>>>>>>> checking command to parse /usr/bin/nm -B output from gcc > object... ok > > >>>>>>>> checking for sysroot... no > > >>>>>>>> checking for a working dd... /usr/bin/dd > > >>>>>>>> checking how to truncate binary pipes... /usr/bin/dd bs=4096 > count=1 > > >>>>>>>> checking for mt... mt > > >>>>>>>> checking if mt is a manifest tool... no > > >>>>>>>> checking for stdio.h... yes > > >>>>>>>> checking for stdlib.h... yes > > >>>>>>>> checking for string.h... yes > > >>>>>>>> checking for inttypes.h... yes > > >>>>>>>> checking for stdint.h... yes > > >>>>>>>> checking for strings.h... yes > > >>>>>>>> checking for sys/stat.h... yes > > >>>>>>>> checking for sys/types.h... yes > > >>>>>>>> checking for unistd.h... yes > > >>>>>>>> checking for dlfcn.h... yes > > >>>>>>>> checking for objdir... .libs > > >>>>>>>> checking if gcc supports -fno-rtti -fno-exceptions... no > > >>>>>>>> checking for gcc option to produce PIC... -fPIC -DPIC > > >>>>>>>> checking if gcc PIC flag -fPIC -DPIC works... yes > > >>>>>>>> checking if gcc static flag -static works... yes > > >>>>>>>> checking if gcc supports -c -o file.o... yes > > >>>>>>>> checking if gcc supports -c -o file.o... (cached) yes > > >>>>>>>> checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) > supports > > >>>>>>>> shared libraries... yes > > >>>>>>>> checking whether -lc should be explicitly linked in... no > > >>>>>>>> checking dynamic linker characteristics... GNU/Linux ld.so > > >>>>>>>> checking how to hardcode library paths into programs... > immediate > > >>>>>>>> checking whether stripping libraries is possible... yes > > >>>>>>>> checking if libtool supports shared libraries... yes > > >>>>>>>> checking whether to build shared libraries... yes > > >>>>>>>> checking whether to build static libraries... yes > > >>>>>>>> checking for C++11 support... no: adding -std=c++11 to CXXFLAGS > > >>>>>>>> checking for Boost development files... no > > >>>>>>>> configure: error: Boost development files not found > > >>>>>>>> > > >>>>>>>> Could you please help how to resolve this error. I executed the > code > > >>>>>>>> to install boost already as provided in the instruction page. > > >>>>>>>> > > >>>>>>>> > > >>>>>>>> _______________________________________________ > > >>>>>>>> QuantLib-users mailing list > > >>>>>>>> Qua...@li... > > >>>>>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > >>>> > > >>>> _______________________________________________ > > >>>> QuantLib-users mailing list > > >>>> Qua...@li... > > >>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > > >>> > > >>> > > >>> _______________________________________________ > > >>> QuantLib-users mailing list > > >>> Qua...@li... > > >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > |