I want to compile jpeg-8b in universal binary (ppc,i386). It should be supported in 10.4 and later OSs. I could do it in 10.5 and 10.6, but the binary is not compatible with 10.4. Thus I tried to compile it in 10.4, but it fails.
This is my code
cd jpeg-8b
sudo ./configure CC="gcc -arch i386 -arch ppc" CXX="g++ -arch i386 -arch ppc" CPP="gcc -E" CXXCPP="g++ -E" -enable-static=yes -enable-shared=no
It fails with the error configure: error: C compiler cannot create executables
How can I compile jpeg-8b in MacOS 10.4?
Can you try compiling it on 10.5/10.6 with 10.4 SDK installed
and using:
export MACOSX_DEPLOYMENT_TARGET="10.4"
export OSX_SDK="/Developer/SDKs/MacOSX10.4.sdk"
export OSX_CFLAGS="-isysroot $OSX_SDK -arch ppc -arch i386"
export OSX_LDFLAGS="-Wl,-syslibroot,$OSX_SDK -arch ppc -arch i386"
export CFLAGS="$CFLAGS $OSX_CFLAGS"
export CXXFLAGS="$CXXFLAGS $OSX_CFLAGS"
export LDFLAGS="$LDFLAGS $OSX_LDFLAGS"
export ARCHFLAGS="-arch ppc -arch i386"
and try adding --disable-dependency-tracking to ./configure
It worked for me after adding export CFLAGS="-arch x86_64 -arch arm64" before calling config. See GitHub gist
Related
I'm trying to update the ncurses-5.4 to ncurses-5.9 on Mac OS X 10.7.
I've built ncurses-5.9
./configure --prefix=/usr/local/ncurses-5.9 --with-shared
To do the update:
sudo mv /usr/lib/libncurses.5.4.dylib /usr/lib/libncurses.5.4.dylib_BACKUP
sudo ln -s =/usr/local/ncurses-5.9/lib/libncurses.5.dylib /usr/lib/libncurses.5.4.dylib
But after I do it, I get this sort of errors:
Dyld Error Message:
Library not loaded: /usr/lib/libncurses.5.4.dylib
Referenced from: /Applications/iTerm.app/Contents/MacOS/iTerm
Reason: Incompatible library version: iTerm requires version 5.4.0 or later,
but libncurses.5.4.dylib provides version 5.0.0
How to update it to ncurses-5.9? Thank you.
Take a look at Apple's configuration. The config.status file happens to tell you what configure-options were used:
with options \"--prefix=/usr --disable-dependency-tracking --disable-mixed-case --with-shared --without-normal --without-debug --enable-termcap --enable-widec --with-abi-version=5.4 --without-cxx-binding --without-cxx --mandir=/usr/share/man 'CFLAGS=-arch i386 -arch x86_64 -arch ppc -g -Os -pipe -isysroot /' 'CXXFLAGS=-arch i386 -arch x86_64 -arch ppc -g -Os -pipe ' 'LDFLAGS=-arch i386 -arch x86_64 -arch ppc '\"
You should read the INSTALL description for each option, to understand what's done, but the pertinent one for your question is this:
--with-abi-version=5.4
I've applied Compile boost C++11 clang mac cannot find cstddef
and invoked build as follows
./b2 variant=debug,release --layout=versioned toolset=clang cxxflags="-fPIC -std=c++11 -stdlib=libc++ -arch i386 -arch x86_64" linkflags="-stdlib=libc++ -arch i386 -arch x86_64" threading=multi link=shared --stagedir=stage_darwin_intel_shared_mt stage
And everything builds, except for a log of warnings and except for Boost.Wave fails:
http://pastebin.com/ZHkmTWaq
P.S. Static flavor of boost builds Wave fine.
Correct compilation
./b2 variant=debug,release --layout=versioned toolset=clang cxxflags="-fPIC -std=c++11 -stdlib=libc++ -arch i386 -arch x86_64" linkflags="-std=c++11 -stdlib=libc++ -arch i386 -arch x86_64" threading=multi link=shared --stagedir=stage_darwin_intel_shared_mt stage
Trying to install Cython so I can use openKinect Python wrapper.
I downloaded Xcode from the appstore (no install options. lame).
Im getting the following compile errors when trying to install
I also tried easy_install and that failed as well.
Error Code below
creating build/temp.macosx-10.6-universal-2.6/Cython/Plex
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -
Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -
I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c
./Cython/Plex/Scanners.c -o build/temp.macosx-10.6-universal-
2.6/./Cython/Plex/Scanners.o
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler
(/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as)
for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
./Cython/Plex/Scanners.c:6694: fatal error: error writing to -: Broken pipe
Before your command (but after any sudo) put
env ARCHFLAGS="-arch i386 -arch x86_64"
(When installing, you may want to omit the arch you don't have)
I do not have a Mac, I'm just putting through advice from python easy_install fails with "assembler for architecture ppc not installed" on Mac OS X
I had the same issue (with Cython installation and other modules).
Using krzysz00's advice, here are the exact steps (Mac OS X 10.6.8) :
$ uname -a
Darwin machine_name 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386
$ cd Cython-0.14.1
$ sudo su -
# export ARCHFLAGS="-arch i386 -arch x86_64"
# python ./setup.py install
# exit
$
$ which cython
/usr/local/bin/cython
I am trying to build a Universal binary on MacOSX with g++. However, it doesn't really work. I have tried with this simple dummy code:
#include <iostream>
using namespace std;
int main() {
cout << "Hello" << endl;
}
This works fine:
% g++ test.cpp -arch i386 -arch ppc -arch x86_64 -o test
% file test
test: Mach-O universal binary with 3 architectures
test (for architecture i386): Mach-O executable i386
test (for architecture ppc7400): Mach-O executable ppc
test (for architecture x86_64): Mach-O 64-bit executable x86_64
However, this does not:
% g++ test.cpp -arch i386 -arch ppc -arch x86_64 -arch ppc64 -o test
In file included from test.cpp:1:
/usr/include/c++/4.2.1/iostream:44:28: error: bits/c++config.h: No such file or directory
In file included from /usr/include/c++/4.2.1/ios:43,
from /usr/include/c++/4.2.1/ostream:45,
from /usr/include/c++/4.2.1/iostream:45,
from test.cpp:1:
/usr/include/c++/4.2.1/iosfwd:45:29: error: bits/c++locale.h: No such file or directory
/usr/include/c++/4.2.1/iosfwd:46:25: error: bits/c++io.h: No such file or directory
In file included from /usr/include/c++/4.2.1/bits/ios_base.h:45,
from /usr/include/c++/4.2.1/ios:48,
from /usr/include/c++/4.2.1/ostream:45,
from /usr/include/c++/4.2.1/iostream:45,
from test.cpp:1:
/usr/include/c++/4.2.1/ext/atomicity.h:39:23: error: bits/gthr.h: No such file or directory
/usr/include/c++/4.2.1/ext/atomicity.h:40:30: error: bits/atomic_word.h: No such file or directory
...
Any idea why that is?
I am on MacOSX 10.6. I have installed Xcode 3.2.2 with all SDKs it comes with. GCC 4.2 is the default. GCC 4.0 produces some different errors, though behaves similar.
ppc64 support was dropped in Snow Leopard. You can still use ppc64 if you build and link against the Mac OS X 10.5 SDK.
Try the following command at the command line:
g++ test.cpp -arch i386 -arch ppc -arch x86_64 -arch ppc64 -mmacosx-version-min=10.5 -isysroot/Developer/SDKs/MacOSX10.5.sdk -DMACOSX_DEPLOYMENT_TARGET=10.5 -o test
Or for the 10.4 SDK use:
g++-4.0 test.cpp -arch i386 -arch ppc -arch x86_64 -arch ppc64 -mmacosx-version-min=10.4 -isysroot/Developer/SDKs/MacOSX10.4u.sdk -DMACOSX_DEPLOYMENT_TARGET=10.4 -o test
Note, if you want to use the 10.4 SDK, you will have to use gcc 4.0 (or g++4.0 ). Apple's GCC 4.2 doesn't support the 10.4 SDK.
On OSX 10.6.4 with iPhone SDK and Xcode 3.2.1 installed:
$ gcc foo.c -arch arm
gcc-4.2: error trying to exec '/usr/bin/arm-apple-darwin10-gcc-4.2.1':execvp: No such file or directory
$ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -O3 -arch armv7 bar.c -c