Fix generate_examples build

- Add -march=native to host_copts and host_cxxopts in configure.py
- Make string.h for abstracting string differences at core interpreter level
- Use tensorflow special arg parse instead of flags
- Switch to using tool instead of data for dependency
- Fix python3  compatibility
  + Use six.StringIO instead of StringIO.StringIO
  + Use print_function
  + Properly set binary flags on TempFile's used in toco_convert
- Misc other path fixes

PiperOrigin-RevId: 174717673
This commit is contained in:
Andrew Selle
2017-11-06 09:37:03 -08:00
committed by TensorFlower Gardener
parent 3d590ada31
commit c9885ea7a7

View File

@@ -25,10 +25,12 @@ import re
import subprocess
import sys
# pylint: disable=g-import-not-at-top
try:
from shutil import which
except ImportError:
from distutils.spawn import find_executable as which
# pylint: enable=g-import-not-at-top
_TF_BAZELRC = os.path.join(os.path.dirname(os.path.abspath(__file__)),
'.tf_configure.bazelrc')
@@ -485,7 +487,10 @@ def set_cc_opt_flags(environ_cp):
cc_opt_flags = get_from_env_or_user_or_default(environ_cp, 'CC_OPT_FLAGS',
question, default_cc_opt_flags)
for opt in cc_opt_flags.split():
write_to_bazelrc('build:opt --cxxopt=%s --copt=%s' % (opt, opt))
host_opt = '-march=native' # It should be safe on the same build host.
write_to_bazelrc(
'build:opt --cxxopt=%s --copt=%s' % (opt, opt) +
' --host_cxxopt=%s --host_copt=%s' % (host_opt, host_opt))
def set_tf_cuda_clang(environ_cp):