I'm using tidymodels to run xgboost, it works fine when not using renv.
However, when I incorporate renv into my project, i'm unable to install any packages (like xgboost) that require C++ compilation.
renv::install("xgboost")
# Downloading packages ----------------------------------------------
- Downloading xgboost from CRAN ... OK [file is up to date]
Successfully downloaded 1 package in 1.2 seconds.
The following package(s) will be installed:
- xgboost [1.7.5.1]
These packages will be installed into "~/git/nba_pts_mod/renv/library/R-4.3/aarch64-apple-darwin20".
Do you want to proceed? [Y/n]: y
# Installing packages -----------------------------------------------
- Installing xgboost ... FAILED
Error: Error installing package 'xgboost':
===================================
* installing *source* package ‘xgboost’ ...
** package ‘xgboost’ successfully unpacked and MD5 sums checked
** using staged installation
checking Backtrace lib...
checking whether the C++ compiler works... no
configure: error: in `/private/var/folders/nm/zvd1vshn7q38lv276ps59kfr0000gn/T/Rtmpkz0gCA/R.INSTALL990e4c28b93f/xgboost':
configure: error: C++ compiler cannot create executables
See `config.log' for more details
ERROR: configuration failed for package ‘xgboost’
* removing ‘/Users/fred/git/nba_pts_mod/renv/staging/1/xgboost’
install of package 'xgboost' failed [error code 1]
I'm guessing this happens because renv contains everything within it's own environment, so the path to my C++ cannot be found. I'm just unsure how to fix this...I'm not certain where "config.log" (as referenced in the error message) is stored either.
I should mention that i'm using Mac:
Sys.info()['version']
version
"Darwin Kernel Version 23.0.0: Fri Sep 15 14:41:34 PDT 2023; root:xnu-10002.1.13~1/RELEASE_ARM64_T8103"
Any help is greatly appreciated.
Thanks,
Oliver