I cannot use one of the useful functions in QuantLib when using python. Here is a simple example from QuantLib manual (one of Jupyter notebooks). I am reproducing a piece of code that reliably breaks on my Mac.
from QuantLib import *
today = Date(7, March, 2014)
Settings.instance().evaluationDate = today
option = EuropeanOption(PlainVanillaPayoff(Option.Call, 100.0),
EuropeanExercise(Date(7, June, 2014)))
u = SimpleQuote(100.0)
r = SimpleQuote(0.01)
sigma = SimpleQuote(0.20)
riskFreeCurve = FlatForward(0, TARGET(), QuoteHandle(r), Actual360())
volatility = BlackConstantVol(0, TARGET(), QuoteHandle(sigma), Actual360())
process = BlackScholesProcess(QuoteHandle(u),
YieldTermStructureHandle(riskFreeCurve),
BlackVolTermStructureHandle(volatility))
engine = AnalyticEuropeanEngine(process)
option.setPricingEngine(engine)
print option.NPV()
u.setValue(105.0) ### <= this step is broken
I installed QuantLib v.1.9.1 on my MacOs (10.11.6). Many functions work fine but once a pricing engine is setup and I want to reprice option with some changes in SimpleQuote, independent of model I get this popup: "The kernel appears to have died. It will restart automatically."
When the same script is used in Python REPL, I get "Segmentation fault: 11"
Anyone dealt with this situation? Any suggestions on how to resolve the issue? Or I am doing something incorrectly? Does anyone experience same problem on Windows? I can switch to Windows if it works there.
Many thanks!