[R-pkg-devel] Problems with devtools::build() in R

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Tue May 16 18:26:00 CEST 2023


Your mistake is confusing a tool designed for _iterative development_ for a tool designed for _delivery_.

Use R CMD build the way WRE says you should.

On May 16, 2023 9:07:05 AM PDT, Jarrett Phillips <phillipsjarrett1 using gmail.com> wrote:
>Hi All,
>
>I'm trying to generate a `tar.gz` file on a Mac for R package submission to
>CRAN but am having issues.
>
>I'm using `devtools`, specifically `build()` and `install()`.
>
>My package relies on compiled code via `Rcpp/RcppArmadillo`.
>
>    build("HACSim_OO")
>    ── R CMD build
>─────────────────────────────────────────────────────────────────
>    ✔  checking for file ‘/Users/jarrettphillips/Desktop/HAC
>simulation/HACSim_OO/DESCRIPTION’ ...
>    ─  preparing ‘HACSim’:
>    ✔  checking DESCRIPTION meta-information ...
>    ─  cleaning src
>    ─  installing the package to process help pages
>         -----------------------------------
>    ─  installing *source* package ‘HACSim’ ...
>       ** using staged installation
>       ** libs
>       clang++ -arch arm64 -std=gnu++11 -
>I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
>-I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
>-I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -Wall
>-pedantic -fdiagnostics-color=always -c RcppExports.cpp -o RcppExports.o
>       clang++ -arch arm64 -std=gnu++11
>-I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG
> -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include'
>-I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo/include'
>-I/opt/R/arm64/include    -fPIC  -falign-functions=64 -Wall -g -O2  -Wall
>-pedantic -fdiagnostics-color=always -c accumulate.cpp -o accumulate.o
>       clang++ -arch arm64 -std=gnu++11 -dynamiclib
>-Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module
>-multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib
>-L/opt/R/arm64/lib -o HACSim.so RcppExports.o accumulate.o
>-L/Library/Frameworks/R.framework/Resources/lib -lRlapack
>-L/Library/Frameworks/R.framework/Resources/lib -lRblas
>-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1
>-L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lquadmath
>-F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework
>-Wl,CoreFoundation
>       ld: warning: directory not found for option
>'-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
>       ld: warning: directory not found for option
>'-L/opt/R/arm64/gfortran/lib'
>       ld: library not found for -lgfortran
>       clang: error: linker command failed with exit code 1 (use -v to see
>invocation)
>       make: *** [HACSim.so] Error 1
>       ERROR: compilation failed for package ‘HACSim’
>    ─  removing
>‘/private/var/folders/r4/xm5blbcd2tn06tjv00lm1c780000gn/T/RtmpN4uaYR/Rinstdf4219594de/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: <printed>
>     ---
>    Type .Last.error to see the more details.
>
>`clang` is installed (since I am able to run the code within my package)
>and I've verified by typing `gcc` in the Mac Terminal. I've also installed
>`Homebrew` and `gfortran`, verifying via typing in the Terminal.
>
>Any idea on what's going on how to fix the issue(s)?
>
>Thanks!
>
>Cheers,
>
>Jarrett
>
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-package-devel using r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-package-devel

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-package-devel mailing list