[Pythonmac-SIG] How do you tell the system which version to use ?
I find that I have at least 3 versions of Python on my system. 2 under /System/Library/Frameworks/Python.framework/Versions (2.3 and 2.5) and one under /Library/Frameworks/Python.framework/Versions (2.7) Going from Terminal, I get 2.7 Running a script in Scribus, I get 2.3 I found info that says the /System/Library/Frameworks are part of the OS installation and that it should not be messed with. OK. But how do I get everything to use 2.7 ? Thanks. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
[Pythonmac-SIG] A script for Scribus that won't run on my Mac
I am a python n00b, and I cannot figure this out. I got a script from forum that is supposed to build a set of calendar pages in Scribus. It won't run on my Mac (Intel iMac, MacOS 10.5.8, Python 2.7, Scribus 1.3.8) Here is an extract containing the offending code: - def drawRulesGrid(pageSide): Draws rules on the page lineSpace = (LINE_LAST_Y - LINE_FIRST_Y) / 30 if pageSide == 'right': StartLines = (R_LINE_X + (C * LINE_X_OFFSET) for C in range(COLUMNS)) BigLines = [0, 10, 20, 25, 30] elif pageSide == 'left': StartLines = (L_LINE_X + (C * LINE_X_OFFSET) for C in range(COLUMNS)) BigLines = [0, 10, 20, 30] for j in StartLines: StartLineX, StartLineY = j, LINE_FIRST_Y for i in range(31): Line = createLine(StartLineX, StartLineY, StartLineX+LINE_LENGHT, StartLineY) if i in BigLines: setLineWidth(BIG_LINE_WIDTH, Line) else: setLineWidth(THIN_LINE_WIDTH, Line) StartLineY += lineSpace - And the error: - Traceback (most recent call last): File , line 8, in ? File SamAgenda.py, line 221 StartLines = (R_LINE_X + (C * LINE_X_OFFSET) for C in range(COLUMNS)) ^ SyntaxError: invalid syntax - In case the spacing gets messed up, the caret is pointing at the r in for The author claims this runs on python 2.6.5, Scribus 1.3.3.13svn, Ubuntu 10.04. Any clues for this clueless one ? Thanks. ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG
Re: [Pythonmac-SIG] undefined symbols when making python wrapped c libs for itk
Hi, Actually i see the same error message using python2.5 when building ITK python wrapping. I was wondering what i am doing wrong that ld is not seeing pytohn properly to find those symbols? Any one know what is going wrong to give error message like /usr/bin/ld: Undefined symbols: _main _PyArg_ParseTuple _PyInt_FromLong _PyString_FromString _PyTuple_New _PyTuple_SetItem _Py_InitModule4 collect2: ld returned 1 exit status which lib or headers or something is ld not seeing? cheers Dan On 14 Dec 2006, at 13:00, [EMAIL PROTECTED] wrote: From: Bob Ippolito [EMAIL PROTECTED] Date: 14 December 2006 12:28:29 GMT+02:00 To: Gen Kazama [EMAIL PROTECTED] Cc: pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] CPython on Mac OSX On 12/13/06, Gen Kazama [EMAIL PROTECTED] wrote: Hi I'm running python 2.3 on 10.4. i made an application using a C backend and a python frontend. This is a school project and although it works perfectly on the school computers, i have trouble compiling the C code correctly on the mac to make it into a python module (maybe this is because the school computers used python 2.4-ie, an updated version of Python.h). Anyway here is how I compile it at school: gcc -I /usr/include/python2.4 -c mandel.c gcc -shared mandel.o -o mandel.so which works with no flaws. then , I try compiling it on my mac: gcc -I /usr/include/python2.3 -c mandel.c gcc mandel.o -o mandel.so (note: -shared wasn't found on my mac for some reason). I get the following errors: /usr/bin/ld: Undefined symbols: _main _PyArg_ParseTuple _PyInt_FromLong _PyString_FromString _PyTuple_New _PyTuple_SetItem _Py_InitModule4 collect2: ld returned 1 exit status If anyone could tell me how to compile this C code into a python module on my mac, i would greatly appreciate it. thanks! The best way is to use distutils (or setuptools). Create a setup.py that compiles it for you. This works on every platform, even windows. -bob Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 40, Issue 25
On Aug 29, 2006, at 5:28 AM, [EMAIL PROTECTED] wrote: patches like this: # cd Python-2.5c1 # patch -p0 ~/Mac-PythonLauncher-Makefile.in.diff # patch ~/configure.diff I invoked configure like this: # CC=icc CXX=icpc OPT=-xT -O3 -fstack-security-check -fpic - parallel ICC_LIBS=-L/opt/intel/cc/9.1.029/lib -lirc -limf ./ configure --enable-framework This tells the compiler to optimize for the Woodcrest or Merom processor; to optimize for Core Solo/Duo, use -xP. I can reliably trip a compiler error if I use -axT, which tries to accommodate both types of processor. Boyd you might already know the newest version of the intel compilers is version 30... so you might want to try that... so what about a build that is compatible with both core duo/solo and the Woodcrest/Merom ? Did you spot what compiler flags to use for that? Should it in fact be -axT, or is that a bogus flag? We are gonna have to so that for building software to distribute... Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app and install_name changing to @executable_path/../Frameworks/libWhatever.dylib
what should i rewrite it to be? using install_name_tool -id ? what would make pyapp automatically copy the library and rewrite the install_name? If I understand things correctly the install_name of libguide.dylib is currently just libguide.dylib, whereas it should be /path/to/ libguide.dylib. The install_name is copied into any objects that link to the library (which is what you get to see when you use otool -vL). If the install_name of a linked-to library points to a library that py2app can find at that location that library will be copied into the application bundle and it's install_name gets rewritten to something relative to the executable in the application bundle. Now that I think a bit more about this issue, it might be possible to solve this using a py2app recipe. I don't really have time to work on this, even though I'd love to play with the Intel compiler to see if that would speed up Python. I'm still trying to get py2app to work for our BioImageXD software, It appears to be the case that py2app is NOT re writing the install_name of included non system .dylibs (like the intel libguide and the vtk libs I am using) as you suggest it should be doing, so that they have @executable_path/../Frameworks/libWhatever.dylib instead of just libWhatever.dylib as their install_name, as can be seen by otool -L So now I wonder if this should be happening as the py2app code stands as you imply above, but isnt happeneing due to a problem, or if it is not happening since this is not what py2app is trying to do. Has it been fixed in a recent development version, or is it really broken in my case, or does that functionality need to be added? cheers Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 21 Jun 2006, at 09:29, Ronald Oussoren wrote: On 20-jun-2006, at 23:32, Dan White wrote: what should i rewrite it to be? using install_name_tool -id ? what would make pyapp automatically copy the library and rewrite the install_name? If I understand things correctly the install_name of libguide.dylib is currently just libguide.dylib, whereas it should be /path/to/ libguide.dylib. The install_name is copied into any objects that link to the library (which is what you get to see when you use otool -vL). If the install_name of a linked-to library points to a library that py2app can find at that location that library will be copied into the application bundle and it's install_name gets rewritten to something relative to the executable in the application bundle. Now that I think a bit more about this issue, it might be possible to solve this using a py2app recipe. I don't really have time to work on this, even though I'd love to play with the Intel compiler to see if that would speed up Python. OK, Now I unbderstand, thanks for clearinf htat up. So intel made a problem by not setting the install_name of libguide.dylib to the path where it is installed. I will hack it and see if py2app picks it up. I will also investigate the licence re redistribution of that library. At least with VTK c++ code compiled with intel compilers on a core duo intel MacBook Pro with flags -xP -parallel for full optimization lots of loops get vectorised, and it seems at least as fast if not faster than gcc code. I havent done any rigorous testing measuring performance times, but it seems fairly snappy so far. Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 20 Jun 2006, at 20:40, Ronald Oussoren wrote: On 20-jun-2006, at 19:08, Dan White wrote: On 15 Jun 2006, at 10:55, Ronald Oussoren wrote: On 15-jun-2006, at 9:28, Dan White wrote: So yes there are some DYLD_LIBRARY_PATH suff set. Maybe therein lies the problem...? Python probably doesn't know about that stuff? That might be the problem, and seems to indicate that Intel does something completely wrong. Any use of the DYLD_* variables in a production environment is an indication that something fishy is going on. Unlike linux executables on osx contain the full path to libraries they link to. If DYLD_LIBRARY_PATH is needed the compiler doesn't include the full path to some libraries that are needed. It should be possible to teach py2app/macholib about this feature of the intel compiler, but you'll probably have to do that yourself. I tried fixing the .dylibs in my application bindle (made by py2app) that were unable to find libguide.dylib using for instance install_name_tool -change libguide.dylib @executable_path/../ Frameworks/libguide.dylib /Users/dan/Desktop/bioimagexdsvn/trunk/ dist/BioImageXD.app/Contents/MacOS/../Frameworks/ libvtkGraphicsPythonD.5.1.dylib Hmm, this could turn out to be interesting :-). Could you check the license of the intel compiler, are you allowed to do this? BTW. A better fix would be to rewrite the install_name of the libguide.dylib in /opt/intel/cc/.../, then py2app would automaticly copy the library and rewrite the install_name. here is the license from intel pages for the OS X intel compilers http://www.intel.com/cd/software/products/asmo-na/eng/compilers/cmac/ 267042.htm doesn't look good. Even the non profit license does not seem to allow redistribution of their materials. Which seems rather odd, since the libguide.dyli is no use to anyone who isnt using their compiers or binaries generated by them, so they only stand to gain by their redistribution with fast intel compiled binaries... big business. i will ask for clarification regarding open source free software projects. Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 21 Jun 2006, at 11:35, Dan White wrote: On 20 Jun 2006, at 20:40, Ronald Oussoren wrote: On 20-jun-2006, at 19:08, Dan White wrote: On 15 Jun 2006, at 10:55, Ronald Oussoren wrote: On 15-jun-2006, at 9:28, Dan White wrote: So yes there are some DYLD_LIBRARY_PATH suff set. Maybe therein lies the problem...? Python probably doesn't know about that stuff? That might be the problem, and seems to indicate that Intel does something completely wrong. Any use of the DYLD_* variables in a production environment is an indication that something fishy is going on. Unlike linux executables on osx contain the full path to libraries they link to. If DYLD_LIBRARY_PATH is needed the compiler doesn't include the full path to some libraries that are needed. It should be possible to teach py2app/macholib about this feature of the intel compiler, but you'll probably have to do that yourself. I tried fixing the .dylibs in my application bindle (made by py2app) that were unable to find libguide.dylib using for instance install_name_tool -change libguide.dylib @executable_path/../ Frameworks/libguide.dylib /Users/dan/Desktop/bioimagexdsvn/trunk/ dist/BioImageXD.app/Contents/MacOS/../Frameworks/ libvtkGraphicsPythonD.5.1.dylib Hmm, this could turn out to be interesting :-). Could you check the license of the intel compiler, are you allowed to do this? BTW. A better fix would be to rewrite the install_name of the libguide.dylib in /opt/intel/cc/.../, then py2app would automaticly copy the library and rewrite the install_name. here is the license from intel pages for the OS X intel compilers http://www.intel.com/cd/software/products/asmo-na/eng/compilers/ cmac/267042.htm doesn't look good. Even the non profit license does not seem to allow redistribution of their materials. Which seems rather odd, since the libguide.dyli is no use to anyone who isnt using their compiers or binaries generated by them, so they only stand to gain by their redistribution with fast intel compiled binaries... big business. i will ask for clarification regarding open source free software projects. Dan Actually on further inspection, there is a file with a list of redistrubutable files: List of Re-distributable files for the Intel(R) C++ Compiler for Mac OS: libguide.a libguide.dylib libguide_stats.a libguide_stats.dylib libimf.a libimf.dylib libirc.a libirc.dylib libirc_s.a libompstub.a libsvml.a libsvml.dylib libipgo.a so maybe that means it is fine to bundle libguide.dylib in a .app Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 21 Jun 2006, at 09:29, Ronald Oussoren wrote: On 20-jun-2006, at 23:32, Dan White wrote: what should i rewrite it to be? using install_name_tool -id ? what would make pyapp automatically copy the library and rewrite the install_name? If I understand things correctly the install_name of libguide.dylib is currently just libguide.dylib, whereas it should be /path/to/ libguide.dylib. The install_name is copied into any objects that link to the library (which is what you get to see when you use otool -vL). If the install_name of a linked-to library points to a library that py2app can find at that location that library will be copied into the application bundle and it's install_name gets rewritten to something relative to the executable in the application bundle. Now that I think a bit more about this issue, it might be possible to solve this using a py2app recipe. I don't really have time to work on this, even though I'd love to play with the Intel compiler to see if that would speed up Python. Looks like py2app did manage to pick up the libguilde.dylib and put it in Frameworks, but it did not rewrite the install name: from the console after double clicking my .app 2006-06-21 12:22:39.222 BioImageXD[26632] BioImageXD Error 2006-06-21 12:22:39.222 BioImageXD[26632] An unexpected error has occurred during execution of the main script ImportError: Failure linking new module: /Users/dan/Desktop/ bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/Resources/Python/lib- dynload/vtk/libvtkIOPython.so: Library not loaded: libguide.dylib Referenced from: /Users/dan/Desktop/bioimagexdsvn/trunk/dist/ BioImageXD.app/Contents/MacOS/../Frameworks/libvtkIOPythonD.5.1.dylib Reason: image not found and otool -L tells me: white:~/Desktop/bioimagexdsvn/trunk dan$ otool -L /Users/dan/Desktop/ bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/Frameworks/ libguide.dylib /Users/dan/Desktop/bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/ Frameworks/libguide.dylib: /opt/intel/cc/9.1.027/lib/libguide.dylib (compatibility version 4.0.0, current version 4.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.3) should be @executable_path/../Frameworks/libguide.dylib right? otool -L for the dylib trying to see libguide: white:~/Desktop/bioimagexdsvn/trunk dan$ otool -L /Users/dan/Desktop/ bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/Frameworks/ libvtkIOPythonD.5.1.dylib /Users/dan/Desktop/bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/ Frameworks/libvtkIOPythonD.5.1.dylib: libvtkIOPythonD.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkIO.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkFilteringPythonD.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/Python.framework/Versions/2.3/ Python (compatibility version 2.3.0, current version 2.3.5) libvtkDICOMParser.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkpng.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtktiff.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkzlib.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkjpeg.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkexpat.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkMPEG2Encode.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkFiltering.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkCommonPythonD.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtkCommon.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) libvtksys.5.1.dylib (compatibility version 0.0.0, current version 0.0.0) /System/Library/Frameworks/AppKit.framework/Versions/C/ AppKit (compatibility version 45.0.0, current version 824.39.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.5) libguide.dylib (compatibility version 4.0.0, current version 4.0.0) /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 1.0.0) white:~/Desktop/bioimagexdsvn/trunk dan$ should all these vtk*.dylib also have @executable_path/../Frameworks/libvtk* for their install names once py2app has put them in my .app bundle, since they are not system libraries, but are ones I have compiled with the intel compiler for use in my .app? Also should libguide.dylib also be listed here as @executable_path/../ Frameworks/libguide.dylib not just libguide.dylib? Dan Dr. Daniel
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 15 Jun 2006, at 10:55, Ronald Oussoren wrote: On 15-jun-2006, at 9:28, Dan White wrote: So yes there are some DYLD_LIBRARY_PATH suff set. Maybe therein lies the problem...? Python probably doesn't know about that stuff? That might be the problem, and seems to indicate that Intel does something completely wrong. Any use of the DYLD_* variables in a production environment is an indication that something fishy is going on. Unlike linux executables on osx contain the full path to libraries they link to. If DYLD_LIBRARY_PATH is needed the compiler doesn't include the full path to some libraries that are needed. It should be possible to teach py2app/macholib about this feature of the intel compiler, but you'll probably have to do that yourself. I tried fixing the .dylibs in my application bindle (made by py2app) that were unable to find libguide.dylib using for instance install_name_tool -change libguide.dylib @executable_path/../ Frameworks/libguide.dylib /Users/dan/Desktop/bioimagexdsvn/trunk/dist/ BioImageXD.app/Contents/MacOS/../Frameworks/libvtkGraphicsPythonD. 5.1.dylib and it worked ok! (My .app still fails to launch form some pythonic reason in our code though...) so is it a case of teaching macholib this trick for the case of DATA_FILES.append( ('../Frameworks', [ '/opt/intel/cc/9.1.024/lib/libguide.dylib', ])) or am I barking up the wrong tree. I'm not sure macholib doesnt already do this, as it does when you tell py2app to append other dylibs into ../Frameworks? Or doesnt it do that for dylibs actually? DATA_FILES.append literally just to put data files there, and macholib knows nothing about it. cheers Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 20 Jun 2006, at 20:40, Ronald Oussoren wrote: On 20-jun-2006, at 19:08, Dan White wrote: On 15 Jun 2006, at 10:55, Ronald Oussoren wrote: On 15-jun-2006, at 9:28, Dan White wrote: So yes there are some DYLD_LIBRARY_PATH suff set. Maybe therein lies the problem...? Python probably doesn't know about that stuff? That might be the problem, and seems to indicate that Intel does something completely wrong. Any use of the DYLD_* variables in a production environment is an indication that something fishy is going on. Unlike linux executables on osx contain the full path to libraries they link to. If DYLD_LIBRARY_PATH is needed the compiler doesn't include the full path to some libraries that are needed. It should be possible to teach py2app/macholib about this feature of the intel compiler, but you'll probably have to do that yourself. I tried fixing the .dylibs in my application bindle (made by py2app) that were unable to find libguide.dylib using for instance install_name_tool -change libguide.dylib @executable_path/../ Frameworks/libguide.dylib /Users/dan/Desktop/bioimagexdsvn/trunk/ dist/BioImageXD.app/Contents/MacOS/../Frameworks/ libvtkGraphicsPythonD.5.1.dylib Hmm, this could turn out to be interesting :-). Could you check the license of the intel compiler, are you allowed to do this? BTW. A better fix would be to rewrite the install_name of the libguide.dylib in /opt/intel/cc/.../, then py2app would automaticly copy the library and rewrite the install_name. what should i rewrite it to be? using install_name_tool -id ? what would make pyapp automatically copy the library and rewrite the install_name? cheers Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 14 Jun 2006, at 18:26, Bob Ippolito wrote: On Jun 14, 2006, at 8:01 AM, Dan White wrote: Hi Python Mac folks, I am using intel compilers to make VTK dylibs, then py2app 0.2 maint svn version to make a .app bundle When I run the .app that i am making it complains about not being able to find one of the intel compiler .dylib s libguide.dylib which is found at /opt/intel/cc/9.1.024/lib/libguide.dylib how do I get py2app to include this dylib correctly so the vtk libs can see it as they do when I run my app from the command line? Could you please paste the actual error messages? Also, do you have any DYLD_* environment variables set? here you go Bob, from the error message python/BioImageXD.app pops up on failed launch: An unexpected error has occurred during execution of the main script ImportError: Failure linking new module: /Users/dan/Desktop/ bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/Resources/Python/lib- dynload/vtk/libvtkCommonPython.so: Library not loaded: libguide.dylib Referenced from: /Users/dan/Desktop/bioimagexdsvn/trunk/dist/ BioImageXD.app/Contents/MacOS/../Frameworks/libvtkCommonPythonD.dylib. 5.1 Reason: image not found See the Console for a detailed traceback. and from the console 2006-06-15 10:18:39.707 BioImageXD[294] BioImageXD Error 2006-06-15 10:18:39.707 BioImageXD[294] An unexpected error has occurred during execution of the main script ImportError: Failure linking new module: /Users/dan/Desktop/ bioimagexdsvn/trunk/dist/BioImageXD.app/Contents/Resources/Python/lib- dynload/vtk/libvtkCommonPython.so: Library not loaded: libguide.dylib Referenced from: /Users/dan/Desktop/bioimagexdsvn/trunk/dist/ BioImageXD.app/Contents/MacOS/../Frameworks/libvtkCommonPythonD.dylib. 5.1 Reason: image not found See the Console for a detailed traceback. 2006-06-15 10:18:39.836 BioImageXD[294] *** -[NSBundle load]: Error loading code /Users/dan/Library/InputManagers/Smart Crash Reports/ Smart Crash Reports.bundle/Contents/MacOS/Smart Crash Reports for bundle /Users/dan/Library/InputManagers/Smart Crash Reports/Smart Crash Reports.bundle, error code 2 (link edit error code 4, error number 0 ()) 2006-06-15 10:18:52.656 BioImageXD[294] CFLog (21): dyld returns 2 when trying to load /Users/dan/Library/Contextual Menu Items/ ToastIt.plugin/Contents/MacOS/ToastIt 2006-06-15 10:18:52.657 BioImageXD[294] CFLog (22): Cannot find function pointer pluginFactory for factory 053918F4-2869-11D7- A671-000A27E2DB90 in CFBundle/CFPlugIn 0x3b72f0 /Users/dan/Library/ Contextual Menu Items/ToastIt.plugin (bundle, not loaded) 2006-06-15 10:19:46.868 Console[299] *** -[NSBundle load]: Error loading code /Users/dan/Library/InputManagers/Smart Crash Reports/ Smart Crash Reports.bundle/Contents/MacOS/Smart Crash Reports for bundle /Users/dan/Library/InputManagers/Smart Crash Reports/Smart Crash Reports.bundle, error code 2 (link edit error code 0, error number 0 ()) This is a new computer, and I haven't set many env variables yet white:~ dan$ echo $DYLD_* Desktop Documents Downloads Incomplete Library Movies Music Network Trash Folder Pictures Public Shared Sites TheVolumeSettingsFolder mbox white:~ dan$ and my .bashrc has to be manually called, since its supposed to br named .profile right? anyway my .bashrc contains only source /opt/intel/cc/9.1.024/bin/iccvars.sh export PATH=$PATH:/usr/local/bin:/Library/Frameworks/Python.framework/ Versions/2.4/bin/ ahh haaa, but iccvars.sh contains this: #! /bin/sh if [ -z ${PATH} ] then PATH=/opt/intel/cc/9.1.024/bin; export PATH else PATH=/opt/intel/cc/9.1.024/bin:${PATH}; export PATH fi if [ -z ${LD_LIBRARY_PATH} ] then LD_LIBRARY_PATH=/opt/intel/cc/9.1.024/lib; export LD_LIBRARY_PATH else LD_LIBRARY_PATH=/opt/intel/cc/9.1.024/lib:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH fi # DYLD_LIBRARY_PATH is used on MAC OS if [ -z ${DYLD_LIBRARY_PATH} ] then DYLD_LIBRARY_PATH=/opt/intel/cc/9.1.024/lib; export DYLD_LIBRARY_PATH else DYLD_LIBRARY_PATH=/opt/intel/cc/9.1.024/lib:$ {DYLD_LIBRARY_PATH}; export DYLD_LIBRARY_PATH fi if [ -z ${MANPATH} ] then MANPATH=/opt/intel/cc/9.1.024/man:$(manpath); export MANPATH else MANPATH=/opt/intel/cc/9.1.024/man:${MANPATH}; export MANPATH fi if [ -z ${INTEL_LICENSE_FILE} ] then INTEL_LICENSE_FILE=/opt/intel/cc/9.1.024/licenses:/opt/intel/ licenses:${HOME}/intel/licenses:/Users/Shared/Library/Application Support/Intel/licenses; export INTEL_LICENSE_FILE else INTEL_LICENSE_FILE=${INTEL_LICENSE_FILE}:/opt/intel/cc/9.1.024/ licenses:/opt/intel/licenses:${HOME}/intel/licenses:/Users/Shared/ Library/Application Support/Intel/licenses; export INTEL_LICENSE_FILE fi So yes there are some DYLD_LIBRARY_PATH suff set. Maybe therein lies the problem...? Python probably doesn't know about that stuff? Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre
Re: [Pythonmac-SIG] with libraries compiled with intel compilers, intel libguide.dylib not included
On 15 Jun 2006, at 10:55, Ronald Oussoren wrote: On 15-jun-2006, at 9:28, Dan White wrote: So yes there are some DYLD_LIBRARY_PATH suff set. Maybe therein lies the problem...? Python probably doesn't know about that stuff? That might be the problem, and seems to indicate that Intel does something completely wrong. Any use of the DYLD_* variables in a production environment is an indication that something fishy is going on. Unlike linux executables on osx contain the full path to libraries they link to. If DYLD_LIBRARY_PATH is needed the compiler doesn't include the full path to some libraries that are needed. It should be possible to teach py2app/macholib about this feature of the intel compiler, but you'll probably have to do that yourself. Ronald Maybe since these are free testing compilers, bets version s essentially ... I should tell intel and they might even fix it! thanks for looking at it anyway Ronald cheers Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] OSX on intel, py2app 0.2 maint wxPython2.6.3.2rc3-universal10.4-py24.dmg .rsrc file missing
Hi Kevin and all, Please try the following build: http://kevino.theolliviers.com/wxpython/wxPython2.6-osx- unicode-2.6.3.2rc3-universal10.4-py2.4.dmg It does link against the wx libraries now, but I realized that PyOpenGL (even CVS) won't build for Universal Python, at least not out of the box, so I wasn't able to test it via the demo. If this does fix your problem, I'll upload the release to the wxPython site. Otherwise, I'd suggest trying the PPC build on the Intel Mac. In a vast majority of cases, things run just fine, albeit a bit slower. The PyOpenGL problems seem to be long-standing, and there are other extensions as well that really haven't made the transition to Universal Python yet. To be completely honest, I don't see Universal Python building a majority of Python C extensions for several more months. If you really need the extra speed, or your app is fairly simple, Universal Python is probably worth investing in, but otherwise I'd just wait for all these issues to be sorted out and let people use the PPC builds on Intel Mac. I have been testing your wxPython2.6-osx-unicode-2.6.3.2rc3- universal10.4-py2.4.dmg version of wxpython with universal python2.4 with our BioImageXD python and VTK driven software. Looking very good so far! Now I am trying to use py2app 0.2maint svn version to build the .app on intel core duo MacBook Pro. However, there is a command in our code to make py2app look for a rsrc file for wxPython. This file is not present in your 2.6.3.2rc3- universal10.4-py2.4.dmg DATA_FILES.append( ('../Frameworks', [ '/usr/local/lib/wxPython-unicode-2.5.5.1/lib/ libwx_macud-2.5.5.rsrc', ])) Do I still need this append ? cheers Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
[Pythonmac-SIG] py2app with libraries compiled with intel compilers, intel libguide.dylib not included
Hi Python Mac folks, I am using intel compilers to make VTK dylibs, then py2app 0.2 maint svn version to make a .app bundle When I run the .app that i am making it complains about not being able to find one of the intel compiler .dylib s libguide.dylib which is found at /opt/intel/cc/9.1.024/lib/libguide.dylib how do I get py2app to include this dylib correctly so the vtk libs can see it as they do when I run my app from the command line? Adding libguide.dylib to the .app/Contents/Frameworks/ dir does not solve the problem, does py2app need to know about /opt/intel/cc/9.1.024/lib ? any clues? cheers Dan Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app universal binary problems
Hi Steve, I have got as far a building the python wrapped c++ libraries i need to use on ppc and intel, and now I need to lipo them together to make universal ones, then i can get working with py2app. We had problem previously with py2app not picking up all the bits it needed to make a working .app for our project. Probably that was just us doing it wrong. As I understand it the most development with py2app is going on as part of the pyobjC project, and they have a bleeding edge py2app there, which i am planning to install and try out to build our universal app cheers Dan On 11 Jun 2006, at 22:44, Steve Doe wrote: Dan, I found one of your posts on problems building universal binaries with py2app. I have finally been able to get a macpython 2.4 variant and the latest experimental wxpython universal builds to work. I am only missing the py2app to build universal applications. From your post it appears you had the same problem. Have you figured it out? or is it still a problem for you? thanks, Steve Doe - [EMAIL PROTECTED] Fellow Python user Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig
Re: [Pythonmac-SIG] py2app - apple gcc4.0.1 - universal binaries - problems and questions
Dear Bob Zac and all, We are trying to use py2app to make a OSX .app (preferably universal) of our open source biomedical imaging software, BioImageXD. see http://www.bioimagexd.org for the source code I have a working source code version on a G5 machine, but I am having trouble getting a working .app using py2app. first a little background. BioImageXD is written in python (of course!) and uses wxPython for the GUI. however it relies heavily on the open source Visualöisation Toolkit (VTK) which is written in C++ and has python wrappings so the libs are available to python. We are using a customised version of VTK, not the one you can download, that fixes some specific problems of ours, so we have to compile our own versions of the shared libraries on OSX , linux and windows . questions/problems 1) I run py2app with the python code below, but it fails to launch... get to the splash screen then complains about : BioImageXD error an unexpected error has occurred during execution of the main script. So we are still failing to add all the required dependencies... but I cant see how to fix it...? any clues? 2) how can I make a universal binary? We compile VTK C++ code using cmake and apple gcc 4.0.1. Can I get apple gcc to make universal binaries, which will then work with a universal binary python and py2app? How would I do that? What about the architecture specific compiler flags? Can I just use -fast to get optimization for intel and ppc architectures in the same universal binary? I dont know how to approach this problem. Are there some gcc compiler flags I need to use to generate universal binary shared libraries? Or do I have to make ppc and intel libraries, then lipo them together? What is the best way to make a universal binaries without using Xcode, and have py2app turn them into a universal binary BioImageXD.app application bundle? (Can I do it without using X code? Can python work with C++ in Xcode?) Your help and wisdom would be greatly appreciated! cheers Dan White - bioImageXD team Dr. Daniel James White BSc. (Hons.) PhD Bioimaging Coordinator Nanoscience Centre and Department of Biological and Environmental Sciences Division of Molecular Recognition Ambiotica C242 PO Box 35 University of Jyväskylä Jyväskylä FIN 40014 Finland +358 14 260 4183 (work) +358 468102840 (mobile) http://www.bioimagexd.org http://www.chalkie.org.uk [EMAIL PROTECTED] [EMAIL PROTECTED] ___ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig