-
Notifications
You must be signed in to change notification settings - Fork 0
Using the DyNet Fork
The intial versions of fatdynet did not require particularly many changes to the original DyNet source code, and those changes could be documented on these wiki pages. Beginning with version 0.2.3, zip support was added, which entailed too many changes to track in the same way. The DyNet repository was consequently forked. Then it no longer made sense to separately track the several simple changes required of the original code. These have been incorporated into the fork and in some cases propagated back to the original project, although they have not necessarily been included in a release. It is therefore recommended that people interested in compiling DyNet for use in a fatdynet way make use of this forked version.
These instructions explain how compiling this forked version differs from compiling the original version.
On Mac OS X
No changes in instruction
No changes in instruction
Use git clone https://github.com/kwalcock/dynet.git
instead.
Do not edit any of the files. Leave build.sbt
, dynet_swig.i
, and others unchanged.
Change the cmake
command to
cmake .. -DEIGEN3_INCLUDE_DIR=<eigen_directory> -DENABLE_CPP_EXAMPLES=ON -DENABLE_SWIG=ON -DENABLE_ZIP=ON -DENABLE_NONNATIVE=ON -DENABLE_RELOCATABLE=ON -DSCALA_VERSION=2.12.4
depending on where eigen3 was installed. This command is recorded
in cmake.mac-intel.sh
. A similar command, with the addition of -DENABLE_APPLE=ON
is recorded in cmake.mac-m1.sh
to account for machines running on Apple silicon.
There are no other changes in this section.
This section is new. You may want to try the ser-par
test program which isn't part of the original DyNet.
$ cd examples
$ ./ser-par
$ cd ..
No changes in instruction
No changes in instruction
On Linux
The directory structure includes a few additions, but it is not necessary to access them.
No changes in instruction
- For DyNet, use
git clone https://github.com/kwalcock/dynet.git
and do not checkout any tags. - Do not edit any of
build.sbt
,dynet_swig.i
,io.cc
,
The cmake
command should be changed to account for the additional functionality:
cmake .. -DSCALA_VERSION=2.11.11 -DEIGEN3_INCLUDE_DIR=../../eigen -DENABLE_CPP_EXAMPLES=ON -DENABLE_SWIG=ON -DENABLE_ZIP=ON -DENABLE_NONNATIVE=ON -DENABLE_RELOCATABLE=ON
. This command is recorded
in cmake.linux.sh
.
In addition to the other tests, one might run the ser-par
example:
$ cd examples
$ ./ser-par
$ cd ..
Again the cmake
command should be changed: cmake .. -DSCALA_VERSION=2.12.4 -DEIGEN3_INCLUDE_DIR=../../eigen -DENABLE_CPP_EXAMPLES=ON -DENABLE_SWIG=ON -DENABLE_ZIP=ON -DENABLE_NONNATIVE=ON -DENABLE_RELOCATABLE=ON
.
The example C++ program should not have changed, so there is no reason to revisit it.
On Windows
The directory structure includes a few additions, but it is not necessary to access them.
No changes in instruction
Download from https://github.com/kwalcock/dynet/archive/master.zip.
Do not edit any of the files dynet_swig.i
or io.cc
.
Change the cmake
command to cmake .. -DSWIG_EXECUTABLE=D:/Users/you/Projects/dynet/swigwin-3.0.12/swigwin-3.0.12/swig.exe -DSWIG_DIR=D:/Users/you/Projects/dynet/swigwin-3.0.12/swigwin-3.0.12 -DEIGEN3_INCLUDE_DIR=D:/Users/you/Projects/dynet/eigen-eigen-b2e267dc99d4/eigen-eigen-b2e267dc99d4 -DENABLE_CPP_EXAMPLES=ON -DENABLE_SWIG=ON -DENABLE_ZIP=ON -DENABLE_RELOCATABLE=ON -G"Visual Studio 14 2015 Win64"
, adjusted as needed for your directory structure. This command is recorded
in cmake.windows.sh
.
You might additionally build and run the ser-par
project.
No changes in instruction