Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation method for ARM chip on Macbook #33

Open
laleoarrow opened this issue Jun 16, 2024 · 0 comments
Open

Installation method for ARM chip on Macbook #33

laleoarrow opened this issue Jun 16, 2024 · 0 comments

Comments

@laleoarrow
Copy link

laleoarrow commented Jun 16, 2024

After several days of struggling to install hyprcoloc on my Macbook, I finally find out why it cannot be installed normally. It turns out that MacOS does not include default libraries for r-package compilation. You need to manually install X-code for it, and for more complex packages (like this one), the GNU Fortran compiler (https://mac.r-project.org/tools/) is also required!

Here is the warpped up solution for installing hyprcoloc.

Step 1: (Ref: https://zhuanlan.zhihu.com/p/111748325)

brew install gcc
# or
brew reinstall gcc

if necessary, create a directory for R to know where the gfortran are at. In my case,

ls *libgfortran*        
libgfortran.5.dylib libgfortran.a       libgfortran.dylib   libgfortran.spec
pwd
/opt/homebrew/opt/gcc/lib/gcc/14


sudo mkdir -p /opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0
# sudo mkdir -p /opt/gfortran/lib
sudo cp /opt/homebrew/opt/gcc/lib/gcc/14/libgfortran.* /opt/gfortran/lib/gcc/aarch64-apple-darwin20.0/12.2.0

Step 2: add gfortran also to your Makevars file. (Ref: xzhoulab/SPARK#12)

which gfortran # /opt/homebrew/bin/gfortran in my case
mkdir -p ~/.R  
nano ~/.R/Makevars # or use vi

Then add this to it

FC = /opt/homebrew/bin/gfortran
F77 = /opt/homebrew/bin/gfortran
FLIBS = -L/opt/homebrew/lib/gcc/14 -lgfortran -lquadmath -lm

Note that your gcc version could be different from my case, so make sure to change it correctly.

Step 3: Then, install the RcppEigen (version 0.3.3.9.3) manually or as instructed by the main page. In my case, I installed it manually.
RcppEigen_0.3.3.9.3.tar.gz

install.packages("~/Documents/tmp/RcppEigen_0.3.3.9.3.tar.gz", repos = NULL, type = "source")
# Then finally is successfully installed it! Congrats!
install_github("cnfoley/hyprcoloc", build_opts = c("--resave-data", "--no-manual"), build_vignettes = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant