diff --git a/appveyor.yml b/appveyor.yml index 6a64fb15f..3f5011824 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,7 @@ environment: global: CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\python-appveyor-demo\\appveyor\\run_with_env.cmd" + DISABLE_OPENMP: 1 matrix: - PYTHON: "C:\\Python27-x64" diff --git a/src/utils/omp.h b/src/utils/omp.h index ddd3467d9..e3c61110c 100644 --- a/src/utils/omp.h +++ b/src/utils/omp.h @@ -7,10 +7,10 @@ #ifndef XGBOOST_UTILS_OMP_H_ #define XGBOOST_UTILS_OMP_H_ -#if defined(_OPENMP) +#if defined(_OPENMP) && !defined(DISABLE_OPENMP) #include #else -#ifndef DISABLE_OPENMP +#if !defined(DISABLE_OPENMP) // use pragma message instead of warning #pragma message("Warning: OpenMP is not available,"\ "xgboost will be compiled into single-thread code."\