{"id":346,"date":"2024-09-27T10:35:13","date_gmt":"2024-09-27T02:35:13","guid":{"rendered":"https:\/\/www.linuxwinmac.com\/?p=346"},"modified":"2024-09-27T10:59:19","modified_gmt":"2024-09-27T02:59:19","slug":"ubuntu-%e6%9b%b4%e6%96%b0%e5%8d%87%e7%ba%a7-%e9%99%8d%e7%ba%a7-%e5%ae%89%e8%a3%85-gnu-gcc-g-gfortran%e7%bc%96%e8%af%91%e5%99%a8%e7%89%88%e6%9c%ac","status":"publish","type":"post","link":"https:\/\/www.linuxwinmac.com\/?p=346","title":{"rendered":"Ubuntu \u66f4\u65b0\u5347\u7ea7\/\u964d\u7ea7\u5b89\u88c5 GNU gcc g++ gfortran\u7f16\u8bd1\u5668\u7248\u672c"},"content":{"rendered":"\n<p>1\u3001\u6dfb\u52a0PPA\u8f6f\u4ef6\u6e90<\/p>\n\n\n\n<ol class=\"wp-block-list\"><\/ol>\n\n\n\n<p>sudo add-apt-repository ppa:ubuntu-toolchain-r\/test<br>sudo apt-get update<\/p>\n\n\n\n<p>2\u3001\u5b89\u88c5\u4e0d\u540c\u7684gcc g++ gfortran\u7248\u672c\uff0c\u6839\u636e\u81ea\u5df1\u7684\u9700\u8981\u8fdb\u884c\u9009\u62e9\u5b89\u88c5<\/p>\n\n\n\n<p>sudo apt-get install gcc-4.8 g++-4.8 gfortran-4.8<\/p>\n\n\n\n<p>sudo apt-get install gcc-4.9 g++-4.9 gfortran-4.9<\/p>\n\n\n\n<p>sudo apt-get install gcc-5 g++-5 gfortran-5<\/p>\n\n\n\n<p>sudo apt-get install gcc-6 g++-6 gfortran-6<\/p>\n\n\n\n<p>sudo apt-get install gcc-7 g++-7 gfortran-7<\/p>\n\n\n\n<p>sudo apt-get install gcc-8 g++-8 gfortran-8<\/p>\n\n\n\n<p>sudo apt-get install gcc-9 g++-9 gfortran-9<\/p>\n\n\n\n<p>sudo apt-get install gcc-10 g++-10 gfortran-10<\/p>\n\n\n\n<p>sudo apt-get install gcc-11 g++-11 gfortran-11<\/p>\n\n\n\n<p>3\u3001\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u66f4\u65b0\u7cfb\u7edf\u73af\u5883\u8def\u5f84\u91cc\u9762\u7684\u7f16\u8bd1\u5668\u7248\u672c\uff08\u4ee5gcc-9\u793a\u4f8b\uff0c\u9700\u6839\u636e\u81ea\u5df1\u5b9e\u9645\u5b89\u88c5\u7684\u7248\u672c\u8fdb\u884c\u66f4\u6539\uff09<\/p>\n\n\n\n<p>sudo rm -rf \/usr\/bin\/g++<br>sudo rm -rf \/usr\/bin\/cc<br>sudo rm -rf \/usr\/bin\/gcc<br>sudo rm -rf \/usr\/bin\/c++<br>sudo rm -rf \/usr\/bin\/gcc-ar<br>sudo rm -rf \/usr\/bin\/gcc-nm<br>sudo rm -rf \/usr\/bin\/gcc-ranlib<br>sudo rm -rf \/usr\/bin\/gfortran<br>sudo ln -s \/usr\/bin\/g++-9 \/usr\/bin\/g++<br>sudo ln -s \/usr\/bin\/gcc-9 \/usr\/bin\/gcc<br>sudo ln -s \/usr\/bin\/gcc-9 \/usr\/bin\/cc<br>sudo ln -s \/usr\/bin\/g++-9 \/usr\/bin\/c++<br>sudo ln -s \/usr\/bin\/gcc-ar-9 \/usr\/bin\/gcc-ar<br>sudo ln -s \/usr\/bin\/gcc-nm-9 \/usr\/bin\/gcc-nm<br>sudo ln -s \/usr\/bin\/gcc-ranlib-9 \/usr\/bin\/gcc-ranlib<br>sudo ln -s \/usr\/bin\/gfortran-9 \/usr\/bin\/gfortran<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u6dfb\u52a0PPA\u8f6f\u4ef6\u6e90 sudo add-apt-r &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-346","post","type-post","status-publish","format-standard","hentry","category-software-share"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=\/wp\/v2\/posts\/346","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=346"}],"version-history":[{"count":7,"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=\/wp\/v2\/posts\/346\/revisions"}],"predecessor-version":[{"id":359,"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=\/wp\/v2\/posts\/346\/revisions\/359"}],"wp:attachment":[{"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxwinmac.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}