MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / set_gcc_host_compiler_path

Function set_gcc_host_compiler_path

configure.py:823–841  ·  view source on GitHub ↗

Set GCC_HOST_COMPILER_PATH.

(environ_cp)

Source from the content-addressed store, hash-verified

821
822
823def set_gcc_host_compiler_path(environ_cp):
824 """Set GCC_HOST_COMPILER_PATH."""
825 default_gcc_host_compiler_path = which('gcc') or ''
826 cuda_bin_symlink = '%s/bin/gcc' % environ_cp.get('CUDA_TOOLKIT_PATH')
827
828 if os.path.islink(cuda_bin_symlink):
829 # os.readlink is only available in linux
830 default_gcc_host_compiler_path = os.path.realpath(cuda_bin_symlink)
831
832 gcc_host_compiler_path = prompt_loop_or_load_from_env(
833 environ_cp,
834 var_name='GCC_HOST_COMPILER_PATH',
835 var_default=default_gcc_host_compiler_path,
836 ask_for_var='Please specify which gcc should be used by nvcc as the host compiler.',
837 check_success=os.path.exists,
838 error_msg='Invalid gcc path. %s cannot be found.',
839 )
840
841 write_action_env_to_bazelrc('GCC_HOST_COMPILER_PATH', gcc_host_compiler_path)
842
843
844def reformat_version_sequence(version_str, sequence_count):

Callers 1

mainFunction · 0.85

Calls 3

getMethod · 0.45

Tested by

no test coverage detected