Unverified Commit 6e7f3f3d authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

Find OpenMP in CMake (#402)

parent bd9171d6
...@@ -43,10 +43,12 @@ else(MSVC) ...@@ -43,10 +43,12 @@ else(MSVC)
check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11) check_cxx_compiler_flag("-std=c++11" SUPPORT_CXX11)
set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS "-O2 -Wall -fPIC ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS}")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(CMAKE_C_FLAGS "-fopenmp ${CMAKE_C_FLAGS}") include(FindOpenMP)
set(CMAKE_CXX_FLAGS "-fopenmp ${CMAKE_CXX_FLAGS}") if(OPENMP_FOUND)
endif() set(CMAKE_C_FLAGS "${OpenMP_C_FLAGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${OpenMP_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
endif(OPENMP_FOUND)
endif(MSVC) endif(MSVC)
# Source file lists # Source file lists
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include <algorithm> #include <algorithm>
#include <cstdlib> #include <cstdlib>
#include <cmath> #include <cmath>
#include <omp.h> #include <dmlc/omp.h>
#ifdef _MSC_VER #ifdef _MSC_VER
// rand in MS compiler works well in multi-threading. // rand in MS compiler works well in multi-threading.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment