Commits

khorser committed 0611daf

Initial checkin

  • Participants

Comments (0)

Files changed (6)

File Examples/jamfile.jam

+exe BermudanSwaptionExample : [ glob BermudanSwaption/*.cpp ] ../ql//QuantLib ;
+
+exe BondsExample : [ glob Bonds/*.cpp ] ../ql//QuantLib ;
+
+exe CallableBondsExample : [ glob CallableBonds/*.cpp ] ../ql//QuantLib ;
+
+exe CDSExample : [ glob CDS/*.cpp ] ../ql//QuantLib ;
+
+exe ConvertibleBondsExample : [ glob ConvertibleBonds/*.cpp ] ../ql//QuantLib ;
+
+exe DiscreteHedgingExample : [ glob DiscreteHedging/*.cpp ] ../ql//QuantLib ;
+
+exe EquityOptionExample : [ glob EquityOption/*.cpp ] ../ql//QuantLib ;
+
+exe FittedBondCurveExample : [ glob FittedBondCurve/*.cpp ] ../ql//QuantLib ;
+
+exe FRAExample : [ glob FRA/*.cpp ] ../ql//QuantLib ;
+
+exe MarketModelsExample : [ glob MarketModels/*.cpp ] ../ql//QuantLib ;
+
+exe ReplicationExample : [ glob Replication/*.cpp ] ../ql//QuantLib ;
+
+exe RepoExample : [ glob Repo/*.cpp ] ../ql//QuantLib ;
+
+exe SwapExample : [ glob Swap/*.cpp ] ../ql//QuantLib ;
+Boost.Build files to build QuantLib without autotools
+=====================================================
+
+I tired of fighting autotools and libtool on MinGW so I decided to use
+Boost.Build instead. Not that I liked it but it least it is more predictable.
+
+I tested it on Windows and Linux.
+
+Usage
+-----
+
+If you are on Windows, install `MinGW`_.
+
+On all platforms, download and extract `boost`_ and `QuantLib`_.
+Due to the specific version of GCC I needed, I used GCC-4.5.2 with boost-1.50
+and QuantLib-1.2.1.
+
+If you don't have Boost.Build (bjam) installed, run this in the Boost directory
+ensuring `gcc` is in your PATH::
+
+    cd tools\build\v2
+    boostrap mingw
+    .\b2 install --prefix=<your-preferred-dir-for-bjam>
+
+The same will work on Linux if you replace backslashes in paths with forward ones.
+
+Making sure `b2` is in PATH, adjust PATH to Boost in the ``use-project /boost`` line.
+The execute this in the QuantLib directory to build fully static library (`--hash`
+is used to reduce command line length)::
+
+    b2 -d+2 --hash
+
+Also you might want to run the same in the `Examples` and `test-suite` directories.
+
+Probably some time later I will add installation targets, for now the built library
+can be used in place from `bin` subdirectories, see `test-suite/jamfile.jam` for how
+you can refer QuantLib in your Boost.Build files.
+
+.. _MinGW: http://mingw.org
+
+.. _boost: http://boost.org
+
+.. _QuantLib: http://quantlib.org
+import option ; 
+ 
+using gcc ;
+ 
+option.set keep-going : false ; 
+
+use-project /boost : ../boost_1_50_0 ;
+
+project
+    : requirements
+	<threading>multi
+	<link>static
+	<runtime-link>static
+	<variant>release
+    ;
+
+build-project ql ;
+
+# build it with --hash -d+2

File ql/jamfile.jam

+project : requirements
+	    <include>..
+	    <library>/boost//headers
+	: usage-requirements
+	    <include>..
+	;
+
+lib QuantLib : [ glob-tree *.cpp *.c ] ;
+
+using mingw-ar ;

File ql/mingw-ar.jam

+# override archive command for ar on Windows to use response file
+# because of the limit on the length of command line
+
+import generators ;
+import toolset ;
+
+actions piecemeal archive
+{
+    ar rc "$(<)" "@"@($(<[1]:T).rsp:E=$(>:T))
+    ranlib "$(<)"
+}
+
+rule init ( version ? : command * : options * )
+{
+    toolset.inherit-generators mingw-ar : gcc ;
+
+    generators.register-composing mingw-ar.archive : OBJ : STATIC_LIB ;
+
+    generators.override mingw-ar.archive : gcc.archive ;
+}

File test-suite/jamfile.jam

+alias "test" :
+    [ run [ glob *.cpp : quantlibbenchmark.cpp ] ../ql//QuantLib /boost//unit_test_framework
+	: --log_level=message --build_info=yes --result_code=no --report_level=short
+    	:
+    	:
+    	: quantlib-test-suite
+    ]
+    ;
+
+alias "benchmark" :
+    [ run [ glob *.cpp : quantlibtestsuite.cpp ] ../ql//QuantLib /boost//unit_test_framework
+	: --log_level=message --build_info=yes --result_code=no --report_level=short
+    	:
+    	:
+    	: quantlib-benchmark
+    ]
+    ;
+
+explicit benchmark ;