LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   GCC not found (http://www.linuxquestions.org/questions/slackware-14/gcc-not-found-910539/)

cenazoic 10-27-2011 04:10 PM

GCC not found
 
Hi all,

I recently installed the 64-bit 13.37 image on Linode.

I also manually downloaded and installed the /d/ group (including gcc) using installpkg.

When attempting to compile Apache, I get this error:


Quote:

checking for chosen layout... Apache
checking for working mkdir -p... yes
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

Configuring Apache Portable Runtime library ...

checking for APR... yes
setting CC to "gcc"
setting CPP to "gcc -E"
setting CFLAGS to " -pthread"
setting CPPFLAGS to " -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE"
setting LDFLAGS to " "

Configuring Apache Portable Runtime Utility library...

checking for APR-util... yes
checking for gcc... gcc
checking for C compiler default output file name...
configure: error: in `/usr/src/httpd-2.2.21':
configure: error: C compiler cannot create executables
See `config.log' for more details.
Fine.

Config.log says:
Quote:

configure:4698: checking for C compiler version
configure:4707: gcc --version >&5
./configure: line 4709: /usr/bin/gcc: No such file or directory
configure:4718: $? = 127
configure:4707: gcc -v >&5
./configure: line 4709: /usr/bin/gcc: No such file or directory
configure:4718: $? = 127
configure:4707: gcc -V >&5
./configure: line 4709: /usr/bin/gcc: No such file or directory
configure:4718: $? = 127
configure:4707: gcc -qversion >&5
./configure: line 4709: /usr/bin/gcc: No such file or directory
configure:4718: $? = 127
configure:4740: checking for C compiler default output file name
configure:4762: gcc -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE conftest.c >&5
./configure: line 4764: /usr/bin/gcc: No such file or directory
configure:4766: $? = 127
configure:4803: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <stdio.h>
| int
| main ()
| {
| FILE *f = fopen ("conftest.out", "w");
| return ferror (f) || fclose (f) != 0;
|
| ;
| return 0;
| }
configure:4809: error: in `/usr/src/httpd-2.2.21':
configure:4813: error: C compiler cannot create executables
See `config.log' for more details.
me@linode:/usr/src/httpd-2.2.21# whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/lib64/gcc /usr/X11R6/bin/gcc /usr/bin/X11/gcc /usr/X11/bin/gcc /usr/libexec/gcc /usr/man/man1/gcc.1.gz /usr/share/man/man1/gcc.1.gz /usr/X11/man/man1/gcc.1.gz
me@linode:/usr/src/httpd-2.2.21# gcc -v
-bash: /usr/bin/gcc: No such file or directory

So it seems to see it on the one hand and not find it on the other. Can anyone point me in the right direction?

Thanks for your help!

Cultist 10-27-2011 04:16 PM

are you able to compile and install any slackbuilds? Those almost always require gcc to install.

You may be trying to compile a 32-bit application without being multilib enabled

adamk75 10-27-2011 04:36 PM

What is the output of:

Code:

ls -l /usr/bin/gcc
Adam

dive 10-27-2011 05:36 PM

And also to the point what is the output of 'file /usr/bin/gcc'?

I suspect a 32 binary

cenazoic 10-27-2011 06:45 PM

Adam,

ls -l /usr/bin/gcc == /usr/bin/gcc -> gcc-4.5.3*

Dive,

file /usr/bin/gcc == /usr/bin/gcc: symbolic link to `gcc-4.5.3'

Slacktat,

After your comment I updated using AlienBob's multilib instructions/packages. While I can now 'gcc -v' and get an appropriate response, I'm still getting errors ./configuring Apache. Here's the config.log (different error, so progress, I suppose. :))

Quote:

configure:4740: checking for C compiler default output file name
configure:4762: gcc -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -D_LARGEFILE64_SOURCE conftest.c >&5
/usr/libexec/gcc/x86_64-slackware-linux/4.5.3/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
configure:4766: $? = 1
configure:4803: result:
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <stdio.h>
| int
| main ()
| {
| FILE *f = fopen ("conftest.out", "w");
| return ferror (f) || fclose (f) != 0;
|
| ;
| return 0;
| }
configure:4809: error: in `/usr/src/httpd-2.2.21':
configure:4813: error: C compiler cannot create executables
Thanks for the help, guys!

Cena

dive 10-27-2011 07:14 PM

Go back a step. You shouldn't need to build 32bit apache/httpd on 64bit slackware. You should use 64bit.

Any reason why the provided stock slackware package is no good for you?

If you need to update then it's a matter of finding out the missing libs and installing/building those too.

As usual www.slackbuilds.org has a lot of things that your local slackware mirror doesn't provide.

dive 10-27-2011 07:17 PM

By the way did you run 'file' on that gcc-4.5.3?

NoStressHQ 10-27-2011 08:21 PM

It's normal, the Linode's Slackware is a highly lighten one...

You need to install quite some packages more than that, sorry, I don't remember the exact packages, but I remember spending some time doing "installpkg" from the mirrors. (wget was missing too if I remember well).

You might miss binutils or gnu ld...

Anyway on the server, moreover if you have a tiny one (low mem, low disk) as I have, you'd better use the 32 bit version to save some space.

Don't be desperate, install some more packages from the basic repo and you should get somewhere :).
(Just avoid the X and KDE stuff, all the rest worth installing).

Good luck and keep the faith !

Garry.

Edit: I remember having focused on first having lftp installed, to be able to have a "local mirror" on the server, after that, package installs were easier. Btw, Linode recently changed the bandwidth policy, and you have no limit to "download" from the server point of view, so use it without being shy :).

the3dfxdude 10-27-2011 08:51 PM

Quote:

Originally Posted by cenazoic (Post 4510194)
Adam,

ls -l /usr/bin/gcc == /usr/bin/gcc -> gcc-4.5.3*

Dive,

file /usr/bin/gcc == /usr/bin/gcc: symbolic link to `gcc-4.5.3'

Slacktat,

After your comment I updated using AlienBob's multilib instructions/packages. While I can now 'gcc -v' and get an appropriate response, I'm still getting errors ./configuring Apache. Here's the config.log (different error, so progress, I suppose. :))



Thanks for the help, guys!

Cena


It is clear from the log file you are missing
libmpc-0.8.2-x86_64-2.txz

Please also run 'ldd /usr/libexec/gcc/x86_64-slackware-linux/4.5.3/cc1' to check for more missing libraries. You should have got the required libraries from the l/ series, which is not clear that you installed that series.

I'm not sure what this other talk about 32-bit Apache / 64-bit multi-lib, so you might want to explain more. But if you are multi-lib, make sure you install the appropriate corresponding multi-lib packages so you can compile the way you are intending.

nblxxx 03-01-2013 10:51 AM

Hi folks,

I recently got myself a linode node with a slackware64 13.37 image, upgraded to current, installed gcc then tried to install nginx and got the "checking for C compiler ... not found" issue

However the line right before that tells me i'm running a 3.7.10 kernel, which is not the same version my gcc was compiled against (3.7.1)

Does that matter? should i recompile all my dev packages against this kernel (including kernel source) ?

thanks,


All times are GMT -5. The time now is 09:37 AM.