Commit c4cd65ff authored by Oleksii Renov's avatar Oleksii Renov Committed by Nikita Titov
Browse files

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

* mojave install r openmp fix

* if not gcc/g++ env

* add comment

* fix
parent 8ecae562
...@@ -44,6 +44,15 @@ if (!use_precompile) { ...@@ -44,6 +44,15 @@ if (!use_precompile) {
cmake_cmd <- paste0(cmake_cmd, " -DUSE_R35=ON ") 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) # Check if Windows installation (for gcc vs Visual Studio)
if (WINDOWS) { if (WINDOWS) {
if (use_mingw) { if (use_mingw) {
......
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