Community
cancel
Showing results for 
Search instead for 
Did you mean: 
HFong
Novice
2,253 Views

How to upgrade GCC complier from 4.8 to 4.9?

Jump to solution

Hi,

I would like to upgrade GCC compliter from 4.8 to 4.9, however I cannot search for the command to upgrade this.

My gcc version is shown as per below:

root@edison:~# gcc --version

gcc (GCC) 4.8.2

Copyright (C) 2013 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

May I know the command line in order to upgrade GCC complier from 4.8 to 4.9?

Thank you.

1 Solution
idata
Community Manager
230 Views

Hello cnvery,

 

 

Version 4.9.1 of GCC can be downloaded from AlexT's repo. In case you haven't set up the repo yet, go to http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html to learn how to do it. Once the repo has been set, type the following commands:

 

 

opkg update

 

opkg install gcc

 

 

That should install GCC version 4.9.1. Let me know if it works.

 

 

Peter.

View solution in original post

10 Replies
idata
Community Manager
231 Views

Hello cnvery,

 

 

Version 4.9.1 of GCC can be downloaded from AlexT's repo. In case you haven't set up the repo yet, go to http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html http://alextgalileo.altervista.org/edison-package-repo-configuration-instructions.html to learn how to do it. Once the repo has been set, type the following commands:

 

 

opkg update

 

opkg install gcc

 

 

That should install GCC version 4.9.1. Let me know if it works.

 

 

Peter.

View solution in original post

HFong
Novice
230 Views

Hi Peter,

Thanks for the reply.

It works perfectly!

The GCC version now is 4.9 version.

root@edison:~# gcc --version

gcc (GCC) 4.9.1

Copyright (C) 2014 Free Software Foundation, Inc.

This is free software; see the source for copying conditions. There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

HFong
Novice
230 Views

Hi Peter,

May I know is there any way to restore back the GCC complier from 4.9.1 to 4.8.2?

When using GCC for 4.8.2 for compiling of Azure IoT SDK, it shows:

-- The C compiler identification is GNU 4.8.2

-- The CXX compiler identification is GNU 4.8.2

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- broken

When using GCC for 4.9.1 for compiling of Azure IoT SDK, it shows:

-- The C compiler identification is GNU 4.9.1

-- The CXX compiler identification is unknown

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- broken

Although gcc --version showed upgraded gcc (GCC) 4.9.1, but g++ --version showed g++ (GCC) 4.8.2.

This means gcc and g++ version are different.

Thank you.

idata
Community Manager
230 Views

Hi cnvery,

 

 

In fact if you use the latest version of the image both GCC and G++ have been updated to version 4.9.1. However if you still would like to uninstall it, you can do it with the following command:

 

 

opkg remove gcc --force-removal-of-dependent-packages

 

 

Peter.
HFong
Novice
230 Views

Hi Peter,

The mentioned command line will remove only GCC 4.9.1 itself (= restore back to 4.8.2) or remove whole GCC complier?

Thank you.

idata
Community Manager
230 Views

The line will remove the GCC compiler but you can install the version 4.8.2 if run the following lines:

 

 

echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/iotdk/i586/ http://iotdk.intel.com/repos/1.1/iotdk/i586/" >> /etc/opkg/iotdk.conf

 

opkg update

 

opkg install gcc

 

 

Peter.
HFong
Novice
230 Views

Hi Peter,

I have tried it out.

It still install back GCC 4.9.1.

After installation, "gcc --version" command showed "-sh: gcc: command not found".

Any idea on this?

Thank you.

idata
Community Manager
230 Views

I'm sorry, it was my mistake, the command I posted above:

 

 

echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/iotdk/i586/ http://iotdk.intel.com/repos/1.1/iotdk/i586/" >> /etc/opkg/iotdk.conf

 

 

Should have been:

 

 

echo "src intel-iotdk http://iotdk.intel.com/repos/1.1/iotdk/i586/ http://iotdk.intel.com/repos/1.1/iotdk/i586/" > /etc/opkg/iotdk.conf

 

 

Try it and let me know if this time it works, I'll be waiting for your reply.

 

Peter.
HFong
Novice
230 Views

Hi Peter,

The command line does not change the version it installed.

It still install back GCC 4.9.1 and "gcc --version" command showed "-sh: gcc: command not found" after installation.

Thank you.

idata
Community Manager
230 Views

If you keep receiving the message "-sh: gcc: command not found", I'd suggest you to reflash the Edison. Then you can follow these steps to install the 4.8.2 version of GCC manually (without using the repo):

 

 

1. opkg remove gcc --force-removal-of-dependent-packages

 

2. wget http://iotdk.intel.com/repos/1.1/iotdk/i586/gcc_4.8.2-r0_i586.ipk http://iotdk.intel.com/repos/1.1/iotdk/i586/gcc_4.8.2-r0_i586.ipk

 

3. opkg install gcc_4.8.2-r0_i586.ipk

 

 

That should install version 4.8.2 on your board. Let me know if it works.

 

Peter.
Reply