garydoranjr / pyemd

Accurate, efficient Earth Mover's Distance for Python (and MATLAB).
BSD 3-Clause "New" or "Revised" License
162 stars 31 forks source link

MATLAB make file does not compile after setting up $MATLABDIR #5

Open ArturoDeza opened 6 years ago

ArturoDeza commented 6 years ago

This was the error that I got after running make from the terminal inside the matlab folder of the repo:

gcc -m64 -Wall -O3 -fPIC -I/usr/local/MATLAB/R2018a/extern/include -I../c_emd -c -DMX_COMPAT_32 -DMATLAB_MEX_FILE -I"/usr/local/MATLAB/R2018a/extern/include" \
    -I"/usr/local/MATLAB/R2018a/simulink/include"  -fno-common -arch x86_64 -fexceptions \
    -O2 -fwrapv -flto ../c_emd/emd.c c_emd.c
gcc: error: x86_64: No such file or directory
gcc: error: unrecognized command line option ‘-arch’
Makefile:25: recipe for target 'c_emd.o' failed
make: *** [c_emd.o] Error 1

I'm using Ubuntu 16.04 running MATLAB 2018a, and have gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10)

garydoranjr commented 6 years ago

Hi @ArturoDeza, sorry for the delay. It looks like the -arch flag is only for the Mac OS version of the compiler. As a workaround, you might just try removing this command-line argument. I will have to fix the Makefile to use different arguments for different operating systems.