28

I am trying to make Sphinx from source on a 32-bit CentOS 6 VPS.

When I run this command:

./configure --prefix=/usr/local/sphinx

I get this error output:

checking build environment
--------------------------

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no

checking for compiler programs
------------------------------

checking whether to compile debug version... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/gnotes/sphinx':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

What I don't understand is that GCC is installed so why can't configure find an acceptable C compiler?

Here's the output of yum:

sudo yum install gcc

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.metrocast.net
 * extras: centos.mirror.constant.com
 * updates: mirror.lug.udel.edu
base                                                                                                                                                                      | 3.7 kB     00:00     
extras                                                                                                                                                                    | 3.5 kB     00:00     
updates                                                                                                                                                                   | 3.4 kB     00:00     
Setting up Install Process
Package gcc-4.4.7-3.el6.i686 already installed and latest version
Nothing to do

What gives?

4

8 回答 8

38

尝试yum groupinstall "Development Tools"

如果安装成功,那么您将拥有一整套开发工具。如 gcc、g++、make、ld 等。之后,您可以再次尝试编译代码块。

由于yum已弃用,您可以dnf改用:

dnf groupinstall "Development Tools"
于 2013-09-17T13:26:41.487 回答
16

在Ubuntu Debian Base中安装 GCC

sudo apt-get install build-essential
于 2015-04-23T14:09:07.330 回答
7

我现在有同样的问题。我只是跑yum install gcc

于 2013-12-14T01:18:15.773 回答
5

尝试CC在配置时指定:

CC=/usr/bin/gcc ./configure --prefix=/usr/local/sphinx

还要检查您的编译器是否生成可执行文件。下面应该产生一个a.out

echo "int main(){0;}" | gcc -x c -
于 2013-08-06T09:32:26.180 回答
4

也许 gcc 不在您的路径中?尝试使用 gcc 查找which gcc并将其添加到您的路径(如果它尚不存在)。

于 2013-08-06T09:21:23.510 回答
1

有时 gcc 已创建为/usr/bin/gcc32. 所以请创建一个ln -s /usr/bin/gcc32 /usr/bin/gcc然后编译它./configure

于 2014-11-24T07:37:04.767 回答
1

我的头脑也有同样的问题。我尝试使用 sudo apt-get install build-essential 它仍然无法正常工作。我只是在 /usr/bin/ 文件夹中创建了一个指向 gcc-x 二进制文件的硬链接。sudo ls /usr/bin/gcc-x /usr/bin/gcc

这对我有用!

于 2016-03-15T07:04:35.093 回答
0

以下软件包也可以帮助您,

yum install gcc glibc glibc-common gd gd-devel -y
于 2015-04-23T13:57:44.197 回答