Skip to content

Instantly share code, notes, and snippets.

@hadifar
Last active January 24, 2018 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hadifar/6bac603c035d7a4306181179eea5201f to your computer and use it in GitHub Desktop.
Save hadifar/6bac603c035d7a4306181179eea5201f to your computer and use it in GitHub Desktop.
compile OPS file
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment