build.sh 430 B

12345678910
  1. #!/bin/bash
  2. if [ "$TF_CFLAGS" == "" ]; then
  3. export TF_CFLAGS=( $(python3 -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_compile_flags()))' 2>/dev/null) )
  4. fi
  5. if [ "$TF_LFLAGS" == "" ]; then
  6. export TF_LFLAGS=( $(python3 -c 'import tensorflow as tf; print(" ".join(tf.sysconfig.get_link_flags()))' 2>/dev/null) )
  7. fi
  8. g++ -g -std=c++11 -shared matMul.cc -o matMul.so -fPIC ${TF_CFLAGS[@]} ${TF_LFLAGS[@]} -O2 -Wall