| 170 | if system() == 'Darwin' and not nomp and not (os.environ.get('CC', '').split('/')[-1].split('\\')[-1].startswith('gcc') |
| 171 | and os.environ.get('CXX', '').split('/')[-1].split('\\')[-1].startswith('g++')): |
| 172 | def get_cmake_opts(openmp_include_dir, openmp_library): |
| 173 | if openmp_include_dir and openmp_library: |
| 174 | return ['-DOpenMP_C_FLAGS=-Xpreprocessor -fopenmp -I{0}'.format(openmp_include_dir), |
| 175 | '-DOpenMP_C_LIB_NAMES=omp', |
| 176 | '-DOpenMP_CXX_FLAGS=-Xpreprocessor -fopenmp -I{0}'.format(openmp_include_dir), |
| 177 | '-DOpenMP_CXX_LIB_NAMES=omp', |
| 178 | '-DOpenMP_omp_LIBRARY={0}'.format(openmp_library)] |
| 179 | else: |
| 180 | return [] |
| 181 | |
| 182 | status = silent_call(cmake_cmd + get_cmake_opts(openmp_include_dir, openmp_library)) |
| 183 | status += silent_call(["make", "_lightgbm", "-j4"]) |