Information to compile packages

From a discussion in 


 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


###############
Answers
###############

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

#################
Answer 2
#################

> 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).

Unless you need to compile Fortran code ... on x86_64 the manuals recommend installing gfortran in /usr/local/gfortran and using a complete path.

For some packages you need other tools such as pkg-config, and the Tcl/Tk support code is installed under /usr/local (as are some symlinks).  So I would nuance Simon's suggestion by adding that you should re-install R (preferably 4.1.2) once /usr/local/* has been moved aside.


Commentaires

Posts les plus consultés de ce blog

Standard error from Hessian Matrix... what can be done when problem occurs

stepAIC from package MASS with AICc

Install treemix in ubuntu 20.04