如何在aix7.1上安装pyinstaller

时间:2019-07-01 03:42:51

标签: pyinstaller zlib aix

我想在aix7.1上安装pyinstaller,但失败。

我已经安装了zlib-devel。

这是安装pyinstaller时的错误消息:

-bash-4.2# python ./waf distclean all   

'distclean' finished successfully (0.203s)
'all' finished successfully (0.000s)
'distclean' finished successfully (0.000s)
Setting top to                           : /u02/py/pyinstaller-develop/bootloader 
Setting out to                           : /u02/py/pyinstaller-develop/bootloader/build 
Python Version                           : 2.7.10 (default, Jun 21 2016, 10:30:16) [C] 
Checking for 'xlc' (C compiler)          : not found 
Checking for 'gcc' (C compiler)          : /usr/bin/gcc 
Checking size of pointer                 : 4 
Platform                                 : AIX-32bit detected based on compiler 
Checking for flags -maix32               : yes 
Checking for program '/usr/bin/strip'    : /usr/bin/strip 
Checking for program 'strip'             : /usr/bin/strip 
Checking for library dl                  : yes 
Checking for library m                   : yes 
Checking for library z                   : yes 
Checking for function unsetenv           : yes 
Checking for function mkdtemp            : yes 
'configure' finished successfully (2.248s)
'make_all' finished successfully (0.018s)
Waf: Entering directory `/u02/py/pyinstaller-develop/bootloader/build/debug'
[ 1/13] Compiling src/main.c
[ 2/13] Compiling src/pyi_archive.c
[ 3/13] Compiling src/pyi_global.c
[ 4/13] Compiling src/pyi_launch.c
[ 5/13] Compiling src/pyi_main.c
[ 6/13] Compiling src/pyi_path.c
[ 7/13] Compiling src/pyi_python.c
[ 8/13] Compiling src/pyi_python27_compat.c
[ 9/13] Compiling src/pyi_pythonlib.c
[10/13] Compiling src/pyi_utils.c
[11/13] Compiling src/pyi_win32_utils.c
[12/13] Linking build/debug/run_d
collect2: library libZ not found

Waf: Leaving directory `/u02/py/pyinstaller-develop/bootloader/build/debug'
Build failed
 -> task in 'run_d' failed with exit status 1 (run with -v to display more information)
-bash-4.2# 
-bash-4.2# 
-bash-4.2# 
-bash-4.2# find / -name libz.so
/opt/freeware/lib/libz.so
/opt/freeware/lib64/libz.so
/usr/lib/libz.so
/usr/lib64/libz.so
-bash-4.2# 

1 个答案:

答案 0 :(得分:0)

首先,编辑bootloader/wscript文件

--- wscript.bak 2018-09-09 20:12:10.000000000 +0200
+++ wscript     2019-07-02 10:57:30.000000000 +0200
@@ -770,8 +770,9 @@
          staticlibs = []
          if ctx.env.DEST_OS == 'aix':
              # link statically with zlib
-             libs.remove('Z')
-             staticlibs.append('Z')
+             # libs.remove('Z')
+             # staticlibs.append('Z')
+             pass

          if ctx.options.boehmgc:
              libs.append('GC')

然后创建一个名为/opt/freeware/bin/strip的脚本,其内容如下:

#!/bin/sh
/usr/bin/strip "$@"
exit 0

不要忘记chmod +x /opt/freeware/bin/strip

函数mkdtemp也存在问题,要解决此问题,请执行以下操作:

export CPPFLAGS='-D_XOPEN_SOURCE=700'
python ./waf -v all

注意:您应该知道AIX本身是非常有问题的,但是将其与帮助软件(例如waf)结合使用会使情况更糟。其他阅读:http://lzsiga.users.sourceforge.net/aix-linking.html#Q0026