SPP_net icon indicating copy to clipboard operation
SPP_net copied to clipboard

Compiling liblinear via Matlab on mac

Open roseperrone opened this issue 10 years ago • 3 comments

liblinear depends on OpenMP, which gcc4.9 supports. I tried to make sure Matlab uses gcc4.9, and some evidence indicates it does, and some that it doesn't. This is the error I find:

external/liblinear-1.93_multicore/matlab/train.cpp:7:10: fatal error: 'omp.h' file not found
#include <omp.h>
         ^
1 error generated.

    mex: compile of ' "external/liblinear-1.93_multicore/matlab/train.cpp"' failed.

I made sure to change the /openmp option to -fopenmp because I'm on mac.

I asked this question on StackOverflow: http://stackoverflow.com/questions/26724667/openmp-not-available-on-mac-with-gcc-4-9.

roseperrone avatar Nov 05 '14 20:11 roseperrone

hello beauty,nice to meet you

wuxinhong avatar Apr 13 '15 13:04 wuxinhong

You need to change mat lab's compiler to real gcc rather than Xcode's clang compiler. Try this:http://stackoverflow.com/questions/20340117/omp-h-library-isnt-found-in-the-gcc-version-4-2-1-in-mavericks , the second answer works for me on mac 10.9.

sunshineatnoon avatar Apr 29 '15 13:04 sunshineatnoon

@roseperrone Was there ever a solution to your problem? Currently experiencing a similar issue with MATLAB 2019b on Catalina 10.15.4.

samuelhoover avatar Apr 09 '20 15:04 samuelhoover