@@ -9,17 +9,17 @@ NMTKit needs following libraries:
9
9
10
10
* ** GNU C++** ... v4.9 or later (or other compatible compilers)
11
11
* ** Boost C++ Library** ... v1.50 or later
12
- * ** Eigen** ... The newest development version
13
- * ** DyNet** ... v1.0-rc1.
12
+ * ** [ Eigen] ( http://eigen.tuxfamily.org/ ) ** ... The newest development version
13
+ * ** [ DyNet] ( https://github.com/clab/dynet ) ** ... v1.0-rc1 or later
14
+ * ** [ MTEval] ( https://github.com/odashi/mteval ) ** ... v1.0.0 or later
14
15
* ** CUDA** ... v7.5 or later
15
16
16
17
17
18
And the installation process may require following tools:
18
19
19
20
* ** Git**
20
21
* ** Mercurial**
21
- * ** autotools (autoconf, automake), libtool**
22
- * ** CMake** .
22
+ * ** CMake** ... v3.1 or later
23
23
24
24
25
25
Install Eigen
@@ -29,67 +29,95 @@ First we get the development version of Eigen using Mercurial.
29
29
This process could be done by only putting obtained files into an appropriate
30
30
location because Eigen consists of only header files:
31
31
32
- hg clone https://bitbucket.org/eigen/eigen/ /path/to/eigen
32
+ $ hg clone https://bitbucket.org/eigen/eigen/ /path/to/eigen
33
33
34
34
35
35
Install DyNet
36
36
-------------
37
37
38
38
Next we get and build DyNet:
39
39
40
- git clone https://github.com/clab/dynet.git /path/to/dynet
41
- cd /path/to/dynet
42
- mkdir build
43
- cd build
40
+ $ git clone https://github.com/clab/dynet.git /path/to/dynet
41
+ $ cd /path/to/dynet
42
+ $ mkdir build
43
+ $ cd build
44
44
45
45
Case of using CPUs to calculate neural network:
46
46
47
- cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen
48
- make -j <threads>
47
+ $ cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen
48
+ $ make -j <threads>
49
49
50
50
Case of using CUDA:
51
51
52
- cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DBACKEND=cuda
53
- make -j <threads>
52
+ $ cmake .. -DEIGEN3_INCLUDE_DIR=/path/to/eigen -DBACKEND=cuda
53
+ $ make -j <threads>
54
54
55
55
56
- Configuring library paths
57
- -------------------------
56
+ Install MTEval
57
+ --------------
58
58
59
- All shared libraries of CUDA and DyNet should be visible from the NMTKit
60
- binaries.
61
- Add a configuration in your shell-rc file like:
59
+ MTEval can be installed by similar way to DyNet:
62
60
63
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/cuda/lib64
64
- export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/dynet/build/dynet
61
+ $ git clone https://github.com/odashi/mteval.git /path/to/mteval
62
+ $ cd /path/to/mteval
63
+ $ mkdir build
64
+ $ cd build
65
+ $ cmake ..
66
+ $ make -j <threads>
65
67
66
68
67
69
Install NMTKit
68
70
--------------
69
71
70
- git clone https://github.com/odashi/nmtkit.git /path/to/nmtkit
71
- cd /path/to/nmtkit
72
- git submodule init
73
- git submodule update
74
- autoreconf -i
72
+ Prepare build tree for NMTKit:
75
73
76
- Case of using CPUs to calculate neural network:
74
+ $ git clone https://github.com/odashi/nmtkit.git /path/to/nmtkit
75
+ $ cd /path/to/nmtkit
76
+ $ git submodule init
77
+ $ git submodule update
78
+ $ mkdir build
79
+ $ cd build
77
80
78
- ./configure --with-eigen=/path/to/eigen --with-dynet=/path/to/dynet
79
- make
81
+ And configure makefiles with all library locations:
80
82
81
- Case of using CUDA:
83
+ $ cmake .. \
84
+ -DUSE_GPU=ON \ # need if you use CUDA
85
+ -DCUDA_ROOT=/path/to/cuda \ # ditto
86
+ -DEIGEN3_INCLUDE_DIR=/path/to/eigen \
87
+ -DDYNET_INCLUDE_DIR=/path/to/dynet \
88
+ -DDYNET_LIBRARY_DIR=/path/to/dynet/build/dynet \
89
+ -DMTEVAL_INCLUDE_DIR=/path/to/mteval \
90
+ -DMTEVAL_LIBRARY_DIR=/path/to/mteval/build/mteval \
91
+
92
+ And then:
82
93
83
- ./configure --with-eigen=/path/to/eigen --with-dynet=/path/to/dynet --with-cuda=/path/to/cuda
84
- make
94
+ $ make -j <threads>
95
+
96
+
97
+ Configuring library paths (optional)
98
+ ------------------------------------
99
+
100
+ All linked libraries should be visible from the NMTKit frontend binaries.
101
+ To give library locations explicitly, for example, add configurations in your
102
+ shell-rc file like:
103
+
104
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/cuda/lib64
105
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/boost/lib
106
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/dynet/build/dynet
107
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/mteval/build/mteval
108
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/nmtkit/build/nmtkit
85
109
86
110
87
111
Validation
88
112
----------
89
113
90
- make check
114
+ $ make test
91
115
92
116
Sample files could be used to validate the behavior of binaries:
93
117
94
- src/bin/train --config sample_data/tiny_config.ini --model model
95
- src/bin/decode --model model < sample_data/tiny.in
118
+ $ /path/to/nmtkit/build/bin/train \
119
+ --config /path/to/nmtkit/sample_data/tiny_config.ini \
120
+ --model model
121
+ $ /path/to/nmtkit/build/bin/decode \
122
+ --model model \
123
+ < /path/to/nmtkit/sample_data/tiny.in
0 commit comments