python - 调试错误 "gcc: error: x86_64-linux-gnu-gcc: No such file or directory"

标签 python gcc makefile autotools

我正在尝试构建: https://github.com/kanzure/nanoengineer

但它看起来像错误:

gcc -DHAVE_CONFIG_H -I. -I../.. -I/usr/include/python2.7   -std=c99 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -MT libstructcompare_a-structcompare.o -MD -MP -MF .deps/libstructcompare_a-structcompare.Tpo -c -o libstructcompare_a-structcompare.o `test -f 'structcompare.c' || echo './'`structcompare.c
gcc: error: x86_64-linux-gnu-gcc: No such file or directory

x86_64-linux-gnu-gcc 肯定存在于 /usr/bin 中(这是一个符号链接(symbolic link)),并且目标也肯定存在。在我看来,Makefile 没有正确生成,也许在指定 x86_64-linux-gnu-gcc 之前应该传递一个标志?我也不确定指定 x86_64-linux-gnu-gcc 应该完成什么。

最后,这个 makefile 是由 configure 生成的,所以一旦我们缩小了错误的原因,我就必须弄清楚要修改哪些文件才能解决这个问题。 (我自己是一个 CMake 类型的人,但我当然没有为这个项目选择构建系统。)我的操作系统是 Debian。

我也尝试过构建这个分支: https://github.com/kanzure/nanoengineer/branches/kirka-updates

如果您可以尝试在您的系统上构建它,我将不胜感激!谢谢!

最佳答案

经过大量工作,我能够在 Ubuntu 12.04 x86 和 Debian 7.4 x86_64 上构建它。我在下面写了一个指南。您可以尝试关注它以查看是否可以解决问题吗?

如果不是,请告诉我你卡在哪里了。

安装通用依赖项

sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev

安装 NumArray 1.5.2

wget http://goo.gl/6gL0q3 -O numarray-1.5.2.tgz
tar xfvz numarray-1.5.2.tgz
cd numarray-1.5.2
sudo python setup.py install

安装 Numeric 23.8

wget http://goo.gl/PxaHFW -O numeric-23.8.tgz
tar xfvz numeric-23.8.tgz
cd Numeric-23.8
sudo python setup.py install

安装 HDF5 1.6.5

wget ftp://ftp.hdfgroup.org/HDF5/releases/hdf5-1.6/hdf5-1.6.5.tar.gz
tar xfvz hdf5-1.6.5.tar.gz
cd hdf5-1.6.5
./configure --prefix=/usr/local
sudo make 
sudo make install

安装 Nanoengineer

git clone https://github.com/kanzure/nanoengineer.git
cd nanoengineer
./bootstrap
./configure
make
sudo make install

疑难解答

在 Debian Jessie 上,您将收到 cantpants 提到的错误消息。自动制作脚本中似乎存在问题。 x86_64-linux-gnu-gcc 被插入到 CFLAGS 中,gcc 会将其解释为源文件之一的名称。作为一种解决方法,让我们创建一个具有该名称的空文件。空,这样它就不会改变程序和那个名字,以便编译器选择它。从克隆的 nanoengineer 目录中,运行此命令以使 gcc 快乐(这是一个 hack,是的,但它确实有效)...

touch sim/src/x86_64-linux-gnu-gcc

如果您在尝试编译 HDF5 时收到如下错误消息:“错误:调用带有属性错误的声明的 '__open_missing_mode':在第二个参数中使用 O_CREAT 打开需要 3 个参数”,然后修改文件 perform/zip_perf .c,第 548 行如下所示,然后重新运行 make...

output = open(filename, O_RDWR | O_CREAT, S_IRUSR|S_IWUSR);

如果您在构建 Nanoengineer 时收到关于 Numeric/arrayobject.h 的错误消息,请尝试运行

export CPPFLAGS=-I/usr/local/include/python2.7
./configure
make
sudo make install

如果您收到类似于“TRACE_PREFIX undeclared”的错误消息,请将文件 sim/src/simhelp.c 的第 38 到 41 行修改为如下所示并重新运行 make:

#ifdef DISTUTILS
static char tracePrefix[] = "";
#else
static char tracePrefix[] = "";

如果您在尝试启动 NanoEngineer-1 时收到错误消息,其中提到类似于“无法导入名称 GL_ARRAY_BUFFER_ARB”的内容,请修改以下文件中的行

/usr/local/bin/NanoEngineer1_0.9.2.app/program/graphics/drawing/setup_draw.py
/usr/local/bin/NanoEngineer1_0.9.2.app/program/graphics/drawing/GLPrimitiveBuffer.py
/usr/local/bin/NanoEngineer1_0.9.2.app/program/prototype/test_drawing.py

看起来像这样:

from OpenGL.GL import GL_ARRAY_BUFFER_ARB
from OpenGL.GL import GL_ELEMENT_ARRAY_BUFFER_ARB

看起来像这样:

from OpenGL.GL.ARB.vertex_buffer_object import GL_ARRAY_BUFFER_AR
from OpenGL.GL.ARB.vertex_buffer_object import GL_ELEMENT_ARRAY_BUFFER_ARB

我还发现了一个已删除的附加故障排除文本文件,但您可以找到它here

关于python - 调试错误 "gcc: error: x86_64-linux-gnu-gcc: No such file or directory",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22571848/

相关文章:

python - 在 Heroku 上找不到资源 'corpora/wordnet'

mysql - gem install mysql2 -v '0.3.18' 失败

c - 通过gcc命令行进行C编译时出现问题

c++ - 具有两个目标和两种语言的 Makefile

python - 应用模糊匹配并获取 ID 列以及每场比赛的分数矩阵

python - 文件组织程序

c++ - 在 Ubuntu 16.04 上编译 GCC 6.1

shell - 如何通过迭代列表在 Makefile 中生成目标?

makefile - 如何防止 'make clean' 构建计划删除的文件

Python re.findall 打印所有模式