dpkg -l | grep gcc | awk '{print $2}'
First erased the current update-alternatives setup for gcc and g++: (not Neccesery)
# sudo update-alternatives --remove-all gcc # sudo update-alternatives --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 install gcc-6 g++-6
Install Alternatives
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.
#sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 10 sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 20 #sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 10 sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 20 sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 sudo update-alternatives --set cc /usr/bin/gcc sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 sudo update-alternatives --set c++ /usr/bin/g++
Configure Alternatives
The last step is configuring the default commands for gcc, g++. It’s easy to switch between 4.3 and 4.4 interactively:
sudo update-alternatives --config gcc
sudo update-alternatives --config g++
gcc -v
g++ -v
http://askubuntu.com/questions/26498/choose-gcc-and-g-version
Compile tinyos3
Download tinyos3.zip unzip tinyos3.zip sudo apt-get install valgrind
nano kernel_sched.c
--- Line 59 ---
//#define MMAPPED_THREAD_MEM
replace
#define MMAPPED_THREAD_MEM
touch .depend make ./validate_api basic_tests