Set GCC_HOST_COMPILER_PATH.
(environ_cp)
| 821 | |
| 822 | |
| 823 | def 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 | |
| 844 | def reformat_version_sequence(version_str, sequence_count): |
no test coverage detected