Info re: Building QuantLib/QuantLibAddin libraries on Windows 64-bit Platforms

Posted by Paul Giltinan on
URL: http://quantlib.414.s1.nabble.com/Info-re-Building-QuantLib-QuantLibAddin-libraries-on-Windows-64-bit-Platforms-tp379.html

Hi,

I have recently compiled QuantLib and QuantLibAddin on a Windows 64-bit platform (Visual Studio 2010, x64) and encountered a few difficulties while doing so, particularly in QuantLibAddin. Hopefully the information below will be useful for anybody wishing to use QuantLib on windows x64 platform in future.

(a) Initial attempts to build QuantLibAddin failed on the linking phase, because a definition for the function cppToLibrary(const long&, Natural&) could not be found. The issue arose because of the following code in the file QuantLibAddin/qlo/conversions/conversions.cpp, which resulted in the definition being skipped during compilation on our Windows x64 platform.

#if defined(__GNUC__) && defined(__x86_64__)

    void cppToLibrary(const long &in, QuantLib::Natural &ret) {

        ret = QuantLib::Natural(in);

    }

#endif

To fix this, I have updated the #if directive to check for a macro named _WIN64, which according to the MSDN website is pre-defined on all Windows 64-bit platforms. Maybe this fix can be merged into future QuantLib releases?


(b) Another issue I found was that, when upgrading the Visual Studio project from win32 to x64, the Targeted Machine (/MACHINE) project property was not automatically updated for static libraries. The property had to be updated manually, or else the build of log4cxx would fail at the linking stage. This is a bug with the Visual C++ IDE (dynamic library and executable projects are updated automatically).


(c) Finally I noticed that within QuantLib's "customised" log4cxx library (log4cxx0.10.0d) the APR code is dependent on a WIN32 macro definition (e.g. file apr.h). If this WIN32 macro is removed from the preprocesser definition for the 64-bit project the build of log4cxx will fail. Maybe it would make more sense if the code was re-written to instead check for the macro _WIN32, which is pre-defined and always available on all windows platforms (both 32-bit and 64-bit).


Would it be a good idea if windows x64-specific VC++ project and solution files were provided in future QuantLib releases? If so, I can potentially provide these.



Regards,

Paul


------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure
contains a definitive record of customers, application performance,
security threats, fraudulent activity, and more. Splunk takes this
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users