我一直在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编译程序的问题。此外,我认为,问题可能是因为版本。我正在使用windos 10,这是64位。
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。
任何类型的帮助都会很棒。
感谢。
答案 0 :(得分:0)
stddef.h是gcc编译器的一部分
$ cygcheck -l gcc-core |grep stddef.h
/usr/lib/gcc/x86_64-pc-cygwin/5.4.0/include/stddef.h
答案 1 :(得分:0)
仅作记录,一种替代方法是使用setupx86_64.exe
安装python并在.pyenv/versions/<yourversionname>/bin
中手动链接二进制文件:请参阅问题Pyenv fails to install python on Cygwin: ModuleNotFoundError: No module named '_ctypes'