hpparvi / PyTransit

Fast and easy exoplanet transit light curve modelling.
GNU General Public License v2.0
99 stars 23 forks source link

compile error with brew gcc (mac yosemite) #10

Closed ryanvarley closed 9 years ago

ryanvarley commented 9 years ago

Running the compile command in the readme

python setup.py config_fc --fcompiler=gnu95 --opt="-Ofast" --f90flags="-cpp -fopenmp -march=native" build

I get

...
/var/folders/vj/jd6pxcxn4zz1ljj4sznqr9d80000gn/T//ccAiYMOG.s:10401:no such instruction: `vmovsd %xmm0, -8(%rax)'
/var/folders/vj/jd6pxcxn4zz1ljj4sznqr9d80000gn/T//ccAiYMOG.s:10402:no such instruction: `vmovsd %xmm1, -16(%rax)'
error: Command "/usr/local/bin/gfortran -cpp -fopenmp -march=native -m64 -fPIC
 -Ofast -DDCHUNK_SIZE=128 -Ibuild/src.macosx-10.5-x86_64-2.7 -
I/Users/ryan/anaconda/lib/python2.7/site-packages/numpy/core/include -
I/Users/ryan/anaconda/include/python2.7 -c -c src/gimenez.f90 -o 
build/temp.macosx-10.5-x86_64-2.7/src/gimenez.o 
-Jbuild/temp.macosx-10.5-x86_64-2.7/pytransit 
-Ibuild/temp.macosx-10.5-x86_64-2.7/pytransit" failed with exit status 1

Any ideas?

hpparvi commented 9 years ago

I haven't tried building the package on a Mac myself, but geoffgrimwood sorted this out with his Macbook by adding -mno-avx to f90flags. That is,

python setup.py config_fc --fcompiler=gnu95 --opt="-Ofast" --f90flags="-cpp -fopenmp -march=native -mno-avx" build

If this still doesn't work, remove -march=native and set -Ofast to -O3 (or lower.)

ryanvarley commented 9 years ago

running the new command without -march=native worked and the tests pass.

python setup.py config_fc --fcompiler=gnu95 --opt="-Ofast" --f90flags="-cpp -fopenmp -mno-avx" build

thanks!