redpony / cdec

Decoder, aligner, and model optimizer for statistical machine translation and other structured prediction models based on (mostly) context-free formalisms
http://cdec-decoder.org/
Apache License 2.0
183 stars 77 forks source link

Issue while building #91

Open lucas0 opened 8 years ago

lucas0 commented 8 years ago

Hello,

I've git cloned, but cannot run cmake -G 'Unix Makefiles' i get this on CMakeFiles/CMakeError.log:

Performing C SOURCE FILE Test OpenMP_FLAG_DETECTED failed with the following output:
Change Dir: /Users/Lucas/Developer/JAMR/tools/cdec/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_25822/fast"
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/cmTC_25822.dir/build.make CMakeFiles/cmTC_25822.dir/build
Building C object CMakeFiles/cmTC_25822.dir/src.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc    -DOpenMP_FLAG_DETECTED -fopenmp   -o CMakeFiles/cmTC_25$
/Users/Lucas/Developer/JAMR/tools/cdec/CMakeFiles/CMakeTmp/src.c:2:10: fatal error: 'omp.h' file not found
#include <omp.h>
         ^
1 error generated.
make[1]: *** [CMakeFiles/cmTC_25822.dir/src.c.o] Error 1
make: *** [cmTC_25822/fast] Error 2

Source file was:

#include <omp.h>
int main() {
#ifdef _OPENMP
  return 0;
#else
  breaks_on_purpose
#endif
}

Does anyone knows how to solve this? Regards, Lucas.

jonsafari commented 8 years ago

It's because your'e on a Mac. For older versions of Xcode (before Clang 3.7+), you used to be able to use Homebrew to install a version of Clang that supports OpenMP:

brew update && brew install clang-omp make CC=clang-omp

El Capitan does include a recent version of Clang. I don't know if that would address this problem, since I don't have a Mac.