I am trying to use PyInstaller 1.5.1 on AIX 6.1 and have gotten some of the 
way. However, some input 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: (I realise this means I will not have access to TCL/TK but 
for now that is fine.)

--------------
--- 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 
'libpython2.6.so.1.0'.

--------------
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$
--------------

I found a libpython2.6.a in my Python installation and tried (naïvely) to copy 
it to the local folder and rename it:

--------------
bash-3.00$ cp /opt/freeware/lib/libpython2.6.a .
bash-3.00$ cp libpython2.6.a libpython2.6.so.1.0
bash-3.00$ ./test
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.
bash-3.00$
--------------

It seems that the generated binary expects some sort of Python shared library 
whereas I only have a lib for static linking.

Now, I am a bit stuck.

Any help or pointers are highly appreciated.

Best regards,
Martin Gamwell Dawids

P.S. I know there is an open ticket requesting PyInstaller on AIX
http://www.pyinstaller.org/ticket/343

________________________________
Please consider the environment before printing.

</pre>

<div style="FONT-FAMILY: arial;color:#525759;font-size:9pt; 
margin-top:15px">This e-mail and any attachments are intended only for the 
named recipient(s) and may contain information that is legally privileged, 
confidential, or exempt from disclosure under applicable law.  This message may 
be logged for archival purposes, may be reviewed by parties at Deltek other 
than those named in the message header, and may not necessarily constitute an 
official representation of Deltek. If you have received this message in error, 
or are not the named recipient(s), you may not retain copy or use this e-mail 
or any attachment for any purpose or disclose all or any part of the contents 
to any other person. Any such dissemination, distribution or copying of this 
e-mail or its attachments is strictly prohibited. Please immediately notify the 
sender and permanently delete this e-mail and any attachment from your 
computer.</div>

-- 
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.

Reply via email to