Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No C compiler on EC2?

I've been trying to install Gearman on my EC2 instance, but when I try to ./configure gearmand, I get this:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/ec2-user/gearmand-1.1.3':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

Now, the strange thing is that GCC is most definitely installed.

which gcc46

returns

/usr/bin/gcc46

However, when I try to run the command "gcc", it's not found...

I've tried to erase/intall/reinstall gcc and gcc-c++ via yum, but that doesn't seem to be helping.

Any advice? Thanks in advance.

like image 888
GhostCode Avatar asked Nov 10 '12 23:11

GhostCode


People also ask

Does Linux has inbuilt C compiler?

In general, yes. There are (or were) closed source programs though which are very low level and thus need to adapt to the kernel version by compiling some glue code. I have experienced that with VMware.

How do I fix configure error no acceptable C compiler found in $PATH?

Conclusion: If you ever get an error 'no acceptable C compiler found' while compiling OpenCA or any package, then the issue can be fixed by installing a C compiler (GCC or any appropriate compiler) and setting the path of the compiler in environment variable. Hope it helps.

What CPU does AWS EC2 use?

All instances have the following specs: 2.5 GHz AMD EPYC 7000 series processors. EBS Optimized. Enhanced Networking†

Why is my EC2 instance not connecting?

The following are common reasons why EC2 Instance Connect might not work as expected: EC2 Instance Connect doesn't support the OS distribution. The EC2 Instance Connect package isn't installed on the instance. There are missing or incorrect AWS Identity and Access Management (IAM) policies or permissions.


1 Answers

You can get around this by linking /usr/bin/gcc to /usr/bin/gcc46 using this command:

ln /usr/bin/gcc46 /usr/bin/gcc

When you upgrade gcc, you can then keep multiple versions with binaries named /usr/bin/gccXX and simple point the /usr/bin/gcc link to the version you want to use (which will probably be the newest one).

like image 150
Callum Rogers Avatar answered Oct 09 '22 01:10

Callum Rogers