{"id":149,"date":"2016-11-01T08:16:46","date_gmt":"2016-11-01T08:16:46","guid":{"rendered":"http:\/\/siteblog.tuc.gr\/emmanuel\/?p=149"},"modified":"2016-11-02T09:50:26","modified_gmt":"2016-11-02T09:50:26","slug":"change-gcc-from-4-8-to-6-2-ubuntu-12-04lts","status":"publish","type":"post","link":"https:\/\/siteblog.tuc.gr\/emmanuel\/change-gcc-from-4-8-to-6-2-ubuntu-12-04lts\/","title":{"rendered":"Change gcc from 4.8 to 6.2 ubuntu 12.04LTS"},"content":{"rendered":"<pre>dpkg -l | grep gcc | awk '{print $2}'\r\n<\/pre>\n<p>First erased the current update-alternatives setup for gcc and g++: (not Neccesery)<\/p>\n<pre><span style=\"color: #008000\"># sudo update-alternatives --remove-all gcc<\/span>\r\n# <span style=\"color: #008000\">sudo update-alternatives --remove-all g++<\/span>\r\n<\/pre>\n<p><strong>Install Packages<\/strong><\/p>\n<p>It seems that both gcc-4.3 and gcc-4.4 are installed after install build-essential. However, we can explicitly install the following packages:<\/p>\n<pre><span style=\"color: #008000\">sudo apt-get install gcc-6 g++-6<\/span>\r\n<\/pre>\n<p><strong>Install Alternatives<\/strong><\/p>\n<p>Symbolic links cc and c++ are installed by default. We will install symbol links for gcc and g++, then link cc and c++ to gcc and g++ respectively.<\/p>\n<pre>#<span style=\"color: #008000\">sudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-4.8 10<\/span>\r\n<span style=\"color: #008000\">sudo update-alternatives --install \/usr\/bin\/gcc gcc \/usr\/bin\/gcc-6 20<\/span>\r\n\r\n#<span style=\"color: #008000\">sudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-4.8 10<\/span>\r\n<span style=\"color: #008000\">sudo update-alternatives --install \/usr\/bin\/g++ g++ \/usr\/bin\/g++-6 20<\/span>\r\n\r\n<span style=\"color: #008000\">sudo update-alternatives --install \/usr\/bin\/cc cc \/usr\/bin\/gcc 30<\/span>\r\n<span style=\"color: #008000\"> sudo update-alternatives --set cc \/usr\/bin\/gcc<\/span>\r\n\r\n<span style=\"color: #008000\">sudo update-alternatives --install \/usr\/bin\/c++ c++ \/usr\/bin\/g++ 30<\/span>\r\n<span style=\"color: #008000\"> sudo update-alternatives --set c++ \/usr\/bin\/g++<\/span>\r\n<\/pre>\n<p><strong>Configure Alternatives<\/strong><\/p>\n<p>The last step is configuring the default commands for gcc, g++. It&#8217;s easy to switch between 4.3 and 4.4 interactively:<\/p>\n<pre><span style=\"color: #008000\">sudo update-alternatives --config gcc<\/span>\r\n<span style=\"color: #008000\"> sudo update-alternatives --config g++\r\n\r\n<\/span>\r\n<code><span style=\"color: #008000\">gcc -v\r\ng++ -v<\/span><\/code><\/pre>\n<p><a href=\"http:\/\/askubuntu.com\/questions\/26498\/choose-gcc-and-g-version\">http:\/\/askubuntu.com\/questions\/26498\/choose-gcc-and-g-version<\/a><\/p>\n<hr \/>\n<p><code><br \/>\n<\/code><strong>Compile tinyos3<\/strong><\/p>\n<pre><span style=\"color: #008000\">Download tinyos3.zip<\/span>\r\n<span style=\"color: #008000\">unzip tinyos3.zip<\/span>\r\n<span style=\"color: #008000\">sudo apt-get install valgrind<\/span>\r\n<\/pre>\n<pre><span style=\"color: #008000\">nano kernel_sched.c<\/span>\r\n\r\n--- Line 59 ---\r\n\r\n\/\/#define MMAPPED_THREAD_MEM\r\n\r\nreplace\r\n\r\n#define MMAPPED_THREAD_MEM\r\n<\/pre>\n<pre><span style=\"color: #008000\">touch .depend<\/span>\r\n<span style=\"color: #008000\"> make<\/span>\r\n\r\n<span style=\"color: #008000\">.\/validate_api basic_tests<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>dpkg -l | grep gcc | awk &#8216;{print $2}&#8217; First erased the current update-alternatives setup for gcc and g++: (not Neccesery) # sudo update-alternatives &#8211;remove-all gcc # sudo update-alternatives &#8211;remove-all g++ Install Packages It seems that both gcc-4.3 and gcc-4.4 are installed after install build-essential. However, we can explicitly install the following packages: sudo apt-get [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,1],"tags":[],"class_list":["post-149","post","type-post","status-publish","format-standard","hentry","category-application-install","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/posts\/149","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/comments?post=149"}],"version-history":[{"count":10,"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/posts\/149\/revisions"}],"predecessor-version":[{"id":165,"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/posts\/149\/revisions\/165"}],"wp:attachment":[{"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/media?parent=149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/categories?post=149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/siteblog.tuc.gr\/emmanuel\/wp-json\/wp\/v2\/tags?post=149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}