building wxPython on Mac OS X (10.5)

View: New views
6 Messages — Rating Filter:   Alert me  

building wxPython on Mac OS X (10.5)

by grossetti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello everyone,

I am trying to build wx on Mac OS X by following this tutorial :
http://www.wxpython.org/BUILD.html

I did the following :

cd Python-2.5.4
mkdir ../Python-Mac-Root
/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
                --with-suffix=.mine --enable-shared --with-threads
make && make install

cd ../wxPython-src-2.8.10.1
/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
                --with-mac --enable-geometry --enable-display \
                --enable-unicode --with-libjpeg=builtin \
                --with-libpng=builtin --with-libtiff=builtin \
                --with-zlib=builtin
make && make install

cd wxPython
/Users/me/Desktop/Python-Mac-Root/bin/python.mine setup.py build_ext \
         --inplace BUILD_GLCANVAS=0 BUILD_STC=0 BUILD_GIZMOS=0 \
        WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config

and everything goes well. My question is that I don't want to have to
set PYTHONPATH and DYLD_LIBRARY_PATH because I'd like for this to be
self contained and not have env. variables to set (just unzip and use,
like PortablePython on windows). Also, on the wx that's installed with
my real python installation I don't have those env variables defined
and it still works, so could someone please help me with this?

Thank you,
Gabriel
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: building wxPython on Mac OS X (10.5)

by grossetti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 23/9/2009, "gabriel.rossetti@..."
<gabriel.rossetti@...> wrote:

>Hello everyone,
>
>I am trying to build wx on Mac OS X by following this tutorial :
>http://www.wxpython.org/BUILD.html
>
>I did the following :
>
>cd Python-2.5.4
>mkdir ../Python-Mac-Root
>/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
>                --with-suffix=.mine --enable-shared --with-threads
>make && make install
>
>cd ../wxPython-src-2.8.10.1
>/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
>                --with-mac --enable-geometry --enable-display \
>                --enable-unicode --with-libjpeg=builtin \
>                --with-libpng=builtin --with-libtiff=builtin \
>                --with-zlib=builtin
>make && make install
>
>cd wxPython
>/Users/me/Desktop/Python-Mac-Root/bin/python.mine setup.py build_ext \
>         --inplace BUILD_GLCANVAS=0 BUILD_STC=0 BUILD_GIZMOS=0 \
>        WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config
>
>and everything goes well. My question is that I don't want to have to
>set PYTHONPATH and DYLD_LIBRARY_PATH because I'd like for this to be
>self contained and not have env. variables to set (just unzip and use,
>like PortablePython on windows). Also, on the wx that's installed with
>my real python installation I don't have those env variables defined
>and it still works, so could someone please help me with this?
>
>Thank you,
>Gabriel


Ok, I'd forgotten to run the install step so it wasn't in my
site-packages. :

/Users/grossetti/Desktop/Python-Mac-Root/bin/python.mine setup.py install
--prefix=/Users/me/Desktop/Python-Mac-Root
WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config

I tried to export DYLD_LIBRARY_PATH :

export DYLD_LIBRARY_PATH=/Users/me/Desktop/Python-Mac-Root/lib to see if
it at least works like that but I get the following error :

$ Desktop/Python-Mac-Root/bin/python.mine
Python 2.5.4 (r254:67916, Sep 23 2009, 17:37:07)
[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
Type "help", "copyright", "credits" or "license" for more
information.
>>> import wx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File
"/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py",
line 45, in <module>
    from wx._core import *
  File
"/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py",
line 4, in <module>
    import _core_
ImportError:
dlopen(/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so,
2): Symbol not found: __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
  Referenced from:
/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so
  Expected in: dynamic lookup

I don't get it, I did the following :

nm
/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so
| grep __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
         U __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv

so it's there, any ideas?
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: building wxPython on Mac OS X (10.5)

by grossetti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 24/9/2009, "gabriel.rossetti@..."
<gabriel.rossetti@...> wrote:

>On 23/9/2009, "gabriel.rossetti@..."
><gabriel.rossetti@...> wrote:
>
>>Hello everyone,
>>
>>I am trying to build wx on Mac OS X by following this tutorial :
>>http://www.wxpython.org/BUILD.html
>>
>>I did the following :
>>
>>cd Python-2.5.4
>>mkdir ../Python-Mac-Root
>>/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
>>                --with-suffix=.mine --enable-shared --with-threads
>>make && make install
>>
>>cd ../wxPython-src-2.8.10.1
>>/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
>>                --with-mac --enable-geometry --enable-display \
>>                --enable-unicode --with-libjpeg=builtin \
>>                --with-libpng=builtin --with-libtiff=builtin \
>>                --with-zlib=builtin
>>make && make install
>>
>>cd wxPython
>>/Users/me/Desktop/Python-Mac-Root/bin/python.mine setup.py build_ext \
>>         --inplace BUILD_GLCANVAS=0 BUILD_STC=0 BUILD_GIZMOS=0 \
>>        WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config
>>
>>and everything goes well. My question is that I don't want to have to
>>set PYTHONPATH and DYLD_LIBRARY_PATH because I'd like for this to be
>>self contained and not have env. variables to set (just unzip and use,
>>like PortablePython on windows). Also, on the wx that's installed with
>>my real python installation I don't have those env variables defined
>>and it still works, so could someone please help me with this?
>>
>>Thank you,
>>Gabriel
>
>
>Ok, I'd forgotten to run the install step so it wasn't in my
>site-packages. :
>
>/Users/grossetti/Desktop/Python-Mac-Root/bin/python.mine setup.py install
>--prefix=/Users/me/Desktop/Python-Mac-Root
>WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config
>
>I tried to export DYLD_LIBRARY_PATH :
>
>export DYLD_LIBRARY_PATH=/Users/me/Desktop/Python-Mac-Root/lib to see if
>it at least works like that but I get the following error :
>
>$ Desktop/Python-Mac-Root/bin/python.mine
>Python 2.5.4 (r254:67916, Sep 23 2009, 17:37:07)
>[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
>Type "help", "copyright", "credits" or "license" for more
>information.
>>>> import wx
>Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File
>"/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py",
>line 45, in <module>
>    from wx._core import *
>  File
>"/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py",
>line 4, in <module>
>    import _core_
>ImportError:
>dlopen(/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so,
>2): Symbol not found: __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
>  Referenced from:
>/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so
>  Expected in: dynamic lookup
>
>I don't get it, I did the following :
>
>nm
>/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so
>| grep __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
>         U __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
>
>so it's there, any ideas?

If I export PYTHONPATH :

export
PYTHONPATH=/Users/me/Desktop/python_client_deps/wxPython-src-2.8.10.1/wxPython

What I don't get is why the installed version doesn't get picked up in
site-packages. It has a wx.path in site-packages :

$ cat /Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx.pth
wx-2.8-mac-unicode

so I don't get why it's not getting picked up, any ideas?
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: building wxPython on Mac OS X (10.5)

by grossetti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 24/9/2009, "gabriel.rossetti@..."
<gabriel.rossetti@...> wrote:

>On 24/9/2009, "gabriel.rossetti@..."
><gabriel.rossetti@...> wrote:
>
>>On 23/9/2009, "gabriel.rossetti@..."
>><gabriel.rossetti@...> wrote:
>>
>>>Hello everyone,
>>>
>>>I am trying to build wx on Mac OS X by following this tutorial :
>>>http://www.wxpython.org/BUILD.html
>>>
>>>I did the following :
>>>
>>>cd Python-2.5.4
>>>mkdir ../Python-Mac-Root
>>>/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
>>>                --with-suffix=.mine --enable-shared --with-threads
>>>make && make install
>>>
>>>cd ../wxPython-src-2.8.10.1
>>>/configure --prefix=/Users/me/Desktop/Python-Mac-Root \
>>>                --with-mac --enable-geometry --enable-display \
>>>                --enable-unicode --with-libjpeg=builtin \
>>>                --with-libpng=builtin --with-libtiff=builtin \
>>>                --with-zlib=builtin
>>>make && make install
>>>
>>>cd wxPython
>>>/Users/me/Desktop/Python-Mac-Root/bin/python.mine setup.py build_ext \
>>>         --inplace BUILD_GLCANVAS=0 BUILD_STC=0 BUILD_GIZMOS=0 \
>>>        WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config
>>>
>>>and everything goes well. My question is that I don't want to have to
>>>set PYTHONPATH and DYLD_LIBRARY_PATH because I'd like for this to be
>>>self contained and not have env. variables to set (just unzip and use,
>>>like PortablePython on windows). Also, on the wx that's installed with
>>>my real python installation I don't have those env variables defined
>>>and it still works, so could someone please help me with this?
>>>
>>>Thank you,
>>>Gabriel
>>
>>
>>Ok, I'd forgotten to run the install step so it wasn't in my
>>site-packages. :
>>
>>/Users/me/Desktop/Python-Mac-Root/bin/python.mine setup.py install
>>--prefix=/Users/me/Desktop/Python-Mac-Root
>>WX_CONFIG=/Users/me/Desktop/Python-Mac-Root/bin/wx-config
>>
>>I tried to export DYLD_LIBRARY_PATH :
>>
>>export DYLD_LIBRARY_PATH=/Users/me/Desktop/Python-Mac-Root/lib to see if
>>it at least works like that but I get the following error :
>>
>>$ Desktop/Python-Mac-Root/bin/python.mine
>>Python 2.5.4 (r254:67916, Sep 23 2009, 17:37:07)
>>[GCC 4.0.1 (Apple Inc. build 5490)] on darwin
>>Type "help", "copyright", "credits" or "license" for more
>>information.
>>>>> import wx
>>Traceback (most recent call last):
>>  File "<stdin>", line 1, in <module>
>>  File
>>"/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/__init__.py",
>>line 45, in <module>
>>    from wx._core import *
>>  File
>>"/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core.py",
>>line 4, in <module>
>>    import _core_
>>ImportError:
>>dlopen(/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so,
>>2): Symbol not found: __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
>>  Referenced from:
>>/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so
>>  Expected in: dynamic lookup
>>
>>I don't get it, I did the following :
>>
>>nm
>>/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so
>>| grep __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
>>         U __ZN12wxSizerFlags24ReserveSpaceEvenIfHiddenEv
>>
>>so it's there, any ideas?
>
>If I export PYTHONPATH :
>
>export
>PYTHONPATH=/Users/me/Desktop/python_client_deps/wxPython-src-2.8.10.1/wxPython
>
>What I don't get is why the installed version doesn't get picked up in
>site-packages. It has a wx.path in site-packages :
>
>$ cat /Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx.pth
>wx-2.8-mac-unicode
>
>so I don't get why it's not getting picked up, any ideas?

I tried :

$ otool -L
/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so

and I get :

/Users/me/Desktop/Python-Mac-Root/lib/python2.5/site-packages/wx-2.8-mac-unicode/wx/_core_.so:
        /usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version
7.4.0)
        /usr/lib/libwx_macud-2.8.0.dylib (compatibility version 2.6.0, current
version 2.8.4)
        /System/Library/Frameworks/QuickTime.framework/Versions/A/QuickTime
(compatibility version 1.0.0, current version 1327.73.0)
        /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
(compatibility version 1.0.0, current version 275.0.0)
        /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
(compatibility version 2.0.0, current version 136.0.0)
        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 12.0.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
111.1.4)
        /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version
1.0.0)
        /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
(compatibility version 1.0.0, current version 34.0.0)

it appears linked with the wrong version of
/usr/lib/libwx_macud-2.8.0.dylib, is that correct? If so, how can I fix
it?

Thanks
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: [wxPython-users] Re: building wxPython on Mac OS X (10.5)

by Robin Dunn :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 9/24/09 6:46 AM, gabriel.rossetti@... wrote:

> it appears linked with the wrong version of
> /usr/lib/libwx_macud-2.8.0.dylib, is that correct?

Yes.

> If so, how can I fix
> it?
>

Double check the wxWidgets build and install steps.  It should have used
your {prefix}/lib path for the wxMac lib but it fell back to the one
distributed by Apple in /usr/lib instead.  Hmm...  You didn't use
--enable-monolithic in your configure step, that's probably the problem.

Note that the path to the dylib is embedded in the extension module .so
so even when you get this working at your install locations there will
still be issues with having something self contained that can be zipped
up and unzipped elsewhere.  To work around that you're either going to
have to set DYLD_LIBRARY_PATH or you can use install_name_tool to change
the embedded path name.  You can make that embedded name be relative to
the executable or the image loading the dylib (the .so extension modules
in this case) by using "@executable_path" or "@loader_path" in the path
name.

--
Robin Dunn
Software Craftsman
http://wxPython.org

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: [wxPython-users] Re: building wxPython on Mac OS X (10.5)

by grossetti :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Robin Dunn wrote:

> On 9/24/09 6:46 AM, gabriel.rossetti@... wrote:
>
>  
>> it appears linked with the wrong version of
>> /usr/lib/libwx_macud-2.8.0.dylib, is that correct?
>>    
>
> Yes.
>
>  
>> If so, how can I fix
>> it?
>>
>>    
>
> Double check the wxWidgets build and install steps.  It should have used
> your {prefix}/lib path for the wxMac lib but it fell back to the one
> distributed by Apple in /usr/lib instead.  Hmm...  You didn't use
> --enable-monolithic in your configure step, that's probably the problem.
>
>  

Ok, I ran it again and it works now, I must have made a mistake
somewhere. I didn't use --enable-monolithic though

> Note that the path to the dylib is embedded in the extension module .so
> so even when you get this working at your install locations there will
> still be issues with having something self contained that can be zipped
> up and unzipped elsewhere.  To work around that you're either going to
> have to set DYLD_LIBRARY_PATH or you can use install_name_tool to change
> the embedded path name.  You can make that embedded name be relative to
> the executable or the image loading the dylib (the .so extension modules
> in this case) by using "@executable_path" or "@loader_path" in the path
> name.
>  

Ok, thanks for the tip :-)
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig