簡體   English   中英

在OS X Snow Leopard上安裝PyCairo或Py2Cairo

[英]Installing PyCairo or Py2Cairo on OS X Snow Leopard

嘗試在OS X Snow Leopard上設置PyCairo。 這個站點上有很多問題,但是我遇到了編譯錯誤,這是我之前從未見過的。

這是我的環境變量...

PKG_CONFIG_PATH=/usr/local/Cellar/cairo/1.10.2/lib/pkgconfig/
PYTHON=PYTHON3

這是我的WAF配置:

TeaMac:py2cairo itadmin$ ./waf configure
  ./options()
Setting top to                           : /Users/itadmin/Sites/py2cairo
Setting out to                           : /Users/itadmin/Sites/py2cairo/build_directory
  ./configure()
Checking for 'gcc' (c compiler)          : ok
Checking for program python              : PYTHON3
python executable 'PYTHON3' different from sys.executable '/usr/bin/python'
Checking for python version              : (3, 2, 1, 'final', 0)
Checking for library python3.2           : not found
Checking for library python3.2           : yes
Checking for program python3.2-config    : /usr/local/bin/python3.2-config
Checking for header Python.h             : yes
Checking for program pkg-config          : /usr/local/bin/pkg-config
Checking for 'cairo' >= 1.10.0           : yes
Configuration:
PREFIX                                   : /usr/local
LIBDIR                                   : /usr/local/lib
'configure' finished successfully (0.580s)

這是$ ./waf build步驟的$ ./waf build

[random section of file where GCC errors start coming up...]
../src/surface.c: In function 'xlib_surface_get_depth':
../src/surface.c:1418: warning: return makes pointer from integer without a cast
../src/surface.c: In function 'xlib_surface_get_height':
../src/surface.c:1423: warning: return makes pointer from integer without a cast
../src/surface.c: In function 'xlib_surface_get_width':
../src/surface.c:1428: warning: return makes pointer from integer without a cast
../src/surface.c: At top level:
../src/surface.c:1441: warning: initialization makes integer from pointer without a cast
../src/surface.c:1459: warning: initialization makes pointer from integer without a cast
../src/surface.c:1467: warning: initialization from incompatible pointer type
../src/surface.c:1470: warning: initialization from incompatible pointer type
../src/surface.c:1477: warning: initialization from incompatible pointer type
lipo: can't figure out the architecture type of: /var/tmp//ccuzD4lS.out
lipo: can't figure out the architecture type of: /var/tmp//ccCSYwzk.out
Waf: Leaving directory `/Users/itadmin/Sites/py2cairo/build_directory'
Build failed
 -> task failed (exit status 1):
        {task 4312417936: c cairomodule.c -> cairomodule.c.1.o}
['/usr/bin/gcc', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-arch', 'i386', '-arch', 'x86_64', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-arch', 'i386', '-arch', 'x86_64', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-arch', 'i386', '-arch', 'x86_64', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-fno-strict-aliasing', '-I/Users/itadmin/Sites/py2cairo/build_directory/src', '-I/Users/itadmin/Sites/py2cairo/src', '-I/usr/local/Cellar/cairo/1.10.2/include/cairo', '-I/usr/local/Cellar/pixman/0.22.0/include/pixman-1', '-I/usr/local/include/libpng15', '-I/usr/X11/include', '-I/usr/X11/include/freetype2', '-I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m', '-DNDEBUG', '../src/cairomodule.c', '-c', '-o', 'src/cairomodule.c.1.o']
 -> task failed (exit status 1):
        {task 4312418384: c pattern.c -> pattern.c.1.o}
['/usr/bin/gcc', '-fPIC', '-compatibility_version', '1', '-current_version', '1', '-arch', 'i386', '-arch', 'x86_64', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-arch', 'i386', '-arch', 'x86_64', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-arch', 'i386', '-arch', 'x86_64', '-isysroot', '/Developer/SDKs/MacOSX10.6.sdk', '-fno-strict-aliasing', '-I/Users/itadmin/Sites/py2cairo/build_directory/src', '-I/Users/itadmin/Sites/py2cairo/src', '-I/usr/local/Cellar/cairo/1.10.2/include/cairo', '-I/usr/local/Cellar/pixman/0.22.0/include/pixman-1',
[GCC errors galore for 500 lines...]

在以下位置找到了針對此問題的解決方案: https : //bugs.freedesktop.org/show_bug.cgi?id=37414

基本上,您可以通過修改“ build_directory / c4che / _cache.py”文件來解決此問題。 問題源於waf嘗試為多個不同的-arch選項構建。 快速修復-注釋掉包含“ -arch”的每一行,您的構建將成功。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM