Mac OS 10.6/Snow Leopard上的Python构建问题

问题描述:

我在Snow Leopard上遇到Python 2.6.4的构建问题。Mac OS 10.6/Snow Leopard上的Python构建问题

  • 的Mac OS X 10.6
  • Yonah的CPU,32位
  • GCC-4.2.1

更新我

通过去除所有解决来自CFLAGS的非标准包含和库(发生了在那里是一个uuid/uuid.h ......)。尽管如此,尽管下面描述的错误,它编译,与/usr/include/hfs/hfs_format.h:765成为一个热点。对于有问题的好奇或足智多谋,源文件:

$ cat /usr/include/hfs/hfs_format.h 
... 
748 #include <uuid/uuid.h> 
749 
750 /* JournalInfoBlock - Structure that describes where our journal lives */ 
751 
752 // the original size of the reserved field in the JournalInfoBlock was 
753 // 32*sizeof(u_int32_t). To keep the total size of the structure the 
754 // same we subtract the size of new fields (currently: ext_jnl_uuid and 
755 // machine_uuid). If you add additional fields, place them before the 
756 // reserved field and subtract their size in this macro. 
757 // 
758 #define JIB_RESERVED_SIZE ((32*sizeof(u_int32_t)) - sizeof(uuid_string_t) - 48) 
759 
760 struct JournalInfoBlock { 
761   u_int32_t  flags; 
762   u_int32_t  device_signature[8]; // signature used to locate device. 
763   u_int64_t  offset;  // byte offset to the journal on the device 
764   u_int64_t  size;   // size in bytes of the journal 
765   uuid_string_t ext_jnl_uuid; 
766   char   machine_serial_num[48]; 
767   char   reserved[JIB_RESERVED_SIZE]; 
768 } __attribute__((aligned(2), packed)); 
769 typedef struct JournalInfoBlock JournalInfoBlock; 
... 

我离开的问题开放的,因为构建产生太多的警告,但此错误仍然困扰我有点...

$ cat Makefile 
... 
126 MACOSX_DEPLOYMENT_TARGET=10.3 # => 10.6 
... 
更新II

为了摆脱关于部署目标的警告,我在编译之前编辑的


原始的问题

当试图从源代码构建Python 2.6.4,我碰到一个错误:

似乎在Python/mactoolboxglue.c根。提示欢迎!


我也得到了很多这些类型的警告:

/usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for \ 
Intel with Mac OS X Deployment Target < 10.4 is invalid. 
gcc -c -arch ppc -arch i386 -isysroot/-fno-strict-aliasing -DNDEBUG -g \ 
-fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include \ 
-DPy_BUILD_CORE -o Objects/structseq.o Objects/structseq.c 
In file included from /usr/include/architecture/i386/math.h:626, 
      from /usr/include/math.h:28, 
      from Include/pyport.h:235, 
      from Include/Python.h:58, 
      from Objects/structseq.c:4: 
+1

'/usr/include/AvailabilityMacros.h:108:14:警告:#warning后楼为\ 英特尔与Mac OS X部署目标 2010-02-06 01:14:18

+0

而不是编辑生成文件中,做'出口MACOSX_DEPLOYMENT_TARGET = 10.6'之前运行'。/ configure'。 – 2010-02-06 04:05:49

尝试增加--universal-archs=32-bitconfigure参数。

编辑:您可能还需要设置环境变量MACOSX_DEPLOYMENT_TARGET=10.6并明确使用10.6 SDK:

export MACOSX_DEPLOYMENT_TARGET=10.6 
./configure --universal-archs=32-bit --enable-universalsdk=/Developer/SDKs/MacOSX10.6.sdk ... 

还有与10.6建立一些Python配置的问题。如果您重新使用构建目录,请确保清除之前运行的所有缓存文件可能已遗留下来。

顺便说一句,如果你只是需要一个32位版本,你可能使用2.6.4 OS X安装程序从python.org

+0

配置:错误:无法识别的选项:--dep目标= 10.6 //但是我发现MACOSX_DEPLOYMENT_TARGET = 10.3设置在生成文件;改变了它,现在输出看起来好多了;再次感谢! – chang 2010-02-06 02:19:55

+0

对不起,我张贴在急速。 --dep-target是安装程序构建脚本的参数,未配置。是的,在调用configure之前设置环境变量是正确的。解决答案。 – 2010-02-06 03:58:47

看来,你是不是遇到了此问题只有一个:

不知道这是否有相同的根源:

http://trac.macports.org/ticket/21282

向下滚动到最后的意见,这似乎表明了一个积极的结果。 (这里重复为方便起见):

... //从trac.macports.org报价:

“尝试重命名,移动或删除/opt/local/include/uuid/uuid.h” ... //最终报价

+0

我不使用macports,但我会通读该线程(再次;),谢谢... – chang 2010-02-06 00:31:58