Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
check_add_gcc_compiler_flag("-fopenmp") is not robust enough. On some systems and with some compilers (eg. AppleClang 7) it may say the compiler flag is valid, but later build fails with: ld: library not found for -lgomp Actually, AppleClang doesn't support OpenMP Replace this check with cmake's FindOpenMP [1] which gives better results. Output example in case of not found -- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES) -- Could NOT find OpenMP_CXX (missing: OpenMP_CXX_FLAGS OpenMP_CXX_LIB_NAMES) -- Could NOT find OpenMP (missing: OpenMP_C_FOUND OpenMP_CXX_FOUND) Output example in case of found -- Found OpenMP_C: -fopenmp=libomp (found version "3.1") -- Found OpenMP_CXX: -fopenmp=libomp (found version "3.1") -- Found OpenMP: TRUE (found version "3.1") [1] https://cmake.org/cmake/help/v3.3/module/FindOpenMP.html?highlight=openmp#variables
- Loading branch information