Results 1 to 2 of 2

Thread: Build support for Mac 10.4 in Ice 3.4b

  1. #1
    joshmoore is offline Registered User
    Name: Josh Moore
    Organization: Glencoe Software, Inc.
    Project: OMERO, http://trac.openmicroscopy.org.uk/omero
    Join Date
    Feb 2007
    Location
    Germany
    Posts
    115

    Build support for Mac 10.4 in Ice 3.4b

    I ran into several issues while trying to get 3.4b to compile on 10.4:

    • execinfo.h is not available. This can be solved by adding another guard around the use of backtraces in IceUtil/Exception.cpp.
    • _SC_NPROCESSORS_ONLN is not defined. On 10.5, ONLN is defined as "57". Using "-D_SC_NPROCESSORS_ONLN=57" compiles properly, but returns "-1".
    • prefix handling in IceStorm didn't work for me. Specifically, it was necessary to symlink SRC/cpp/lib to /opt/Ice-3.4b/lib to get IceStorm to compile (not handled in patch)

    Though 10.4's not supported, is it possible to include the following patch to allow it to compile?

    Thanks,
    ~Josh

    Code:
    diff -u -r ../Ice-3.4b.orig/cpp/config/Make.rules.Darwin ./cpp/config/Make.rules.Darwin
    --- ../Ice-3.4b.orig/cpp/config/Make.rules.Darwin	2010-01-16 15:49:18.000000000 +0100
    +++ ./cpp/config/Make.rules.Darwin	2010-01-20 11:47:13.000000000 +0100
    @@ -27,15 +27,22 @@
     #
     CXXLIBS			=
     
    -ifneq ($(embedded_runpath_prefix),)
    +release = $(shell uname -r)
    +
    +# 10.5 and above
    +ifeq ($(shell test $(firstword $(subst ., ,$(release))) -ge 9 && echo 0),0)
         # Only use -rpath if Mac OS X >= 10.5
    -    release = $(shell uname -r)
    -    ifeq ($(shell test $(firstword $(subst ., ,$(release))) -ge 9 && echo 0),0)
    -	LDPLATFORMFLAGS     = -Wl,-rpath,$(runpath_libdir)
    +    ifneq ($(embedded_runpath_prefix),)
    +        LDPLATFORMFLAGS  = -Wl,-rpath,$(runpath_libdir)
         endif
    +    LDPLATFORMFLAGS	+= -rdynamic
    +# 10.4
    +else
    +    # 10.4 is missing some headers and definitions
    +    # Also, -rdynamic is not recognized
    +    CXXFLAGS        := $(CXXFLAGS) -DMAC10_4 -D_SC_NPROCESSORS_ONLN=57
     endif
     
    -LDPLATFORMFLAGS		+= -rdynamic
     
     ifdef ice_src_dist
         shlibldflags	= $(CXXFLAGS) -L$(libdir)
    diff -u -r ../Ice-3.4b.orig/cpp/src/IceUtil/Exception.cpp ./cpp/src/IceUtil/Exception.cpp
    --- ../Ice-3.4b.orig/cpp/src/IceUtil/Exception.cpp	2010-01-16 15:49:19.000000000 +0100
    +++ ./cpp/src/IceUtil/Exception.cpp	2010-01-20 09:08:10.000000000 +0100
    @@ -14,7 +14,7 @@
     #include <ostream>
     #include <cstdlib>
     
    -#if defined(__GNUC__) && !defined(__sun)
    +#if defined(__GNUC__) && !defined(__sun) && !defined(MAC10_4)
     #  include <execinfo.h>
     #  include <cxxabi.h>
     #endif
    @@ -52,7 +52,7 @@
     
     Init init;
     
    -#if defined(__GNUC__) && !defined(__sun)
    +#if defined(__GNUC__) && !defined(__sun) && !defined(MAC10_4)
     string
     getStackTrace()
     {
    @@ -183,7 +183,7 @@
     IceUtil::Exception::Exception() :
         _file(0),
         _line(0)
    -#if defined(__GNUC__) && !defined(__sun)
    +#if defined(__GNUC__) && !defined(__sun) && !defined(MAC10_4)
         , _stackTrace(getStackTrace())
     #endif
     {
    @@ -192,7 +192,7 @@
     IceUtil::Exception::Exception(const char* file, int line) :
         _file(file),
         _line(line)
    -#if defined(__GNUC__) && !defined(__sun)
    +#if defined(__GNUC__) && !defined(__sun) && !defined(MAC10_4)
         , _stackTrace(getStackTrace())
     #endif
     {

  2. #2
    blair is offline Registered User
    Name: Blair Zajac
    Organization: Sony Pictures Imageworks
    Project: VnP
    Join Date
    Mar 2007
    Posts
    34
    On my PowerBook booted into 10.4 running this program

    Code:
    #include <unistd.h>
    
    #include <iostream>
    
    #ifndef _SC_NPROCESSORS_CONF
    #define _SC_NPROCESSORS_CONF 57
    #endif
    
    #ifndef _SC_NPROCESSORS_ONLN
    #define _SC_NPROCESSORS_ONLN 58
    #endif
    
    int main()
    {
      std::cout << "_SC_NPROCESSORS_CONF " << sysconf(_SC_NPROCESSORS_CONF) << '\n';
      std::cout << "_SC_NPROCESSORS_ONLN " << sysconf(_SC_NPROCESSORS_ONLN) << '\n';
      return 0;
    }
    I get

    _SC_NPROCESSORS_CONF -1
    _SC_NPROCESSORS_ONLN -1
    So a better patch would add code that defines _SC_NPROCESSORS_ONLN if it isn't set to 58 and then have the code check for a -1 return from sysconf() and use 1 then.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [3.4b] ruby bindings fail to build
    By Reto Glauser in forum Bug Reports
    Replies: 8
    Last Post: 02-05-2010, 11:41 AM
  2. Replies: 2
    Last Post: 12-16-2005, 10:10 PM
  3. Ice 3.0.0 / Mac OS X 10.4.3, GCC 4.0.1
    By lindholm in forum Bug Reports
    Replies: 3
    Last Post: 11-21-2005, 04:54 AM
  4. Compiling demos on Mac OS X 10.4.2
    By CAS in forum Help Center
    Replies: 4
    Last Post: 09-30-2005, 07:33 PM
  5. IcePy 2.0.0 fails, hangs on Mac OS X 10.3
    By Michael Halle in forum Bug Reports
    Replies: 1
    Last Post: 11-30-2004, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •