Archived

This forum has been archived. Please start a new discussion on GitHub.

Ice binary distribution for OS X 10.6?

Hello ZeroC!

I'm curious if there will be a binary distribution for Snow Leopard coming soon? I tried the x86 version, but I have this problem:
>>> import Ice
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/Ice-3.3/python/Ice.py", line 19, in <module>
    import IcePy
ImportError: dlopen(/opt/Ice-3.3/python/IcePy.so, 2): no suitable image found.  Did find:
	/opt/Ice-3.3/python/IcePy.so: mach-o, but wrong architecture

Must I compile Ice?

Thanks,
Pete

Comments

  • matthew
    matthew NL, Canada
    Ice 3.4 will support snow leopard. This python issue is due to the new version of python that comes with SL. If you use python_select you can revert to 2.5.
  • Hi Matthew,

    I am under the impression that Ice 3.3 for Python supports Python 2.6.x. Is this not the case?

    Thanks!
    Pete
  • matthew
    matthew NL, Canada
    The issue is that python 2.6 is by default a 64 bit binary, whereas the Ice 3.3.1 python plugin is a 32 bit shared library. You could try

    arch -i386 python ... and see if it works.

    Rebuilding Ice 3.3.1 may fix the problem assuming a 64 bit shared library is built by default. If not, you might need to change the build flags.
  • Hi Matthew,

    According to the python man pages in OS X, you can set 32-bit execution by default using an environment variable:
    export VERSIONER_PYTHON_PREFER_32_BIT=yes
    

    However, once I do this, I get a fatal error:
    grapefruit:~ pete$ export VERSIONER_PYTHON_PREFER_32_BIT=yes
    grapefruit:~ pete$ export PYTHONPATH=/opt/Ice-3.3/python
    grapefruit:~ pete$ python
    Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
    [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Ice
    Fatal Python error: Interpreter not initialized (version mismatch?)
    Abort trap
    grapefruit:~ pete$ 
    

    So then I try to compile Ice for Python in my environment, but I hit another dead end unfortunately:
    grapefruit:py pete$ pwd
    /Users/pete/Documents/Ice-3.3.1/py
    grapefruit:py pete$ export ICE_HOME=/opt/Ice-3.3
    grapefruit:py pete$ make
    making all in python
    ....
          IcePy::ExceptionWriter::ExceptionWriter(IcePy::ExceptionWriter const&)in Types.o
      "vtable for Ice::LocalException", referenced from:
          Ice::LocalException::LocalException(Ice::LocalException const&)in Operation.o
          Ice::LocalException::LocalException(Ice::LocalException const&)in Types.o
          Ice::LocalException::LocalException(Ice::LocalException const&)in Util.o
      "Ice::Object::__checkMode(Ice::OperationMode, Ice::OperationMode)", referenced from:
          IcePy::TypedServantWrapper::ice_invoke_async(IceInternal::Handle<Ice::AMD_Array_Object_ice_invoke> const&, std::pair<unsigned char const*, unsigned char const*> const&, Ice::Current const&)in Operation.o
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    make[2]: *** [../../python/IcePy.so.3.3.1] Error 1
    make[1]: *** [all] Error 1
    make: *** [all] Error 1
    grapefruit:py pete$ 
    

    Any idea why the build is failing?

    Thanks,
    Pete
  • benoit
    benoit Rennes, France
    Hi,

    While IcePy supports Python 2.6 on some platforms, the Mac OS X binary IcePy module from Ice-3.3.1-bin-macosx.tar.gz was compiled with Python 2.5 on OS X 10.5.x in 32 bits mode only. So I recommend using python 2.5/32 bits if you want to use the pre-built binary.

    IcePy should compile and link with python 2.6 but we didn't test it on Mac OS X and it looks like this doesn't work as you discovered ;) It's hard to say however what could be the problem without seeing the full compilation command and error. Could you post the full error message and compilation command?

    Cheers,
    Benoit.
  • Hi Benoit,

    Sure, I just feel like I'm spamming the board when I post things like this :)

    I will post it as an attachment, so I don't feel so bad.

    Thanks!
    Pete
  • benoit
    benoit Rennes, France
    Hi,

    The linking is most likely failing because you're compiling IcePy in 64 bits mode against an Ice binary distribution which is compiled in 32 bits mode.

    The best would be to re-compile Ice for C++ as well in 64 bits mode (apparently now the default with GCC on Snow Leopard):
     $ unset ICE_HOME
     $ cd Ice-3.3.1/cpp
     <review INSTALL.MACOSX (install Mcpp and Expat)>
     $ make install prefix=/opt/Ice-3.3.1-64
     $ cd ../py
     $ make install prefix=/opt/Ice-3.3.1-64
    

    This way, you'll have Ice 3.3.1 built in 64 bits mode in /opt/Ice-3.3.1-64 and you should be able to use it out of the box with the default python 2.6 interpreter.

    For the next Ice release, we will most likely provide binaries that contain both the 32 and 64 bits code.

    Cheers,
    Benoit.
  • Thanks Benoit,

    I've been avoiding this because I had trouble getting mcpp to build on Snow Leopard. After googling around a bit, I found a patch to mcpp that allows it to be built on 10.6.

    After compiling Ice for C++ and subsequently Ice for Python, I'm now facing this problem:
    grapefruit:py pete$ export PYTHONPATH=/opt/Ice-3.3.1-64/python/
    grapefruit:py pete$ python
    Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
    [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Ice
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/opt/Ice-3.3.1-64/python/Ice.py", line 19, in <module>
        import IcePy
    ImportError: dlopen(/opt/Ice-3.3.1-64/python/IcePy.so, 2): Library not loaded: ../../lib/libIce.3.3.1.dylib
      Referenced from: /opt/Ice-3.3.1-64/python/IcePy.so
      Reason: image not found
    >>> 
    

    It appears that there is an extra ../ in the path looking for libIce.3.3.1.dylib. It lives at /opt/Ice-3.3.1-64/lib/libIce.3.3.1.dylib. If this is the issue, how can I fix it?

    Thanks,
    Pete
  • benoit
    benoit Rennes, France
    Hi,

    Setting DYLD_LIBRARY_PATH to /opt/Ice-3.3.1-64/lib should workaround the problem.

    However, you shouldn't need this at all if you build Ice with optimization enabled. The IcePy library will embed the correct install name for the Ice dynamic library (i.e.: /opt/Ice-3.3.1-64/lib not ../../lib as in the source tree). In debug mode, we don't setup the install name because this used to cause problems when debugging binaries with gdb (this is no the longer the case with recent Leopard/Xcode versions so this will be fixed in the next release).

    To compile with optimization enabled, you can either edit cpp/config/Make.rules and py/config/Make.rules or just run the make command with "make install OPTIMIZE=yes prefix=/opt/Ice-3.3.1-64" (first you should run a make clean if you don't use a clean source distribution).

    Cheers,
    Benoit.
  • Hello Benoit,

    You're awesome!
    Pete-Sylvesters-MacBook-Pro:~ pete$ export DYLD_LIBRARY_PATH=/opt/Ice-3.3.1-64/lib
    Pete-Sylvesters-MacBook-Pro:~ pete$ export PYTHONPATH=/opt/Ice-3.3.1-64/python/
    Pete-Sylvesters-MacBook-Pro:~ pete$ python
    Python 2.6.1 (r261:67515, Jul  7 2009, 23:51:51) 
    [GCC 4.2.1 (Apple Inc. build 5646)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Ice
    >>> 
    
    :D

    Thanks!
    Pete
  • I've rebuilt Ice for C++ and Python with optimization as Benoit suggested above.

    I'm uploading the build here in case someone else needs to run Ice for Python on Snow Leopard and Python 2.6 prior to the Ice 3.4 release. This archive should save you some time.

    Ice-3.3.1-64 for OS X 10.6

    Enjoy,
    Pete
  • Thanks Pete. That saved me some hassle.

    Another option that I didn't investigate might be MacPorts.

    Cheers,
    gary
  • matthew
    matthew NL, Canada
    Note that 3.4b supports 10.6.
  • Noted, thanks Matthew. I was waiting for the final release before switching across to 3.4.
  • Binary

    Does anyone know where i can find a 64-bit binary for ice3.3, the link in a previous post was dead, but i know there has to be one somewhere. Any help would be greatly appreciated.

    Thanks,
    -Brandon
  • Hi Brandon,

    Here's a copy of my /Applications/ice directory (ICE 3.3.1 for my 64 bit Macbook), provided as-is (hopefully it is useful to you). Installation and configuration is up to you.

    https://www.crucialfruit.com.au/ice/ice-3.3.1-x64.zip

    I honestly can't remember where I got it from - I suspect it is slypete's build.

    Good luck,
    Gary
  • Thanks

    Thanks Gary for the help