I am having trouble installing gcc. Apparently I need gcc 4.0 in order to install a python package.
it gives the error of :
error: Command "gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -arch ppc
-arch i386 -g -O2 -DNDEBUG -g -O3
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include
-Ibuild/src.macosx-10.3-fat-2.7
-I/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/include
-I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7
-c build/src.macosx-10.3-fat-2.7/src/_pycambmodule.c
-o build/temp.macosx-10.3-fat-2.7/build/src.macosx-10.3-fat-2.7/src/_pycambmodule.o"
failed with exit status 1
I have both gcc and gcc 4.0 in /usr/bin but I dont know why its not working.
It also gives the error gcc failed with exit status 1.
Any ideas would be appreciated.
Thanks
The command it's running says -arch ppc -arch i386 and I don't think that is valid for GCC 4.0 (it can't create an executable for both ppc and x86).
Are you sure you need GCC 4.0, not 4.0 or a later version? 4.0 is very old, so any package that doesn't work with newer versions of GCC is probably quite broken and unmaintained.
Related
I am trying to download pygame and am getting an error. I am on a mac computer on OS X 10.11.6. I have an updated version of pip and have Xcode already installed.The error comes up when I type in pip3 install pygame. The error is below...
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DENABLE_NEWBUF=1 -I/NEED_INC_PATH_FIX -I/Library/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c src/scrap.c -o build/temp.macosx-10.6-intel-3.5/src/scrap.o
src/scrap.c:27:10: fatal error: 'SDL.h' file not found
#include "SDL.h"
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
Most sites say to run this in terminal: xcode-select --install which will install xcode tools.
As for installing pygame with python3 on mac, it can be tricky sometimes, so if running the above in terminal stops that error but brings up another un-xcode-related one, I would suggest going here or here if that link fails.
I have a problem installing the lxml in my mavericks machine.
I tried all possibilities by installing the prebuild binaries using
normal pip
pip with static deps
and Building
Current version in normal model
Current version with static deps
Older version in normal mode
Older version with static deps
and always end up in this error.
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
here the detailed message
copying /Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt/xsltutils.h -> build/lib.macosx-10.9-intel-2.7/lxml/includes/libxslt
running build_ext
building 'lxml.etree' extension
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 -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxml2 -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libxslt -I/Users/mangoreader/work/lxml-3.3.4/build/tmp/libxml2/include/libexslt -I/Users/mangoreader/work/lxml-3.3.4/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.9-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
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
Also when i tried installing cython , i am getting the same error
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
detailed log here
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 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c /private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/Cython/Plex/Scanners.c -o build/temp.macosx-10.9-intel-2.7/private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/Cython/Plex/Scanners.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
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip-0akrMB-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/1z/7lv1qq457qxbhkgpt1fk9sdc0000gn/T/pip_build_mangoreader/cython
Storing debug log for failure in /Users/mangoreader/Library/Logs/pip.log
I am totally struck here. It seems this is something to do with the version conflict with gcc or libxml. But i could't figure out what. Any help much appreciated.
SOLVED
As per this SO post clang error: unknown argument: '-mno-fused-madd' (python package installation failure), this can be fixed by setting up this following env variables
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
I am sure that by that that you sorted it out, but in case someone else needs it, install XCode and command line tools and just run
pip install lxml
It will work, may take a little time.
I want to run python's ndimage to do some image analysis. I have a 64-bit Mac running OSX Lion and Python 2.7. When I tried to run commands from ndimage commands I found out that I need to install PIL.
I downloaded that and unzipped it (for now into the downloads folder, is there a better place to do it?). I run setup.py and get these messages:
running install
running build
running build_py
running build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.6-intel-2.7/_imaging.o
unable to execute gcc-4.2: No such file or directory
error: command 'gcc-4.2' failed with exit status 1
I read Failed to build PIL on Mac OS X 10.7 Lion and made sure that I have the 32/64 bit version of python 2.7 installed (Mac OS X 64-bit/32-bit x86-64/i386 Installer (2.7.2) for Mac OS X 10.6 and 10.7 ). I also have Xcode installed. Am I doing something stupid here?
Edit 1:
looking further, I have found this gcc-4.2 failed with exit status 1. I've tried entering this when I get the error:
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.6-intel-2.7/_imaging.o
and I get these messages:
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
Edit 2:
I'm not sure if this is the right way to go, but I found a post on installing pil on OSX Leopard and, following its advice, got rid of the -arch i386 part of the command and entered:
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -IlibImaging -I/Library/Frameworks/Python.framework/Versions/2.7/include -I/usr/include -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.6-intel-2.7/_imaging.o
Now I only get two errors:
_imaging.c:3017: warning: initialization from incompatible pointer type
_imaging.c:3077: warning: initialization from incompatible pointer type
From what I can tell at this point the program poops out and doesn't finish compiling. Can anyone help me take it from here?
https://github.com/kennethreitz/osx-gcc-installer/downloads
Download GCC for lion. It solved all the error: command 'gcc-4.2' failed with exit status 1
problems.
I have had very good success with the MacPorts Python Imaging Library (PIL), Pandas, Numpy and other numerical analysis packages on both Lion and Mountain Lion.
Recently there were some significant upgrades with gcc for integration with the latest numerical Python modules on MacPorts. Looked like a very significant effort. I recommend MacPorts unless you are determined to hash through a native install of PIL on Lion.
I had compiling problems with PIL with Mountain Lion and python 2.7. I used Pillow instead, it's a friendly PIL fork with wider platform support.
regardins your setup questions:
I use macports for python 2.7 and other open source stuff on my mac (libpng, libjpeg, etc for PILLOW)
virtualenv for creating a virtual python environment (venv will be built-in into python 3.3)
I put source code under ~/src (instead Downloads folder)
I am trying to install PIL using PIP installer, and I'm getting this:
llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -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 i386 -arch x86_64 -pipe -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.7/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c _imaging.c -o build/temp.macosx-10.7-intel-2.7/_imaging.o
unable to execute llvm-gcc-4.2: No such file or directory
error: command 'llvm-gcc-4.2' failed with exit status 1
Any clues what the problem might be ?
I have Mac OS X Lion and LLVM is installed in the XCODE Developer tools... What can be wrong ?
i got the same error.
but additionally need to install the "commandline tools" under settings
edit:
just a few keywords for google, if someone is looking for this!
easy_install pip gcc not found mac osx xcode
may be a moderator add this keywords to the question
Are you sure you have actually run the Xcode installer (usually found in /Applications)? Downloading it from the Mac App Store doesn't automatically run the installer.
Check that you have installed XCode. Try installing a PIL from homebrew package manager
Xcode4 dropped PPC support, so when I try building PIL, it throws hate:
Bens-MacBook-Air:Imaging-1.1.7 bkeating$ python setup.py build
running buildrunning build_pyrunning build_ext
--- using frameworks at /System/Library/Frameworks
building '_imaging' extension
/usr/bin/gcc-4.0 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DHAVE_LIBJPEG -DHAVE_LIBZ -I/System/Library/Frameworks/Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers -I/usr/local/include/freetype2 -IlibImaging -I/System/Library/Frameworks/Python.framework/Versions/2.6/include -I/usr/local/include -I/usr/include -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c decode.c -o build/temp.macosx-10.6-universal-2.6/decode.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
decode.c:688: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/folders/jW/jW0VkC8uEb4lAjcJou+OaU+++TI/-Tmp-//ccEmCpUp.out (No such file or directory)
error: command '/usr/bin/gcc-4.0' failed with exit status 1
I ran that first line, manually, and removed the -arch ppc option and it didn't report back with any errors, but rerunning the build process ignores this manual attempt. `gcc-4.0 also does not exist, I symlinked it to gcc-4.2.
I could go ahead and install Xcode3 and then 4, but I want to muck up my fresh install.
Is there anyway to tell PIL to not compile for PPC? I did a grep across the distribution but i did not find a single mention of PPC. Any ideas?
The solution has nothing to do with PIL but rather setting gcc's ARCHFLAGS:
ARCHFLAGS="-arch i386 -arch x86_64" sudo pip install PIL
ARCHFLAGS doesn't seem to get passed into sudo. I had to do
sudo -s
then ARCHFLAGS="-arch i386 -arch x86_64" pip install PIL
to make it work.
A better way to solve this issue, in my opinion, would be to edit your ~/.profile or /etc/bashrc and add the line:
export ARCHFLAGS="-arch i386 -arch x86_64"
Will save messing around with any future installations (I've just had to do this for installing lots of Perl modules in CPAN)!
Just to help others...
I had to use ARCHFLAGS="-arch x86_64" before building imaging with my Snow Leopard/XCode 4 system i.e. having "-arch i386" in their stopped it working for me.