forked from qminer/qminer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node-gyp_linalg_instructions.txt
61 lines (44 loc) · 4.23 KB
/
node-gyp_linalg_instructions.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#WINDOWS
compiling OPENBLAS not recommended
http://sourceforge.net/projects/openblas/files/v0.2.14/
easiest: win64 with 32bit matrix indexing
extract, close visual studio, add openblas/bin to path!
if node-gyp is not found: "npm install -g node-gyp"
download: http://sourceforge.net/projects/openblas/files/v0.2.14/mingw64_dll.zip/download
Add to openblas/bin:
libgcc_s_seh-1.dll, libgfortran-3.dll, libquadmath-0.dll
call node-gyp clean
call node-gyp configure --nodedir="D:/work/code/cpp/node-v0.12.0" -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_INCLUDE="D:/work/code/cpp/openblas/include" -DLIN_ALG_LIB="D:/work/code/cpp/openblas/lib/libopenblas.dll.a"
call node-gyp build
call node -e "var la = require('./index.js').la;var A = new la.Matrix({ rows: 1000, cols: 1000, random: true });var B = new la.Matrix({ rows: 1000, cols: 1000, random: true });console.time('Multiply'); var C = A.multiply(B); console.timeEnd('Multiply');"
#OLD INSTRUCTIONS (COVERS LINUX)
export PATH=$PATH:/usr/local/bin
#OPENBLAS
#LINUX (compile OPENBLAS from source, INTERFACE64=1 for ilp64 interface and 64 bit indexing, glib then needs -DINDEX_64=INDEX_64 macro)
node-gyp configure --nodedir=D:/Code/node-0.12.0 -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_INCLUDE=/home/muhica/Code/OpenBlas/include/ -DLIN_ALG_LIB=/home/muhica/Code/OpenBlas/lib/libopenblas.a
#WINDOWS
node-gyp configure --nodedir=D:/Code/node-0.12.0 -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_INCLUDE=D:/OpenBLAS-v0.2.14-Win64-int32/include -DLIN_ALG_LIB=D:/OpenBLAS-v0.2.14-Win64-int32/lib/libopenblas.dll.a
#LAPACKE
#no cblas interface, compile it yourself, hard!
#WINDOWS
node-gyp configure --nodedir=D:/Code/node-0.12.0 -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_INCLUDE=D:/LAPACKE -DLIN_ALG_LIB="D:/LAPACKE/Build/lib/Release/lapacke.lib; D:/LAPACKE/Build/lib/Release/lapack.lib; D:/LAPACKE/Build/lib/Release/cblas.lib; D:/LAPACKE/Build/lib/Release/blas.lib"
#LINUX
node-gyp configure -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_LIB=-llapacke
#INTEL_MKL
#WINDOWS
node-gyp configure --nodedir=D:/Code/node-0.12.0 -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_INCLUDE="C:/Program Files (x86)/Intel/Composer XE 2015/mkl/include" -DINTEL=INTEL -DLIN_ALG_LIB="""C:/Program Files (x86)/Intel/Composer XE 2015/mkl/lib/intel64/mkl_intel_lp64.lib""; ""C:/Program Files (x86)/Intel/Composer XE 2015/mkl/lib/intel64/mkl_core.lib""; ""C:/Program Files (x86)/Intel/Composer XE 2015/mkl/lib/intel64/mkl_intel_thread.lib""; ""C:/Program Files (x86)/Intel/Composer XE 2015/compiler/lib/intel64/libiomp5md.lib"";"
#LINUX
node-gyp configure -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_LIB="-Wl,--start-group /opt/intel/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/mkl/lib/intel64/libmkl_core.a /opt/intel/mkl/lib/intel64/libmkl_gnu_thread.a -Wl,--end-group -ldl -lpthread -lm"
#INSTALL
npm install qminer --nodedir="C:\code\node-0.12.0"
#Random rambling
D:/OpenBLAS-v0.2.14-Win64-int64/lib/libopenblas.dll.a
-DINDEX_64=INDEX_64
var qminer = require("./index.js")
var la = qminer.la;
var A = new la.Matrix({ "rows": 1000, "cols": 1000, "random": true });
var B = new la.Matrix({ "rows": 1000, "cols": 1000, "random": true });
var C = new la.Matrix({ "rows": 1000, "cols": 1000, "random": true });
console.time("Multiply"); C = A.multiply(B); console.timeEnd("Multiply");
""C:/Program Files (x86)\Intel/Composer XE 2015/compiler/lib/intel64/libmmt.lib"";
node-gyp configure --nodedir=D:/Code/node-0.12.0 -- -DLIN_ALG_BLAS=BLAS -DLIN_ALG_LAPACKE=LAPACKE -DLIN_ALG_INCLUDE=D:/LAPACKE -DLIN_ALG_LIB="D:/LAPACKE/Build/lib/Release/lapacke.lib; D:/LAPACKE/Build/lib/Release/lapack.lib; D:/LAPACKE/Build/lib/Release/cblas.lib; D:/LAPACKE/Build/lib/Release/blas.lib; ""C:/Program Files (x86)\Intel/Composer XE 2015/compiler/lib/intel64/ifconsol.lib""; ""C:/Program Files (x86)\Intel\Composer XE 2015/compiler/lib/intel64/libifport.lib""; ""C:/Program Files (x86)\Intel/Composer XE 2015/compiler/lib/intel64/libifcoremt.lib""; ""C:/Program Files (x86)\Intel/Composer XE 2015/compiler/lib/intel64/libirc.lib""; ""C:/Program Files (x86)\Intel/Composer XE 2015/compiler/lib/intel64/libmmt.lib""; ""C:/Program Files (x86)\Intel/Composer XE 2015/compiler/lib/intel64/svml_dispmt.lib""; "