forked from syclik/stan-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
103 lines (67 loc) · 2.81 KB
/
notes.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
node.js: addon.
--------------------
Following: http://nodejs.org/api/addons.html
1) added: binding.gyp
2) export CC=clang++
2) build:
node-gyp configure
node-gyp build
or:
make linear_model
3)
node
var addon = require('./build/Release/linear_model');
var linear_model = new addon.LinearModel(10);
console.log(linear_model.sample());
console.log(linear_model.sample());
console.log(linear_model.sample());
unit testing for Node.js: mocha
--------------------
http://visionmedia.github.io/mocha/
Installation:
$ npm install -g mocha
websocketpp
--------------------
export BOOST_INCLUDES=/opt/local/include/boost
export BOOST_LIBS=/opt/local/lib
export CXX="clang++ -D_WEBSOCKETPP_NO_CPP11_SYSTEM_ERROR_"
scons examples/echo_server
Build boost thread library?
---------------------------
cd stan;
cd boost_1_53_0/
./bjam --clean
./bjam install variant=release link=static threading=multi \
runtime-link=static toolset=gcc \
thread chrono date_time
ls bin.v2/libs/thread/build/clang-darwin-4.2.1/release/threading-multi/libboost_thread.dylib
thread.cpp
export DYLD_LIBRARY_PATH=~/dev/stan-web/boost_1_53_0/bin.v2/libs/thread/build/clang-darwin-4.2.1/release/threading-multi:~/dev/stan-web/boost_1_53_0/bin.v2/libs/system/build/clang-darwin-4.2.1/release/threading-multi
From the home directory
-----------------------
cd stan; make CC=clang++ bin/stanc;
bin/stanc ../models/linear_model.stan --o=../models/linear_model.hpp --no_main;
cd ..;
export DYLD_LIBRARY_PATH=~/dev/stan-web/boost_1_53_0/bin.v2/libs/thread/build/clang-darwin-4.2.1/release/threading-multi:~/dev/stan-web/boost_1_53_0/bin.v2/libs/system/build/clang-darwin-4.2.1/release/threading-multi
export DYLD_LIBRARY_PATH=~/dev/stan-web/boost_1_53_0/bin.v2/libs/thread/build/gcc-4.6.3/release/threading-multi:~/dev/stan-web/boost_1_53_0/bin.v2/libs/system/build/gcc-4.6.3/release/threading-multi
g++ -I . -I stan/src \
-I stan/lib/eigen_3.1.3 -I stan/lib/boost_1.53.0 \
-L stan/bin -lstan \
-I wt/src -I wt/build \
-L wt/build/src -lwt -l wthttp \
-L /usr/local/lib \
-l boost_thread \
-l boost_system \
-lboost_random -lboost_regex -lboost_signals -lboost_system \
-lboost_thread -lboost_filesystem -lboost_program_options \
-lboost_date_time \
-o a.out src/websocket_linear_model.cpp
./a.out --docroot . --http-address 0.0.0.0 --http-port 9090
Compiling a wt project
------------------------------------------------------------
RE: How do I compile my first Wt project? - Added by Alec Taylor almost 2 years ago
To compile the code:
g++ -L/usr/lib -lwt -lwthttp <filename>.C -o <filename>.wt
To run the code on the server:
<filename>.wt --docroot ./ --http-address 0.0.0.0 --http-port 8080
(1-1/1)