"examples/vscode:/vscode.git/clone" did not exist on "9499f642fb3a46e38e44568bd7c03da579133147"
Unverified Commit 61bb943e authored by Mark Daoust's avatar Mark Daoust Committed by GitHub
Browse files

Update README.md

Update README.md compile instructions to match adding_an_op.
from [adding_an_op](https://github.com/tensorflow/tensorflow/blob/master/tensorflow/docs_src/extend/adding_an_op.md).

Tested: compiled using the modified instructions and ran `python word2vec_optimized_test.py`.

Fixes tensorflow/tensorflow#14620
parent 8e4a1e2e
......@@ -19,16 +19,19 @@ unzip -p source-archive.zip word2vec/trunk/questions-words.txt > questions-word
rm text8.zip source-archive.zip
```
You will need to compile the ops as follows:
You will need to compile the ops as follows (See
[Adding a New Op to TensorFlow](https://www.tensorflow.org/how_tos/adding_an_op/#building_the_op_library)
for more details).:
```shell
TF_INC=$(python -c 'import tensorflow as tf; print(tf.sysconfig.get_include())')
g++ -std=c++11 -shared word2vec_ops.cc word2vec_kernels.cc -o word2vec_ops.so -fPIC -I $TF_INC -O2 -D_GLIBCXX_USE_CXX11_ABI=0
TF_CFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))') )
TF_LFLAGS=( $(python -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))') )
g++ -std=c++11 -shared word2vec_ops.cc word2vec_kernels.cc -o word2vec_ops.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2 -D_GLIBCXX_USE_CXX11_ABI=0
```
On Mac, add `-undefined dynamic_lookup` to the g++ command.
(For an explanation of what this is doing, see the tutorial on [Adding a New Op to TensorFlow](https://www.tensorflow.org/how_tos/adding_an_op/#building_the_op_library). The flag `-D_GLIBCXX_USE_CXX11_ABI=0` is included to support newer versions of gcc. However, if you compiled TensorFlow from source using gcc 5 or later, you may need to exclude the flag.)
(The flag `-D_GLIBCXX_USE_CXX11_ABI=0` is included to support newer versions of gcc. However, if you compiled TensorFlow from source using gcc 5 or later, you may need to exclude the flag.)
Then run using:
```shell
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment