【发布时间】:2017-11-25 11:20:36
【问题描述】:
我一直在尝试在 cygwin 上编译/制作 'gcc 4.8.3'**。我安装的cygwin版本是**cygwin x86_64。我也预装了gcc,版本是5.4.0。
为什么我想要这个特定版本的 gcc 是因为,我需要安装 Python3.5.2,这样我才能反过来在 cygwin 上安装 tensorflow。我尝试使用 Pyenv 安装 Python3.5.2,但我的猜测是 Python 3.5.2 的库是用 gcc 4.8.x 版本预编译的,因为我遇到了 Pyenv 无法运行 C 编译程序的问题。另外,我认为,问题可能是因为版本。我使用的是 64 位的 windows 10。
gcc 的配置成功发生,但我在运行 make 文件时遇到了问题。这是错误信息:
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
make[2]: *** [Makefile:4763: configure-stage1-gmp] Error 1
make[2]: Leaving directory
'/cygdrive/c/softwares/cygwin64/lib/gcc_4_8_3'
make[1]: *** [Makefile:20946: stage1-bubble] Error 2
make[1]: Leaving directory
'/cygdrive/c/softwares/cygwin64/lib/gcc_4_8_3'
make: *** [Makefile:890: all] Error 2
我检查了 config.log,这是我发现的:
/usr/include/sys/cdefs.h:45:20: fatal error: stddef.h: No such
file or directory
#include <stddef.h>
^
compilation terminated.
configure:12120 $? = 1
configure: failed program was:
| /* confdefs.h. */
| #define PACKAGE_NAME "GNU MP"
| #define PACKAGE_TARNAME "gmp"
| #define PACKAGE_VERSION "4.3.2"
| #define PACKAGE_STRING "GNU MP 4.3.2"
| #define PACKAGE_BUGREPORT "gmp-bugs@gmplib.org"
| #define PACKAGE "gmp"
| #define VERSION "4.3.2"
| #define WANT_FFT 1
| #define HAVE_HOST_CPU_none 1
| #define PROTOTYPES 1
| #define __PROTOTYPES 1
| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_STDLIB_H 1
| #define HAVE_STRING_H 1
| #define HAVE_MEMORY_H 1
| #define HAVE_STRINGS_H 1
| #define HAVE_INTTYPES_H 1
| #define HAVE_STDINT_H 1
| #define HAVE_UNISTD_H 1
| #define HAVE_STRING_H 1
| #define HAVE_DLFCN_H 1
| /* end confdefs.h. */
| #ifdef __STDC__
| # include <limits.h>
| #else
| # include <assert.h>
| #endif
| Syntax error
configure:12114: g++ -E -DNO_ASM conftest.cpp
In file included from /usr/include/features.h:12:0,
from /usr/include/limits.h:11,
from conftest.cpp:27:
我还在 windows 环境路径中包含了 /lib/cpp dll 文件。尽管如此,它并没有改变任何东西。
我认为这个问题是由于缺少文件造成的。我可以在哪个目录中找到这个文件?
或者是否有任何其他机制来编译 gcc。我不想使用预装的 gcc 版本,因为我打算在 cygwin 上安装 Python 3.5.2 和 tensorflow。
任何类型的帮助都会很棒。
谢谢。
【问题讨论】:
-
$ cygcheck -l gcc-core |grep stddef.h /usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stddef.h