Skip to content
Permalink
Browse files

[R-package] mojave install r openmp fix (#2164)

* mojave install r openmp fix

* if not gcc/g++ env

* add comment

* fix
  • Loading branch information...
orenov authored and StrikerRUS committed Jun 13, 2019
1 parent 8ecae56 commit c4cd65ff05f4594be926305ff6fad4dfb4cfdd67
Showing with 9 additions and 0 deletions.
  1. +9 −0 R-package/src/install.libs.R
@@ -44,6 +44,15 @@ if (!use_precompile) {
cmake_cmd <- paste0(cmake_cmd, " -DUSE_R35=ON ")
}

# Could NOT find OpenMP_C on Mojave workaround
if (Sys.info()['sysname'] == 'Darwin' && !(grepl('^gcc', Sys.getenv('CC', '')) & grepl('^g\\+\\+', Sys.getenv('CXX', '')))) {
cmake_cmd <- paste(cmake_cmd, ' -DOpenMP_C_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include" ')
cmake_cmd <- paste(cmake_cmd, ' -DOpenMP_C_LIB_NAMES="omp" ')
cmake_cmd <- paste(cmake_cmd, ' -DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I$(brew --prefix libomp)/include" ')
cmake_cmd <- paste(cmake_cmd, ' -DOpenMP_CXX_LIB_NAMES="omp" ')
cmake_cmd <- paste(cmake_cmd, ' -DOpenMP_omp_LIBRARY="$(brew --prefix libomp)/lib/libomp.dylib" ')
}

# Check if Windows installation (for gcc vs Visual Studio)
if (WINDOWS) {
if (use_mingw) {

0 comments on commit c4cd65f

Please sign in to comment.
You can’t perform that action at this time.