是否可以在Cygwin上使用皮肤(libgc安装时缺少execinfo.h)?

时间:2016-04-19 13:51:48

标签: python cygwin shedskin libgc

我想在 cygwin 上尝试脱皮

安装脱皮 libgc 似乎没问题,但当我尝试make脱皮皮肤的Python脚本时,它会抱怨:

/usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:31:22: fatal error: execinfo.h: No such file or directory
compilation terminated.

(下面的完整列表)

我检查了list of installed files on Cygwin for libgc,但它不包含 execinfo.h

这是否意味着脱落的皮肤不能用于 Cygwin

$ Make
g++  -O2 -march=native -Wno-deprecated  -I. -I/usr/lib/python2.7/site-packages/shedskin/lib -g -fPIC -D__SS_BIND -I/usr/include/python2.7 -I/usr/include/python2.7 /home/Administrator/python/shedskin/shedskinfn.cpp /usr/lib/python2.7/site-packages/shedskin/lib/re.cpp /usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp -lgc -lpcre  -shared -Xlinker -export-dynamic -ldl  -lpython2.7 -o shedskinfn.so
/home/Administrator/python/shedskin/shedskinfn.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 #include "builtin.hpp"
 ^
In file included from /home/Administrator/python/shedskin/shedskinfn.cpp:1:0:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:31:22: fatal error: execinfo.h: No such file or directory
compilation terminated.
/usr/lib/python2.7/site-packages/shedskin/lib/re.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /* Copyright 2005-2011 Mark Dufour and contributors; License Expat (See LICENSE) */
 ^
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/re.hpp:9:0,
                 from /usr/lib/python2.7/site-packages/shedskin/lib/re.cpp:3:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:31:22: fatal error: execinfo.h: No such file or directory
compilation terminated.
/usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp:1:0: warning: -fPIC ignored for target (all code is position independent)
 /* Copyright 2005-2011 Mark Dufour and contributors; License Expat (See LICENSE) */
 ^
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp:3:0:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin.hpp:31:22: fatal error: execinfo.h: No such file or directory
compilation terminated.
Makefile:17: recipe for target 'shedskinfn.so' failed
Make: *** [shedskinfn.so] Error 1

编辑1:

将缺少的 execinfo.h (来自互联网的downloaded)添加到make的lib路径中没有用。

$ shedskin  -L `pwd`  shedskinfn.py && make
*** SHED SKIN Python-to-C++ Compiler 0.9.4 ***
Copyright 2005-2011 Mark Dufour; License GNU GPL version 3 (See LICENSE)

[analyzing types..]
********************************100%
[generating c++ code..]
[elapsed time: 2.43 seconds]
g++  -O2 -march=native -Wno-deprecated  -I. -I/usr/lib/python2.7/site-packages/shedskin/lib -I/home/Administrator/python/shedskin /home/Administrator/python/shedskin/shedskinfn.cpp /usr/lib/python2.7/site-packages/shedskin/lib/re.cpp /usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp -lgc -lpcre  -o shedskinfn
In file included from /usr/lib/python2.7/site-packages/shedskin/lib/builtin.cpp:147:0:
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp: In function '__shedskin__::str* __shedskin__::do_asprintf_str(const char*, __shedskin__::str*, __shedskin__::pyobj*, __shedskin__::pyobj*)':
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:93:104: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, ((int)(((int_ *)a1)->unit)), ((int)(((int_ *)a2)->unit)), s->unit.c_str());
                                                                                                        ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:95:75: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, ((int)(((int_ *)a1)->unit)), s->unit.c_str());
                                                                           ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:97:46: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, s->unit.c_str());
                                              ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp: In instantiation of '__shedskin__::str* __shedskin__::do_asprintf(const char*, T, __shedskin__::pyobj*, __shedskin__::pyobj*) [with T = int]':
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:129:91:   required from here
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:70:21: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, ((int)(((int_ *)a1)->unit)), ((int)(((int_ *)a2)->unit)), t);
                     ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:72:21: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, ((int)(((int_ *)a1)->unit)), t);
                     ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:74:21: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, t);
                     ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp: In instantiation of '__shedskin__::str* __shedskin__::do_asprintf(const char*, T, __shedskin__::pyobj*, __shedskin__::pyobj*) [with T = double]':
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:136:93:   required from here
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:70:21: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, ((int)(((int_ *)a1)->unit)), ((int)(((int_ *)a2)->unit)), t);
                     ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:72:21: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, ((int)(((int_ *)a1)->unit)), t);
                     ^
/usr/lib/python2.7/site-packages/shedskin/lib/builtin/format.cpp:74:21: error: 'asprintf' was not declared in this scope
         x = asprintf(&d, fmt, t);
                     ^
Makefile:17: recipe for target 'shedskinfn' failed
make: *** [shedskinfn] Error 1

1 个答案:

答案 0 :(得分:1)

好吧,我并不知道有人试图在Cygwin上使用棚子 之前,主要 - 我认为 - 因为有一些(有限) 在某些时候支持本机Windows。

但是,你所遇到的问题还有一些已知的局限性 Cygwin本身,你可以通过使用一个缓解 兼容层,例如Gnulib

这可能会解决asprintf问题as well,尽管它可能只是一个问题

在某处#include丢失了stdio.h

无论如何,我无法保证完全支持Cygwin,因为我没有使用 Windows本身,但随时发送电子邮件 shedskin-discuss@googlegroups.com - 有人可能想拥有 深入了解它。如果你想提供一些修复或 文档,非常欢迎您的帮助on GitHub