C++/CLI problems

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

C++/CLI problems

Nathan Abbott
I am writing a QuantLib app with a C# winforms front end. I have managed to compile both boost and QuantLib with the /clr flag. With this version of QuantLib, I have create a .Net assembly with C++/CLI. It works fine except it is a little slow. In the book Expert C++/CLI, it says that in order to get the best performance you should compile native C++ objects without the clr flag. Therefore, I recompile both Boost and QuantLib without the clr flag and recompile the .Net assembly with the new version of QuantLib. The QuantLib part of the assembly runs twice as fast  Unfortunately, I am getting weird results. The same problem I am getting with the .Net assembly can be reproduce, if you compile the swap example of QuantLib with the clr flag. If you do that the swap example will give the error " Missing Euribor6M Actual/360 fixing for September 20th, 2004" when it runs. Does anybody know how to get QuantLib working with C++/CLI?

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: C++/CLI problems

Klaus Spanderen-2
Hi

might be that you have the same problem I had weeks ago. What worked out for
me was to declare

inline T& Singleton<T>::instance() { ..}

instead of

T& Singleton<T>::instance() { }

within the singelton.hpp file. Please see the thread
"C++ help needed: singleton.hpp"

in the QuantLib developer mailing list.

----snip--------snip--------snip--------snip--------snip----

I nailed it down to a 15 line program (attached to this email), which
generates to wrong results when compiled within a separate Visual Studio
solution _and_ the option

Common Language Runtime-Support (/clr)

is switched on. Everything is okay as soon as I'm switching this option off or
declaring

inline T& Singleton<T>::instance() { ..}

instead of

T& Singleton<T>::instance() { }

----snip--------snip--------snip--------snip--------snip------
Klaus Spanderen
Ludwig Erhard Str. 12
48734 Reken (Germany)
EMail: [hidden email] (remove NOSPAM from the address)

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: C++/CLI problems

Nathan Abbott
Thank you! That was the problem. I would have never found that out on my own. You just double the speed of my application. I appreciate your help very much.

On Nov 10, 2007 2:33 AM, Klaus Spanderen <[hidden email]> wrote:
Hi

might be that you have the same problem I had weeks ago. What worked out for
me was to declare

inline T& Singleton<T>::instance() { ..}

instead of

T& Singleton<T>::instance() { }

within the singelton.hpp file. Please see the thread
"C++ help needed: singleton.hpp"

in the QuantLib developer mailing list.

----snip--------snip--------snip--------snip--------snip----

I nailed it down to a 15 line program (attached to this email), which
generates to wrong results when compiled within a separate Visual Studio
solution _and_ the option

Common Language Runtime-Support (/clr)

is switched on. Everything is okay as soon as I'm switching this option off or
declaring

inline T& Singleton<T>::instance() { ..}

instead of

T& Singleton<T>::instance() { }

----snip--------snip--------snip--------snip--------snip------
Klaus Spanderen
Ludwig Erhard Str. 12
48734 Reken (Germany)
EMail: [hidden email] (remove NOSPAM from the address)


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users