pmontman / customxgboost

Custom version of xgboost R package adding customized multiclass objective functions
Other
6 stars 9 forks source link

clang error unsupported option '-fopenmp' #1

Open rasyidstat opened 6 years ago

rasyidstat commented 6 years ago

I do not understand why my installation failed in my MacOS 10.12.6

Downloading GitHub repo pmontman/customxgboost@master
from URL https://api.github.com/repos/pmontman/customxgboost/zipball/master
Installing xgboost
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD  \
  INSTALL  \
  '/private/var/folders/9d/nb52_yd53dv_wk77f_tttwzc0000gn/T/RtmptImmj5/devtools304f1642986c/pmontman-customxgboost-ac8dacf'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests 

* installing *source* package ‘xgboost’ ...
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_  -I/usr/local/include  -fopenmp  -fPIC  -Wall -g -O2 -c xgboost_R.cc -o xgboost_R.o
clang: error: unsupported option '-fopenmp'
make: *** [xgboost_R.o] Error 1
ERROR: compilation failed for package ‘xgboost’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/xgboost’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/xgboost’
Installation failed: Command failed (1)

My gcc version

gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Rasyids-MacBook-Pro:vishleshan rasyidridha$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
chenx2018 commented 6 years ago

I have the same problem

VicenteYago commented 5 years ago

I have the same problem

I do not understand why my installation failed in my MacOS 10.12.6

Downloading GitHub repo pmontman/customxgboost@master
from URL https://api.github.com/repos/pmontman/customxgboost/zipball/master
Installing xgboost
'/Library/Frameworks/R.framework/Resources/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet CMD  \
  INSTALL  \
  '/private/var/folders/9d/nb52_yd53dv_wk77f_tttwzc0000gn/T/RtmptImmj5/devtools304f1642986c/pmontman-customxgboost-ac8dacf'  \
  --library='/Library/Frameworks/R.framework/Versions/3.4/Resources/library' --install-tests 

* installing *source* package ‘xgboost’ ...
configure: creating ./config.status
config.status: creating src/Makevars
** libs
clang++ -std=gnu++11 -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I./include -I./dmlc-core/include -I./rabit/include -I. -DXGBOOST_STRICT_R_MODE=1 -DDMLC_LOG_BEFORE_THROW=0 -DDMLC_ENABLE_STD_THREAD=0 -DDMLC_DISABLE_STDIN=1 -DDMLC_LOG_CUSTOMIZE=1 -DXGBOOST_CUSTOMIZE_LOGGER=1 -DRABIT_CUSTOMIZE_MSG_ -DRABIT_STRICT_CXX98_  -I/usr/local/include  -fopenmp  -fPIC  -Wall -g -O2 -c xgboost_R.cc -o xgboost_R.o
clang: error: unsupported option '-fopenmp'
make: *** [xgboost_R.o] Error 1
ERROR: compilation failed for package ‘xgboost’
* removing ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/xgboost’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.4/Resources/library/xgboost’
Installation failed: Command failed (1)

My gcc version

gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Rasyids-MacBook-Pro:vishleshan rasyidridha$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Did someone fix the error? Im getting the same result in Mac

VicenteYago commented 5 years ago

Well finally I fix the problem, you have to configure your gcc version to one that supports openMP, more info can be found in this link:

https://stackoverflow.com/questions/55825295/installation-of-custom-xgboost-fails-due-to-error-in-shared-library/55842880#55842880

HexuanLiu commented 3 years ago

I'm able to install and get around with the '-fopenmp' issue by following the answer in : https://stackoverflow.com/questions/43595457/alternate-compiler-for-installing-r-packages-clang-error-unsupported-option