Skip to content

Commit 733557a

Browse files
committed
update README.md
1 parent a688a87 commit 733557a

1 file changed

Lines changed: 36 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
## QuantLib Async Bindings for Node.js [![npm version](https://badge.fury.io/js/quantlib.svg)](http://badge.fury.io/js/quantlib)
1+
## QuantLib Async Bindings for Node.js [![npm version](https://badge.fury.io/js/quantlib.svg)](http://badge.fury.io/js/quantlib) [![Twitter Follow](https://img.shields.io/twitter/follow/quantlibnode.svg?style=social&maxAge=3600)](https://twitter.com/quantlibnode)
22

3-
This project brings [QuantLib](http://quantlib.org/) to the Node.js community, it's similar to [QuantLibXL](http://quantlib.org/quantlibxl/) project which is for Microsoft Excel.
3+
This [open source project](https://github.com/quantlibnode/quantlibnode) brings [QuantLib](http://quantlib.org/) to the Node.js community, it's similar to [QuantLibXL](http://quantlib.org/quantlibxl/) project which is for Microsoft Excel.
44

55
Most functions in QuantLibXL can be used in the similar way in Node on the server side.
66

@@ -13,13 +13,17 @@ All functions in this project are Async, they are exported to [Promise](https://
1313
npm install quantlib
1414
```
1515

16-
* Windows
16+
* Windows - 32-Bit
1717

1818
`npm install quantlib` will do everything, including the node package installation and pre-built native addon (no dependency) download, you can start use it right away.
1919

20+
* Windows - 64-Bit
21+
22+
I will try to build and upload the pre-built addon, before that, Please refer to [how to build](#building_the_native_addon) below
23+
2024
* Linux & Mac
2125

22-
Quantlib and QuantLibAddin must be built first, then build QuantLibNode linking to them, pre-built native code is not provided for now
26+
Please refer to [how to build](#building_the_native_addon) below
2327

2428

2529
## QuantLib Documents
@@ -34,6 +38,34 @@ Quantlib and QuantLibAddin must be built first, then build QuantLibNode linking
3438
| -------- | ------------- | ------- | ------------- |
3539
| 1.7.1 | 1.7.0 | 6.9.1 | 0.1.x |
3640

41+
## Building the native addon
42+
43+
#### Prerequisite
44+
45+
* CMake 2.8 or above, Visual C++ for windows, Xcode for Mac, GCC for Linux
46+
* Node.js according to [version matrix](#version-matrix)
47+
* [nan](https://github.com/nodejs/nan) ^2.2.0
48+
* [node-gyp](https://github.com/nodejs/node-gyp) ~3.0.3
49+
* QuantLib, QuantLibAddin, ObjectHandler source code according to [version matrix](#version-matrix), they need to be put in the same directory
50+
* `boost` - which is required to build QuantLib
51+
52+
#### Set environment variable
53+
54+
please refer to `cmake/*.cmake` and `CMakeList.txt` files
55+
56+
* `NAN_DIR` - location of `nan`
57+
* `NODE_GYP_DIR` - location of `.node-gyp` generated by `node-gyp` tool, which is at `~/.node-gyp`, if it doesn't exist, follow the instruction in [node-gyp](https://github.com/nodejs/node-gyp), and build a helloword program, it will generate the `.node-gyp` directory
58+
* `QUANTLIB_ROOT` - location of QuantLib, QuantLibAddin, ObjectHandler source code
59+
* `BOOST_ROOT` - location `boost` installed
60+
61+
#### Use cmake to build the addon
62+
63+
1. Build QuantLib and QuantLibAddin, please check `CMakeList.txt` for library name, and make sure generated library names are the same in `CMakeList.txt`
64+
2. from `quantlibnode` root directory `cd build`
65+
3. `cmake ..` for Windows and Linux, `cmake -G Xcode ..` for Mac OS X
66+
4. `cmake --build . --config Release`
67+
5. For Linux, you may need to put `quantlib.node` under `build/Release` manually,
68+
3769
## Example
3870

3971
```js

0 commit comments

Comments
 (0)