parameters: (environ_cp)
docstring: Set GCC_HOST_COMPILER_PATH.
docstring_summary: Set GCC_HOST_COMPILER_PATH.
docstring_tokens: Set GCC_HOST_COMPILER_PATH .
function: def set_gcc_host_compiler_path(environ_cp):
    """Set GCC_HOST_COMPILER_PATH."""
    default_gcc_host_compiler_path = which('gcc') or ''
    cuda_bin_symlink = '%s/bin/gcc' % environ_cp.get('CUDA_TOOLKIT_PATH')
  
    if os.path.islink(cuda_bin_symlink):
      # os.readlink is only available in linux
      default_gcc_host_compiler_path = os.path.realpath(cuda_bin_symlink)
  
    gcc_host_compiler_path = prompt_loop_or_load_from_env(
        environ_cp,
        var_name='GCC_HOST_COMPILER_PATH',
        var_default=default_gcc_host_compiler_path,
        ask_for_var=
        'Please specify which gcc should be used by nvcc as the host compiler.',
        check_success=os.path.exists,
        error_msg='Invalid gcc path. %s cannot be found.',
    )
  
    write_action_env_to_bazelrc('GCC_HOST_COMPILER_PATH', gcc_host_compiler_path)
function_tokens: def set_gcc_host_compiler_path ( environ_cp ) : default_gcc_host_compiler_path = which ( 'gcc' ) or '' cuda_bin_symlink = '%s/bin/gcc' % environ_cp . get ( 'CUDA_TOOLKIT_PATH' ) if os . path . islink ( cuda_bin_symlink ) : # os.readlink is only available in linux default_gcc_host_compiler_path = os . path . realpath ( cuda_bin_symlink ) gcc_host_compiler_path = prompt_loop_or_load_from_env ( environ_cp , var_name = 'GCC_HOST_COMPILER_PATH' , var_default = default_gcc_host_compiler_path , ask_for_var = 'Please specify which gcc should be used by nvcc as the host compiler.' , check_success = os . path . exists , error_msg = 'Invalid gcc path. %s cannot be found.' , ) write_action_env_to_bazelrc ( 'GCC_HOST_COMPILER_PATH' , gcc_host_compiler_path )