I am trying to use PyInstaller 1.5.1 on AIX 6.1 and have gotten some
of the way. Some input however would be appreciated.
I am using Python 2.6.2 and GCC 4.2.0.
I start out trying to build the bootloader:
--------------
bash-3.00$ python ./waf configure build install
AIX-32bit detected
Checking for program xlc_r or xlc : gcc
<..snip..>
Checking for flags -Wl,--as-needed : yes
'configure' finished successfully (2.711s)
Waf: Entering directory `/data/maconomy/mgd/pyinstaller-1.5.1/source/
build'
[13/16] cc_link: build/debug/common/launch_1.o build/debug/linux/
main_1.o build/debug/linux/getpath_1.o -> build/debug/run_d
ld: 0706-012 The -- flag is not recognized.
ld: 0706-012 The -a flag is not recognized.
ld: 0706-012 The -- flag is not recognized.
ld: 0706-027 The -n flag is ignored.
collect2: ld returned 255 exit status
Waf: Leaving directory `/data/maconomy/mgd/pyinstaller-1.5.1/source/
build'
Build failed: -> task failed (err #1):
{task: cc_link launch_1.o,main_1.o,getpath_1.o -> run_d}
bash-3.00$
--------------
It seems the problem is that the linker does not recognise the option
'--as-needed'.
A small change to source/wscript fixes this:
--------------
--- pyinstaller-1.5.1/source/wscript 2011-09-05 20:17:46.000000000
+0200
+++ pyinstaller-1.5.1.mgd/source/wscript 2011-09-05
20:19:04.000000000 +0200
@@ -187,10 +187,11 @@
conf.env.append_value('CCFLAGS', '/EHa')
# link only with needed libraries
- # XXX: -Wl,--as-needed detected during configure but fails
during mac build
+ # XXX: -Wl,--as-needed detected during configure but fails
during mac and aix builds
if conf.check_cc(ccflags='-Wl,--as-needed',
msg='Checking for flags -Wl,--as-needed') \
- and not myplatform.startswith('darwin'):
+ and not myplatform.startswith('darwin') \
+ and not myplatform.startswith('aix'):
conf.env.append_value('LINKFLAGS', '-Wl,--as-needed')
--------------
Now, the bootloader builds.
However, when running he Configure.py script i run into problems
detecting TCL/TK:
--------------
bash-3.00$ pyinstaller-1.5.1/Configure.py
I: computing EXE_dependencies
I: Finding TCL/TK...
I: Analyzing /usr/bin/python
Traceback (most recent call last):
File "pyinstaller-1.5.1/Configure.py", line 350, in <module>
main(opts.configfile)
File "pyinstaller-1.5.1/Configure.py", line 319, in main
test_TCL_TK(config)
File "pyinstaller-1.5.1/Configure.py", line 110, in test_TCL_TK
mo = re.match(pattern, nm)
UnboundLocalError: local variable 'pattern' referenced before
assignment
bash-3.00$
--------------
It seems the pattern is uninitialised unless the platform is 'win',
'linux' or 'darwin'. Adding a few lines to avoid TCL/TK detection in
other situations fixes this problem:
--------------
--- pyinstaller-1.5.1/Configure.py 2011-07-15 14:46:16.000000000
+0200
+++ pyinstaller-1.5.1.mgd/Configure.py 2011-09-05 20:32:05.000000000
+0200
@@ -91,6 +91,7 @@
saveexcludes = bindepend.excludes
bindepend.excludes = {}
+ pattern = None
if target_platform.startswith("win"):
pattern = r'(?i)tcl(\d\d)\.dll'
elif target_platform.startswith("linux"):
@@ -107,7 +108,9 @@
binaries.extend(bindepend.Dependencies(binaries))
binaries.extend(bindepend.Dependencies([('', sys.executable,
'')]))
for nm, fnm, typ in binaries:
- mo = re.match(pattern, nm)
+ mo = None
+ if pattern:
+ mo = re.match(pattern, nm)
if not mo:
continue
if not target_platform.startswith("darwin"):
--------------
Now, configure runs cleanly.
So now I try to build an executable from a plain and simple "Hello
World" script, that looks like this.
--------------
#!/usr/bin/python
print "Hello PyInstaller!"
--------------
To build it, I run:
--------------
bash-3.00$ pyinstaller-1.5.1/Makespec.py test.py
wrote /data/maconomy/mgd/test.spec
now run Build.py to build the executable
bash-3.00$ pyinstaller-1.5.1/Build.py test.spec
<..snip..>
--------------
Trying to run the executable results in:
--------------
bash-3.00$ cd dist/test/
bash-3.00$ ./test
Error loading Python lib './libpython2.6.so.1.0': 0509-022
Cannot load module ..
0509-026 System error: A file or directory in the path name
does not exist.
--------------
According to 'ldd' my executable does not depend on something called
'libpython'
--------------
bash-3.00$ ldd test
test needs:
/opt/freeware/lib/libz.a(libz.so.1)
/usr/lib/libdl.a(shr.o)
/usr/lib/libc.a(shr.o)
/usr/lib/librtl.a(shr.o)
/usr/lib/libc.a(shr_64.o)
/unix
/usr/lib/libcrypt.a(shr.o)
/usr/lib/libcrypt.a(shr_64.o)
bash-3.00$
--------------
so I guess it is something the generated binary loads dynamically.
However, there is no 'libpython<anything>.so' on my AIX box, only
something called libpython2.6.a and I am not sure whether this is a
static library or a shared library. But simply copying it to my
PyInstaller generated folder and renaming it to libpython2.6.so.1.0
does not help.
--------------
Error loading Python lib './libpython2.6.so.1.0': 0509-022
Cannot load module ./libpython2.6.so.1.0.
0509-103 The module has an invalid magic number.
--------------
Now, I am a bit stuck.
Any help or pointers are highly appreciated.
Best regards,
Martin Gamwell Dawids
P.S. I am aware of the open ticket requesting PyInstaller on AIX
http://www.pyinstaller.org/ticket/343
--
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pyinstaller?hl=en.