Guest User

Untitled

a guest
Jul 16th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. # Cleanup old alternatives
  2. update-alternatives --remove-all cc
  3. update-alternatives --remove-all c++
  4.  
  5. update-alternatives --remove-all gcc
  6. update-alternatives --remove-all g++
  7. update-alternatives --remove-all clang
  8. update-alternatives --remove-all clang++
  9. update-alternatives --remove-all icc
  10. update-alternatives --remove-all icc++
  11.  
  12. # Add GCC versions
  13. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 10
  14. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 10
  15. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20
  16. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 20
  17. update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 30
  18. update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 30
  19.  
  20. # Add Clang versions
  21. update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.7 10
  22. update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.7 10
  23. update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 20
  24. update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang-3.8 20
  25. update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 30
  26. update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 30
  27.  
  28. # Add ICC versions
  29. update-alternatives --install /usr/bin/icc icc /opt/intel/compilers_and_libraries/linux/bin/intel64/icc 10
  30. update-alternatives --install /usr/bin/icc++ icc++ /opt/intel/compilers_and_libraries/linux/bin/intel64/icpc 10
  31.  
  32. # Add compilers
  33. update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30
  34. update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30
  35. update-alternatives --install /usr/bin/cc cc /usr/bin/clang 40
  36. update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 40
  37. update-alternatives --install /usr/bin/cc cc /usr/bin/icc 50
  38. update-alternatives --install /usr/bin/c++ c++ /usr/bin/icc++ 50
  39.  
  40. # Set compilers
  41. update-alternatives --set cc /usr/bin/gcc
  42. update-alternatives --set c++ /usr/bin/g++
  43.  
  44. update-alternatives --set cc /usr/bin/clang
  45. update-alternatives --set c++ /usr/bin/clang++
  46.  
  47. update-alternatives --set cc /usr/bin/icc
  48. update-alternatives --set c++ /usr/bin/icc++
  49.  
  50. # Remove existing
  51. update-alternatives --remove-all ld
  52. update-alternatives --remove-all ld.intel
  53.  
  54. # Add Icc linker
  55. update-alternatives --install /usr/bin/ld.intel ld.intel /opt/intel/compilers_and_libraries/linux/bin/intel64/xild 10
  56.  
  57. # Add all linkers
  58. update-alternatives --install /usr/bin/ld ld /usr/bin/ld.bfd 10
  59. update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold 20
  60. update-alternatives --install /usr/bin/ld ld /usr/bin/ld.intel 30
  61.  
  62. # Choose one
  63. update-alternatives --set ld /usr/bin/ld.bfd
  64. update-alternatives --set ld /usr/bin/ld.gold
  65. update-alternatives --set ld /usr/bin/ld.intel
  66.  
  67. # GCC
  68. update-alternatives --set gcc /usr/bin/gcc-4.9
  69. update-alternatives --set g++ /usr/bin/g++-4.9
  70.  
  71. update-alternatives --set gcc /usr/bin/gcc-5
  72. update-alternatives --set g++ /usr/bin/g++-5
  73.  
  74. update-alternatives --set gcc /usr/bin/gcc-6
  75. update-alternatives --set g++ /usr/bin/g++-6
  76.  
  77. # Clang
  78. update-alternatives --set clang /usr/bin/clang-4.0
  79. update-alternatives --set clang++ /usr/bin/clang++-4.0
Add Comment
Please, Sign In to add comment