ubuntu 13.04: compile fails with unrecognized command line option ‘-arch

1,699 views
Skip to first unread message

Jasmine Sandhu

unread,
Jun 10, 2013, 9:15:48 PM6/10/13
to cython...@googlegroups.com
Hi,

Has anyone build python/cython extensions on ubuntu 13.04?

I'm unable to build any cython extensions. As an example, trying to build the netCDF4 extension gives the following error:
...
building 'netCDF4' extension
compiling C sources
C compiler: i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -arch i386 -fPIC

compile options: '-I/usr/include -I/usr/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c'
i686-linux-gnu-gcc: netCDF4.c
i686-linux-gnu-gcc: error: unrecognized command line option ‘-arch’
i686-linux-gnu-gcc: error: i386: No such file or directory
i686-linux-gnu-gcc: error: unrecognized command line option ‘-arch’
i686-linux-gnu-gcc: error: i386: No such file or directory
error: Command "i686-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -arch i386 -fPIC -I/usr/include -I/usr/include -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/usr/include/python2.7 -c netCDF4.c -o build/temp.linux-i686-2.7/netCDF4.o" failed with exit status 1

I'm using:
Python 2.7.4 (default, Apr 19 2013, 18:32:33) 
[GCC 4.7.3] on linux2

I tried export CC=gcc or export CC=g++, but got the same error. Best I can understand, this is an issue with the compiler but I don't know how to resolve or what compiler flags to change. I did see one post on cython about similar issue on the Mac and it was a compiler issue.

Anyone else encountered this issue?

Thanks,
jasmine

Sturla Molden

unread,
Jun 11, 2013, 12:40:02 PM6/11/13
to cython...@googlegroups.com
I believe the option is -march, not -arch. Besides that, why do you build for 386? 

Sturla

Sendt fra min iPad
--
 
---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jasmine Sandhu

unread,
Jun 11, 2013, 1:02:55 PM6/11/13
to cython...@googlegroups.com


On Tuesday, June 11, 2013 9:40:02 AM UTC-7, Sturla Molden wrote:
I believe the option is -march, not -arch. Besides that, why do you build for 386? 

Thanks Sturla,

I'd copied a .bashrc from my Mac to Linux box and I was setting the CC and CFLAGS in the .bashrc with Mac specific options. Bad idea. 

Removed that and it all works.

jasmine
Reply all
Reply to author
Forward
0 new messages