Error compiling Cython on Mac 10.6 - xcode

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

Related

Library not loaded: /usr/lib/libncurses.5.4.dylib error on OS X 10.7

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

Pandas Install Error on Mac

When I execute
sudo pip install pandas
I get the error:
creating build/temp.macosx-10.9-intel-2.7/pandas/src/datetime
cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -mno-fused-madd -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -Ipandas/src/klib -Ipandas/src -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/index.c -o build/temp.macosx-10.9-intel-2.7/pandas/index.o
clang: error: unknown argument: '-mno-fused-madd' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
error: command 'cc' failed with exit status 1
I have installed xcode and xcode command line tools.
In fact, I can confirm that cc is installed by executing:
cc -v
which returns:
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
These flags ended up letting me install it:
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
and then (of course):
sudo -E pip install pandas
Thanks #user3378649 for the flags suggestion - that got me thinking along the right track!
Can you please these commands for more information.
As long as you didn't mention what you used to overcome this problem, I'd suggest different approaches to help narrow down in order to find the problem:
First Solution :
Run these flags :
export ARCHFLAGS="-Wno-error=unused-command-line-argument-hard-error-in-future"
if it doesn't work
run these flags :
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
Second Solution :
Get Homebrew - it's a one-line shell script to install!
Edit your .profile, or whatever is appropriate, and put /usr/local/bin at the start of -your PATH so that Homebrew binaries are found before system binaries
brew install python - this installs a newer version of python in /usr/local
run "pip install pandas"
Third Solution :
use easy_install.
Execute the following command in Terminal
PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:$(PATH)}"
export PATH
Then :
$ sudo easy_install pandas

Installing mod_wsgi into XAMPP on OSX Lion

I am trying to configure XAMPP 1.7.3 on OSX 10.7.2 Lion to use mod_wsgi 3.3. Here is what I am doing:
Installed XAMPP for OSX 1.7.3 and the Developer Package. All is running well at this point.
Downloaded and extracted http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
./configure
make
sudo make install
This copies the compiled mod_wsgi.so file into the OSX apache, but I want it in XAMPP, so I copy:
sudo cp /usr/libexec/apache2/mod_wsgi.so /Applications/XAMPP/xamppfiles/modules/
Add the module to the XAMPP httpd.conf LoadModule wsgi_module modules/mod_wsgi.so
Start XAMPP Apache, I get the following notice in the error_log:
[notice] Apache/2.2.14 (Unix) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_wsgi/3.3 Python/2.7.1 PHP/5.3.1 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
When I visit http://localhost, i get this error (via Chrome):
`Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.`
and this error is printed to the error_log:
`[notice] child pid 22847 exit signal Bus error (10)`
I don't know how to troubleshoot this error or what I am missing. Any insight is appreciated!!
UPDATE
I found a blog here that discusses using apache extensions module with this command:
./configure --with-apxs=/Applications/XAMPP/xamppfiles/bin/apxs --with-python=/System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7
The configure looks good, but I get this compiler error:
/Applications/XAMPP/xamppfiles/bin/apxs -c -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE -Wc,'-arch i386' -Wc,'-arch ppc' mod_wsgi.c -Wl,-F/System/Library/Frameworks -framework Python -u _PyMac_Error /System/Library/Frameworks/ -arch i386 -arch ppc -ldl -framework CoreFoundation
Use of assignment to $[ is deprecated at /Applications/XAMPP/xamppfiles/bin/apxs line 86.
/Applications/XAMPP/xamppfiles/build/libtool --silent --mode=compile gcc -prefer-pic -I/Applications/XAMPP/xamppfiles/include -L/Applications/XAMPP/xamppfiles/lib -mmacosx-version-min=10.4 -arch i386 -arch ppc -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -no-cpp-precomp -I/Applications/XAMPP/xamppfiles/include -I/Applications/XAMPP/xamppfiles/include -I/Applications/XAMPP/xamppfiles/include -I/Applications/XAMPP/xamppfiles/include -arch i386 -arch ppc -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -DENABLE_DTRACE -DMACOSX -DNDEBUG -DNDEBUG -DENABLE_DTRACE -c -o mod_wsgi.lo mod_wsgi.c && touch mod_wsgi.slo
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
lipo: can't figure out the architecture type of: /var/tmp//cco5iCcm.out
apxs:Error: Command failed with rc=65536
You need to use --with-apxs option to configure to make it use the apxs from XAMPP distro. If they don't supply one so as to be able to compile extra Apache modules, then the XAMPP distro can't be used.
In other words, you need to compile mod_wsgi against the Apache you want to use, not a different one.
Go read about --with-apxs in instructions:
http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide#Configuring_The_Source_Code

How to compile LibJpeg in universal binary in Mac OSX 10.4

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

how do you get gcc (or llvm) to generate ARM code from the OSX command-line?

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

Resources