c++ - Compiling Quantlib via SWIG for C# -
anyone have experience using swig? researching quantlib , saw c# code can generated using swig. exploring options create combined library of financial functions using quantlib , proprietary closed source library (which made available .net dlls). idea combine both of these create unified super library. have seen .net port of quantlib, seems not actively maintained (and not entirely sure of how ported), avoiding it.
step 1 of evaluate difficulty in producing library can used 'anywhere' i.e. ms office applications ( via vba), console apps server-side (eg web apps). assume involves com interop, have no clue start or if on right track.
i have no experience c++; , com (a buzzword me @ moment) have glazed over. aware of relevant msdn articles related topic.
i looking along following lines:
- are there alternatives using quantlib in c#?
- with respect development environment, need?
- does know of ready-to-use quantlib c# library compiled via swig? (first prize = less work me)
any appreciated?
edit: have accepted answer correct 1 unless there better 1 provided.
so seem c# bindings swig available. 1 needs browse svn repository or list of files on souceforge find them.
the swig folder contains several subfolders, depending on language of choice, in case c# 1 interested me. need download swig first , executable system path
variable.
make sure read readme.txt
contains details ql_dir
environment variable needs created.
this may limitation of vs express - solution file contains both c# project , c++ project, of either c# or c++ portions can opened @ time. suggestion created separate solution files c++ , c# projects.
coming .net background, lib files, obj files , other jazz associated c++ takes time getting use to.
steps taken working c# library
- download quantlib , boost described here
- download tar ball of quantlib-swig folder sourceforge. edit: there download of zip available on home page. listed within subfolders. check v1.0 folders under
bindings
- run
swig.cmd
file located inquantlib-swig\csharp
folder (you need download swig first() --> generates cs wrapper files quantlib. - build c++ project
nquantlibc
- note dll created here needs shipped nquantlib c# built dll. needs placed in location readabledllimport
attribute. (see dynamic-link library search order on msdn list of locations) - build c# project
nquantlib
with respect development environment, need? seems current version of quantlib builds vs 2008. there have been changes vs 2010 causes issues compilation. c# project builds fine, remember change target framework v4 v3.5 lower.
note: time of writing there issue ql_hex_version
number in source files of c++ swig project. after running swig.cmd
open vs project, , change line 344 of quantlib_wrap.cpp
#if ql_hex_version < 0x010001f0//0x010100f0
i have emailed project author, , awaiting feedback. edit: luigi, correctly informed me issue code in svn (which used). suggested quantlib-swig-1.0.zip bindings should used.
quantlib build on vc++ 2010 latest release.
Comments
Post a Comment