Hello, my name is Insang Song, and I am an incoming postdoc working with Kyle. I want to report a compile error when I try to build PrestoGP package with the tarball file we are sharing.
Code I tried
install.packages("PrestoGP_0.2.0.9009.tar.gz", type = "source")
── R CMD build ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
# ✔ checking for file ‘/Users/songi2/Downloads/PrestoGP/DESCRIPTION’ ...
# ─ preparing ‘PrestoGP’:
# ✔ checking DESCRIPTION meta-information ...
# ─ cleaning src
# ✔ checking vignette meta-information ...
# ─ checking for LF line-endings in source and make files and shell scripts
# ─ checking for empty or unneeded directories
# ─ looking to see if a ‘data/datalist’ file should be added
# ─ building ‘PrestoGP_0.2.0.9009.tar.gz’
# Warning: invalid uid value replaced by that for user 'nobody'
# Warning: invalid gid value replaced by that for user 'nobody'
# Running /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL \
# /var/folders/58/7rn_bn5d6k3_cxwnzdhswpz4n0z2n9/T//RtmpzS7bVy/PrestoGP_0.2.0.9009.tar.gz \
# --install-tests
# * installing to library ‘/Users/songi2/Library/R/arm64/4.3/library’
# * installing *source* package ‘PrestoGP’ ...
# ** using staged installation
# ** libs
# using C++ compiler: ‘Apple clang version 14.0.3 (clang-1403.0.22.14.1)’
# using C++11
# using SDK: ‘MacOSX13.3.sdk’
# clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DARMA_64BIT_WORD=1 -I'/Users/songi2/Library/R/arm64/4.3/library/Rcpp/include' -I'/Users/songi2/Library/R/arm64/4.3/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
# clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -DARMA_64BIT_WORD=1 -I'/Users/songi2/Library/R/arm64/4.3/library/Rcpp/include' -I'/Users/songi2/Library/R/arm64/4.3/library/RcppArmadillo/include' -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c createUMC.cpp -o createUMC.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 PrestoGP.so RcppExports.o createUMC.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0 -L/opt/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/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0'
# ld: warning: directory not found for option '-L/opt/gfortran/lib'
# ld: library not found for -lgfortran
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# make: *** [PrestoGP.so] Error 1
# ERROR: compilation failed for package ‘PrestoGP’
# * removing ‘/Users/songi2/Library/R/arm64/4.3/library/PrestoGP’
# Error in `(function (command = NULL, args = character(), error_on_status = TRUE, …`:
# ! System command 'R' failed
It seems that the compiler couldn't find the library path (i.e., Fortran in /opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0).
Workaround
After a short googling, I found that the compiler arguments in ./src/MakeVars are not suitable for Apple Silicon and tried the arguments that are suggested in Posit Community Thread:
Hello, my name is Insang Song, and I am an incoming postdoc working with Kyle. I want to report a compile error when I try to build PrestoGP package with the tarball file we are sharing.
Code I tried
Workaround
After a short googling, I found that the compiler arguments in ./src/MakeVars are not suitable for Apple Silicon and tried the arguments that are suggested in Posit Community Thread:
Suggestion
Thank you.