Building NumPy on Mac OS X without Apple GCC
I updated my GCC to a more recent version a day ago, since Apple's Xcode Tools only provide GCC 4.0 and the current release of GNU's GCC is 4.2. I successfully achieved this, but now I run into a problem when trying to build NumPy: gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double" gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double" Upon investigation into the matter, I found out that these options (no-cpp-precomp and Wno-long-double) are only valid in Apple's GCC and not the regular GNU release. Yet it seems NumPy automatically assumes Apple's GCC is being used when it realizes the target is OS X. Is there a way around this, or at least some way to specify Apple's GCC? NumPy is the only package I've tried building so far that has a problem with this.
Joshua Lippai wrote:
I updated my GCC to a more recent version a day ago, since Apple's Xcode Tools only provide GCC 4.0 and the current release of GNU's GCC is 4.2. I successfully achieved this, but now I run into a problem when trying to build NumPy:
gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double" gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double"
Upon investigation into the matter, I found out that these options (no-cpp-precomp and Wno-long-double) are only valid in Apple's GCC and not the regular GNU release. Yet it seems NumPy automatically assumes Apple's GCC is being used when it realizes the target is OS X. Is there a way around this, or at least some way to specify Apple's GCC? NumPy is the only package I've tried building so far that has a problem with this.
I'm surprised that you've built other Python extension modules because numpy does not add these flags; Python does. Python extensions should be built with the same compiler that Python itself was built with. If you are using the binary distribution from www.python.org, you should use Apple's gcc, not a different one. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Joshua Lippai wrote:
I updated my GCC to a more recent version a day ago, since Apple's Xcode Tools only provide GCC 4.0 and the current release of GNU's GCC is 4.2. I successfully achieved this, but now I run into a problem when trying to build NumPy:
gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double" gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double"
Upon investigation into the matter, I found out that these options (no-cpp-precomp and Wno-long-double) are only valid in Apple's GCC and not the regular GNU release. Yet it seems NumPy automatically assumes Apple's GCC is being used when it realizes the target is OS X. Is there a way around this, or at least some way to specify Apple's GCC? NumPy is the only package I've tried building so far that has a problem with this.
I'm surprised that you've built other Python extension modules because numpy does not add these flags; Python does. Python extensions should be built with the same compiler that Python itself was built with. If you are using the binary distribution from www.python.org, you should use Apple's gcc, not a different one.
-- Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thanks for the reply. Well, I built my Python stuff, including NumPy previously, before I changed to the higher GCC version. Do you know if there's an option I can toggle that will specify Apple's GCC to be used?
Joshua Lippai wrote:
Thanks for the reply. Well, I built my Python stuff, including NumPy previously, before I changed to the higher GCC version. Do you know if there's an option I can toggle that will specify Apple's GCC to be used?
$ CC=/usr/bin/gcc python setup.py build -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
Thanks for the reply. Well, I built my Python stuff, including NumPy previously, before I changed to the higher GCC version. Do you know if there's an option I can toggle that will specify Apple's GCC to be used?
$ CC=/usr/bin/gcc python setup.py build
--
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thanks, it worked perfectly. I'd hate to be a little off topic in the NumPy discussion and bug you, but when I try to compile the latest scipy, I get: g++: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-Wno-long-double" g++: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-Wno-long-double" And I assume from the way it looks that it's due to a similar reason as my previous compiling problem. I tried adding in CCplus=/usr/bin/g++ but it doesn't seem to do the trick. Again, sorry to keep bugging on an issue I created in my compiling environment, but is there something different I should be typing?
Joshua Lippai wrote:
Thanks, it worked perfectly. I'd hate to be a little off topic in the NumPy discussion and bug you, but when I try to compile the latest scipy, I get:
g++: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-Wno-long-double" g++: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-Wno-long-double"
And I assume from the way it looks that it's due to a similar reason as my previous compiling problem. I tried adding in CCplus=/usr/bin/g++ but it doesn't seem to do the trick. Again, sorry to keep bugging on an issue I created in my compiling environment, but is there something different I should be typing?
The usual makefile variable for c++ makefiles is CXX, not CCplus, so I would suggest trying that first. David
Joshua Lippai wrote:
Thanks, it worked perfectly. I'd hate to be a little off topic in the NumPy discussion and bug you, but when I try to compile the latest scipy, I get:
g++: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-Wno-long-double" g++: unrecognized option '-no-cpp-precomp' cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-arch" cc1plus: error: unrecognized command line option "-Wno-long-double"
And I assume from the way it looks that it's due to a similar reason as my previous compiling problem. I tried adding in CCplus=/usr/bin/g++ but it doesn't seem to do the trick. Again, sorry to keep bugging on an issue I created in my compiling environment, but is there something different I should be typing?
The usual makefile variable for c++ makefiles is CXX, not CCplus, so I would suggest trying that first.
David
_______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thanks, that did it. Everything's building correctly again.
participants (3)
-
David Cournapeau
-
Joshua Lippai
-
Robert Kern