|
From: Eric E. <eri...@re...> - 2020-11-17 15:48:50
|
Currently the projects supports bindings to Excel and C++ (PoC). At various points in the past the project has supported bindings to C, Calc (LibreOffice), and maybe one or two other platforms that I can't remember. In order to resurrect the C bindings you would need to get the relevant gensrc module working again, and the QuantLibAddin C project. This would not be a trivial task, you would end up reverse engineering things until you knew them as well as if you had written them yourself. There may be vestiges of the old C project files still kicking around in the QuantLibAddin repo. It might (or might not) be helpful for you to go back and download the very old version of QuantLibAddin that supported C. In your case, rather than generating a raw C API, you would probably want to generate one specifically tailored for Python bindings. Regards, Eric On 11/17/20 1:59 PM, SX L wrote: > Yes. I essentially turned Python to VBA. I tried to load the XLL with > CDLL, no luck. > > As for the C bindings, I want to turn it on. Could you please > elaborate? XLL bindings are actually C ones. C++ bindings won't work > with ctypes. > > ------------------------------------------------------------------------ > *From:* Eric Ehlers <eri...@re...> > *Sent:* Monday, November 16, 2020 6:34 PM > *To:* SX L <han...@ho...> > *Cc:* qua...@li... > <qua...@li...> > *Subject:* Re: [Quantlib-users] How to expose QuantLibAddin to Python? > > > I managed to load QuantLibXLL into Python with win32com. > > > That's an interesting exercise to attempt. An XLL is a DLL so I guess > there is nothing to prevent you from loading it as such into Python. > But the XLL's entry points are designed to be called from Excel so it > would be a hassle at best to use from Python. > > > > However, what about Linux side? SWIG? Can gensrc generate C interfaces similar to XL ones? > > > The idea behind gensrc is that you could autogenerate source code for > the QuantLibAddin interface for any platform, Excel is just one > example. There is a build for C++ but it only supports a subset of the > functionality that QuantLibXL supports. So the C++ build is more of a > proof of concept. It works on Windows and Linux and is documented here: > > > https://www.quantlib.org/quantlibaddin/build_cpp.html > > > Once upon a time, we implemented a gensrc module to export the > QuantLibAddin interface to C, and that facilitated deployment to > platforms such as Python that talk C. However that build has not been > maintained for a long time and it would not be a trivial task to > resurrect it. > > > Regards, > Eric > > > On 11/15/20 5:13 PM, SX L wrote: >> I managed to load QuantLibXLL into Python with win32com. However, >> what about Linux side? SWIG? Can gensrc generate C interfaces similar >> to XL ones? >> >> >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... <mailto:Qua...@li...> >> https://lists.sourceforge.net/lists/listinfo/quantlib-users |