|
11 | 11 | - [Download and install](#download-and-install) |
12 | 12 | - [Easy installation methods](#easy-installation-methods) |
13 | 13 | - [Install DeePMD-kit from scratch](#install-deepmd-kit-from-scratch) |
14 | | - - [Install tensorflow's Python interface](#install-tensorflows-python-interface) |
15 | | - - [Install tensorflow's C++ interface](#install-tensorflows-c-interface) |
16 | | - - [Install xdrfile](#install-xdrfile) |
| 14 | + - [Install tensorflow](#install-tensorflow) |
17 | 15 | - [Install DeePMD-kit](#install-deepmd-kit) |
18 | 16 | - [Install LAMMPS's DeePMD-kit module](#install-lammpss-deepmd-kit-module) |
19 | 17 | - [Build DeePMD-kit with GPU support](#build-deepmd-kit-with-gpu-support) |
@@ -88,117 +86,8 @@ A docker for installing the DeePMD-kit on CentOS 7 is available [here](https://g |
88 | 86 | ## Install DeePMD-kit from scratch |
89 | 87 | Installing DeePMD-kit from scratch is lengthy, but do not be panic. Just follow step by step. Wish you good luck.. |
90 | 88 |
|
91 | | -### Install tensorflow's Python interface |
92 | | -There are two ways of installing the Python interface of tensorflow, either [using google's binary](https://www.tensorflow.org/install/install_linux), or [installing from sources](https://www.tensorflow.org/install/install_sources). When you are using google's binary, do not forget to add the option `-DTF_GOOGLE_BIN=true` when building DeePMD-kit. |
93 | | - |
94 | | -### Install tensorflow's C++ interface |
95 | | -The tensorflow's C++ interface will be compiled from the source code. Before starting compilation, it may be a good idea to check the environment requirement of tensorflow by the [officially tested configurations](https://www.tensorflow.org/install/install_sources#tested_source_configurations). If you do not have `bazel`, please [install it](https://docs.bazel.build/versions/master/install.html). |
96 | | - |
97 | | -Firstly get the source code of the tensorflow |
98 | | -```bash |
99 | | -cd /some/workspace |
100 | | -git clone https://github.com/tensorflow/tensorflow tensorflow |
101 | | -``` |
102 | | -The DeePMD-kit works with tensorflow r1.4 and later versions. Now taking r1.8 for example: |
103 | | -```bash |
104 | | -cd tensorflow |
105 | | -git checkout r1.8 |
106 | | -``` |
107 | | - |
108 | | -DeePMD-kit is compiled by cmake, so we need to compile and integrate tensorflow with cmake projects. The rest of this section basically follows [the instruction provided by Tuatini](http://tuatini.me/building-tensorflow-as-a-standalone-project/). Now execute |
109 | | -```bash |
110 | | -./configure |
111 | | -``` |
112 | | -You will answer a list of questions that help configure the building of tensorflow. It is recommended to build for Python3. You may want to answer the question like this: |
113 | | -```bash |
114 | | -Please specify the location of python. [Default is /usr/bin/python]: /usr/bin/python3 |
115 | | -``` |
116 | | -The library path for Python should be set accordingly. |
117 | | - |
118 | | -Now build the shared library of tensorflow: |
119 | | -```bash |
120 | | -bazel build -c opt --verbose_failures //tensorflow:libtensorflow_cc.so |
121 | | -``` |
122 | | -You may want to add options `--copt=-msse4.2`, `--copt=-mavx`, `--copt=-mavx2` and `--copt=-mfma` to enable SSE4.2, AVX, AVX2 and FMA SIMD accelerations, respectively. It is noted that these options should be chosen according to the CPU architecture. If the RAM becomes an issue of your machine, you may limit the RAM usage by using `--local_resources 2048,.5,1.0`. |
123 | | - |
124 | | -Now I assume you want to install tensorflow in directory `$tensorflow_root`. Create the directory if it does not exists |
125 | | -```bash |
126 | | -mkdir -p $tensorflow_root |
127 | | -``` |
128 | | -Before moving on, we need to compile the dependencies of tensorflow, including Protobuf, Eigen and nsync. Firstly, protobuf |
129 | | -```bash |
130 | | -mkdir /tmp/proto |
131 | | -tensorflow/contrib/makefile/download_dependencies.sh |
132 | | -cd tensorflow/contrib/makefile/downloads/protobuf/ |
133 | | -./autogen.sh |
134 | | -./configure --prefix=/tmp/proto/ |
135 | | -make |
136 | | -make install |
137 | | -``` |
138 | | -Then Eigen |
139 | | -```bash |
140 | | -mkdir /tmp/eigen |
141 | | -cd ../eigen |
142 | | -mkdir build_dir |
143 | | -cd build_dir |
144 | | -cmake -DCMAKE_INSTALL_PREFIX=/tmp/eigen/ ../ |
145 | | -make install |
146 | | -``` |
147 | | -And nsync |
148 | | -```bash |
149 | | -mkdir /tmp/nsync |
150 | | -cd ../../nsync |
151 | | -mkdir build_dir |
152 | | -cd build_dir |
153 | | -cmake -DCMAKE_INSTALL_PREFIX=/tmp/nsync/ ../ |
154 | | -make |
155 | | -make install |
156 | | -cd ../../../../../.. |
157 | | -``` |
158 | | -Now, copy the libraries to the tensorflow's installation directory: |
159 | | -```bash |
160 | | -mkdir $tensorflow_root/lib |
161 | | -cp bazel-bin/tensorflow/libtensorflow_cc.so $tensorflow_root/lib/ |
162 | | -cp bazel-bin/tensorflow/libtensorflow_framework.so $tensorflow_root/lib/ |
163 | | -cp /tmp/proto/lib/libprotobuf.a $tensorflow_root/lib/ |
164 | | -cp /tmp/nsync/lib/libnsync.a $tensorflow_root/lib/ |
165 | | -``` |
166 | | -Then copy the headers |
167 | | -```bash |
168 | | -mkdir -p $tensorflow_root/include/tensorflow |
169 | | -cp -r bazel-genfiles/* $tensorflow_root/include/ |
170 | | -cp -r tensorflow/cc $tensorflow_root/include/tensorflow |
171 | | -cp -r tensorflow/core $tensorflow_root/include/tensorflow |
172 | | -cp -r third_party $tensorflow_root/include |
173 | | -cp -r /tmp/proto/include/* $tensorflow_root/include |
174 | | -cp -r /tmp/eigen/include/eigen3/* $tensorflow_root/include |
175 | | -cp -r /tmp/nsync/include/*h $tensorflow_root/include |
176 | | -``` |
177 | | -Now clean up the source files in the header directories: |
178 | | -```bash |
179 | | -cd $tensorflow_root/include |
180 | | -find . -name "*.cc" -type f -delete |
181 | | -``` |
182 | | -The temporary installation directories for the dependencies can be removed: |
183 | | -```bash |
184 | | -rm -fr /tmp/proto /tmp/eigen /tmp/nsync |
185 | | -``` |
186 | | - |
187 | | -### Install xdrfile |
188 | | -xdrfile is a lib that reads, compresses and writes the MD trajectories. Firstly get the source: |
189 | | -```bash |
190 | | -cd /some/workspace |
191 | | -wget ftp://ftp.gromacs.org/pub/contrib/xdrfile-1.1.4.tar.gz |
192 | | -``` |
193 | | -I assume you want to install it in `$xdrfile_root`, then you will probably do |
194 | | -```bash |
195 | | -tar xvf xdrfile-1.1.4.tar.gz |
196 | | -cd xdrfile-1.1.4 |
197 | | -./configure --prefix=$xdrfile_root |
198 | | -make |
199 | | -make install |
200 | | -``` |
201 | | - |
| 89 | +### Install tensorflow |
| 90 | +We tested two tensorflow installation options. You may follow either [tf-1.8](doc/install-tf.1.8.md) or [tf-1.12](doc/install-tf.1.12.md). Click one of the links and follow the instructions therein. Of course, other installation options are not forbidden. |
202 | 91 |
|
203 | 92 | ### Install DeePMD-kit |
204 | 93 | The DeePMD-kit was tested with compiler gcc >= 4.9. |
|
0 commit comments