[R-SIG-Mac] Trouble compiling packages in R

Simon Urbanek @|mon@urb@nek @end|ng |rom R-project@org
Wed Jan 26 06:46:45 CET 2022


Jarrett,

you seem to have some ancient compilers in /usr/local. In order to avoid issue, I would strongly recommend removing the content of /usr/local (or putting it aside - see below). You don't need any extra tools on Big Sur, only standard Apple Xcode or CLT are needed (see R documentation).

Also please note that your github repository (https://github.com/jphill01/HACSim.R) has binary files checked in which is a bad idea, so you may want to fix that problem first.

Cheers,
Simon


to remove all files from /usr/local:
sudo rm -rf /usr/local/*

to put them aside:
sudo -i
cd /usr/local
mkdir .bak
mv * .bak/

to restore  if needed:
sudo -i
cd /usr/local
mv .bak/* .
rmdir .bak





> On Jan 26, 2022, at 5:43 PM, Jarrett Phillips <phillipsjarrett1 using gmail.com> wrote:
> 
> Hi All,
> I am new to the list and am running RStudio Version 1.4.1717 on macOS Big
> Sur 11.4 and have R 4.1.1 installed.
> 
> I just re-installed Xcode as well as Command Line Tools via instructions at
> https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/
> 
> I am attempting to build my package using devtools::build I have verified
> that both Rcpp and RcppArmadillo are working properly.
> 
> However, when I build, I get the following error message
> 
> Error: package or namespace load failed for ‘HACSim’ in dyn.load(file,
> DLLpath = DLLpath, ...):
>    unable to load shared object
> '/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/00LOCK-HACSim/00new/HACSim/libs/HACSim.so':
> 
> dlopen(/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/00LOCK-HACSim/00new/HACSim/libs/HACSim.so,
> 6): Symbol not found: ___addtf3
>     Referenced from: /usr/local/lib/libquadmath.0.dylib
>     Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
>    in /usr/local/lib/libquadmath.0.dylib
>   Error: loading failed
>   Execution halted
>   ERROR: loading failed
> ─  removing
> ‘/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/HACSim’
>         -----------------------------------
>   ERROR: package installation failed
> Error in (function (command = NULL, args = character(), error_on_status =
> TRUE,  :
>  System command 'R' failed, exit status: 1, stdout + stderr (last 10
> lines):
> E>
> dlopen(/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/00LOCK-HACSim/00new/HACSim/libs/HACSim.so,
> 6): Symbol not found: ___addtf3
> E>   Referenced from: /usr/local/lib/libquadmath.0.dylib
> E>   Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
> E>  in /usr/local/lib/libquadmath.0.dylib
> E> Error: loading failed
> E> Execution halted
> E> ERROR: loading failed
> E> * removing
> ‘/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/HACSim’
> E>       -----------------------------------
> E> ERROR: package installation failed
> Type .Last.error.trace to see where the error occurred
> 
> Here is the traceback:
> 
> Stack trace:
> 
> 1. devtools:::build("HACSim_OO")
> 2. pkgbuild::build(path = pkg, dest_path = path, binary = binary,  ...
> 3. withr::with_temp_libpaths(rcmd_build_tools(options$cmd, c(options$path,
> ...
> 4. base:::force(code)
> 5. pkgbuild:::rcmd_build_tools(options$cmd, c(options$path, options$args),
> ...
> 6. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env,  ...
> 7. callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE,  ...
> 8. callr:::run_r(options)
> 9. base:::with(options, with_envvar(env, do.call(processx::run,  ...
> 10. base:::with.default(options, with_envvar(env, do.call(processx::run,
> ...
> 11. base:::eval(substitute(expr), data, enclos = parent.frame())
> 12. base:::eval(substitute(expr), data, enclos = parent.frame())
> 13. callr:::with_envvar(env, do.call(processx::run, c(list(bin, args =
> real_c ...
> 14. base:::force(code)
> 15. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
> 16. (function (command = NULL, args = character(), error_on_status = TRUE,
> ...
> 17. throw(new_process_error(res, call = sys.call(), echo = echo,  ...
> 
> x System command 'R' failed, exit status: 1, stdout + stderr (last 10
> lines):
> E>
> dlopen(/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/00LOCK-HACSim/00new/HACSim/libs/HACSim.so,
> 6): Symbol not found: ___addtf3
> E>   Referenced from: /usr/local/lib/libquadmath.0.dylib
> E>   Expected in: /usr/local/lib/libgcc_s_x86_64.1.dylib
> E>  in /usr/local/lib/libquadmath.0.dylib
> E> Error: loading failed
> E> Execution halted
> E> ERROR: loading failed
> E> * removing
> ‘/private/var/folders/wv/4_z4h7ns57g7qvd600qgd__w0000gn/T/RtmpGe2Cqt/Rinst118e1e9f13a0/HACSim’
> E>       -----------------------------------
> E> ERROR: package installation failed
> 
> 
> Any ideas?
> 
> Any assistance is warmly welcomed and greatly appreciated.
> 
> Cheers,
> 
> Jarrett
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
> 



More information about the R-SIG-Mac mailing list