I have created a python extension for a C program. In linux, using gcc, everything works correctly and the extension can be installed typing:
sudo python setup.py install
But when I try to use it in OS X:
GCC 4.7:
I have installed gcc 4.9 using macports and I have added this line in my setup.py file
import os
os.environ["CC"]="gcc-mp-4.9"
And when I type sudo python setup.py install
I obtain this error:
unrecognized command line option '-Wshorten-64-to-32'
I have been looking for the solution and everybody say "Use clang instead of gcc" to solve that issue.
Clang 3.8:
I have also installed clang 3.8 (3.5 is installed in os X but it doesn't have openmp) and I have modified the file setup.py:
import os
os.environ["CC"]="clang-mp-3.8"
And I obtain this error:
unknown argument: '-mno-fused-madd'
In some forums I have found a possible solution for this issue setting an empty value for CFLAGS:
sudo CFLAGS="" python setup.py install
But I obtain a new error:
library not found for -lgomp
I use -fopenmp but I do not why -fgomp is called. In some forums people say that I must use gcc instead of clang, so I am at the starting point again.
I would like to find a solution to easily isntall this extension in OS X because I would like to create an extension that can be easily installed by anyone.