You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Peace C (Created) (JIRA)" <ji...@apache.org> on 2011/12/30 19:40:30 UTC

[jira] [Created] (THRIFT-1476) Build universal library binaries on Mac OSX

Build universal library binaries on Mac OSX
-------------------------------------------

                 Key: THRIFT-1476
                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
             Project: Thrift
          Issue Type: Improvement
          Components: C++ - Library
    Affects Versions: 0.8, 0.7, 0.9
         Environment: Mac OS X
            Reporter: Peace C
            Priority: Minor
             Fix For: 0.9


I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.

For reference, Jake F. posted a work-around to target different platforms -

> The thrift build is not setup to create a universal binary currently. if
> you would like to create a ticket for this we can take a look at making
> this a global configure option. To set the arch you can pass
> CPPFLAGS='-arch i386' to configure.
[edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> You should be able to use this for each arch you want to create and then 
> use lipo to combine them into a universal binary.
>
> -Jake


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177801#comment-13177801 ] 

Peace C commented on THRIFT-1476:
---------------------------------

Good point, that may well be the case.  I tried building on a 10.5.8 system and configure just won't enable building the C++ library, even passing --with-cpp to try to force it.  
Here's the latter portion of the console output from configure. If it'd be more useful, I can upload the config.log file.


== configuring in lib/php/src/ext/thrift_protocol (/Users/brant/thrift/lib/php/src/ext/thrift_protocol)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr/local'  '--with-cpp' 'CPPFLAGS=-arch ppc' 'CXXFLAGS=-arch ppc' 'LDFLAGS=-arch ppc' --cache-file=/dev/null --srcdir=.
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin9.8.0
checking host system type... i386-apple-darwin9.8.0
checking target system type... i386-apple-darwin9.8.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20060613
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... no
checking for awk... awk
checking if awk is broken... no
checking whether to enable the thrift_protocol extension... yes, shared
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking for /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm -p output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.8.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld
checking if the linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) is GNU ld... no
checking whether the g++ linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common
checking if g++ PIC flag -fno-common works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/libexec/gcc/i686-apple-darwin9/4.0.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin9.8.0 dyld
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged

thrift 0.8.0

Building code generators ..... :

Building C++ Library ......... : no
Building C (GLib) Library .... : no
Building Java Library ........ : yes
Building C# Library .......... : no
Building Python Library ...... : yes
Building Ruby Library ........ : yes
Building Haskell Library ..... : no
Building Perl Library ........ : yes
Building PHP Library ......... : yes
Building Erlang Library ...... : no
Building Go Library .......... : no
Using javac .................. : javac
Using java ................... : java
Using ant .................... : /usr/bin/ant
Using Python ................. : /usr/bin/python
Using php-config ............. : /usr/bin/php-config
Using Ruby ................... : /usr/bin/ruby
Using Perl ................... : /usr/bin/perl

If something is missing that you think should be present,
please skim the output of configure to find the missing
component.  Details are present in config.log.

                
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Jake Farrell (Assigned) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell reassigned THRIFT-1476:
------------------------------------

    Assignee: Jake Farrell
    
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Roger Meier (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182842#comment-13182842 ] 

Roger Meier commented on THRIFT-1476:
-------------------------------------

do you use the llvm-g++ frontend or clang++ ?
see also https://issues.apache.org/jira/browse/THRIFT-1458 for clang++

                
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177749#comment-13177749 ] 

Peace C commented on THRIFT-1476:
---------------------------------

As a side note, building for ppc on OSX 10.7.1 (Lion) and XCode 4.1 fails.  i386 and x86_64 build successfully.

Output from configure:
----------------------
checking whether the C compiler works... no
configure: error: in `/Users/affinegy/dev/thrift/thrift-0.8':
configure: error: C compiler cannot create executables
See `config.log' for more details

config.log:
-----------
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2335.15~25/src/configure --disable-checking --enable-werror --prefix=/D
eveloper/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transfor
m-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/l
lvmgcc42-2335.15~25/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --tar
get=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)
configure:3964: $? = 0
configure:3953: gcc -V >&5
llvm-gcc-4.2: argument to `-V' is missing
configure:3964: $? = 1
configure:3953: gcc -qversion >&5
i686-apple-darwin11-llvm-gcc-4.2: no input files
configure:3964: $? = 1
configure:3984: checking whether the C compiler works
configure:4006: gcc  -arch ppc -arch ppc conftest.c  >&5
llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
configure:4010: $? = 255
configure:4048: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "thrift"
| #define PACKAGE_TARNAME "thrift"
| #define PACKAGE_VERSION "0.8.0"
| #define PACKAGE_STRING "thrift 0.8.0"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "thrift"
| #define VERSION "0.8.0"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4053: error: in `/Users/affinegy/dev/thrift/thrift-0.8':
configure:4055: error: C compiler cannot create executables
See `config.log' for more details

                
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Jake Farrell (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13177777#comment-13177777 ] 

Jake Farrell commented on THRIFT-1476:
--------------------------------------

Wasn't ppc support dropped in the 10.4 or 10.5 sdk? you may need to have an older version of Xcode installed in order to have ppc arch support
                
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181587#comment-13181587 ] 

Peace C commented on THRIFT-1476:
---------------------------------

A 10.5 Intel system is able to build for ppc architecture. A closer inspection of config.log revealed that boost was not installed on the particular system, causing it to skip the C++ libs.
It appears that the Thrift build scripts create a test binary and tries to execute it during the build. 10.5 ships with Rosetta so it can run ppc binaries. However even though a 10.6+ system can build ppc with the right version of Xcode, the build fails on an Intel system because it can't execute the ppc binary. Please consider removing the execution step of the binary if it does not match the current architecture.
                
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (THRIFT-1476) Build universal library binaries on Mac OSX

Posted by "Peace C (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/THRIFT-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13183370#comment-13183370 ] 

Peace C commented on THRIFT-1476:
---------------------------------

The 10.7 system uses i686-apple-darwin11-llvm-gcc-4.2 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00).

I can't tell which the 10.5 system uses. Closest match I could find in config.log is i686-apple-darwin9-gcc-4.0.1 (Apple Inc. build 5493).  As far as I can tell, both are using default XCode settings.

                
> Build universal library binaries on Mac OSX
> -------------------------------------------
>
>                 Key: THRIFT-1476
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1476
>             Project: Thrift
>          Issue Type: Improvement
>          Components: C++ - Library
>    Affects Versions: 0.7, 0.8, 0.9
>         Environment: Mac OS X
>            Reporter: Peace C
>            Assignee: Jake Farrell
>            Priority: Minor
>              Labels: build, mac, osx, thrift, universal, universal_binary
>             Fix For: 0.9
>
>
> I would like to request a build option to create universal binaries on Mac OSX.  The resulting library would support i386, x86_64 and ppc platforms.
> For reference, Jake F. posted a work-around to target different platforms -
> > The thrift build is not setup to create a universal binary currently. if
> > you would like to create a ticket for this we can take a look at making
> > this a global configure option. To set the arch you can pass
> > CPPFLAGS='-arch i386' to configure.
> [edit: additionally pass LDFLAGS and CXXFLAGS with the same architecture]
> > You should be able to use this for each arch you want to create and then 
> > use lipo to combine them into a universal binary.
> >
> > -Jake

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira