Last active
August 25, 2023 14:14
-
-
Save ArseniyShestakov/a458b96a354014f80ab8d95676100c03 to your computer and use it in GitHub Desktop.
My compiler alternatives
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cleanup old alternatives | |
update-alternatives --remove-all cc | |
update-alternatives --remove-all c++ | |
update-alternatives --remove-all gcc | |
update-alternatives --remove-all g++ | |
update-alternatives --remove-all clang | |
update-alternatives --remove-all clang++ | |
update-alternatives --remove-all icc | |
update-alternatives --remove-all icc++ | |
# Add GCC versions | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.9 10 | |
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.9 10 | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 20 | |
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 20 | |
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 30 | |
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 30 | |
# Add Clang versions | |
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.7 10 | |
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-3.7 10 | |
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-3.8 20 | |
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang-3.8 20 | |
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 30 | |
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 30 | |
# Add ICC versions | |
update-alternatives --install /usr/bin/icc icc /opt/intel/compilers_and_libraries/linux/bin/intel64/icc 10 | |
update-alternatives --install /usr/bin/icc++ icc++ /opt/intel/compilers_and_libraries/linux/bin/intel64/icpc 10 | |
# Add compilers | |
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 | |
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 | |
update-alternatives --install /usr/bin/cc cc /usr/bin/clang 40 | |
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 40 | |
update-alternatives --install /usr/bin/cc cc /usr/bin/icc 50 | |
update-alternatives --install /usr/bin/c++ c++ /usr/bin/icc++ 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
update-alternatives --set cc /usr/bin/gcc | |
update-alternatives --set c++ /usr/bin/g++ | |
update-alternatives --set cc /usr/bin/clang | |
update-alternatives --set c++ /usr/bin/clang++ | |
update-alternatives --set cc /usr/bin/icc | |
update-alternatives --set c++ /usr/bin/icc++ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove existing | |
update-alternatives --remove-all ld | |
update-alternatives --remove-all ld.intel | |
# Add Icc linker | |
update-alternatives --install /usr/bin/ld.intel ld.intel /opt/intel/compilers_and_libraries/linux/bin/intel64/xild 10 | |
# Add all linkers | |
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.bfd 10 | |
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.gold 20 | |
update-alternatives --install /usr/bin/ld ld /usr/bin/ld.intel 30 | |
# Choose one | |
update-alternatives --set ld /usr/bin/ld.bfd | |
update-alternatives --set ld /usr/bin/ld.gold | |
update-alternatives --set ld /usr/bin/ld.intel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GCC | |
update-alternatives --set gcc /usr/bin/gcc-4.9 | |
update-alternatives --set g++ /usr/bin/g++-4.9 | |
update-alternatives --set gcc /usr/bin/gcc-5 | |
update-alternatives --set g++ /usr/bin/g++-5 | |
update-alternatives --set gcc /usr/bin/gcc-6 | |
update-alternatives --set g++ /usr/bin/g++-6 | |
# Clang | |
update-alternatives --set clang /usr/bin/clang-4.0 | |
update-alternatives --set clang++ /usr/bin/clang++-4.0 | |
# Icc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment