fs icon indicating copy to clipboard operation
fs copied to clipboard

Unable to install on Mac M1

Open williamboman opened this issue 3 years ago • 13 comments

Hi! I'm struggling to install fs (as a subdependency to the languageserver package) on Darwin Kernel Version 21.1.0: Thu Aug 19 02:54:44 PDT 2021; root:xnu-8019.40.29~26/RELEASE_ARM64_T8101 arm64.

I'm getting the following error output:

Invalid configuration `arm64-apple-darwin21.1.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin21.1.0 failed
make: *** [libuv-1.38.1/Makefile] Error 1
ERROR: compilation failed for package ‘fs’

williamboman avatar Sep 18 '21 23:09 williamboman

Same issue here, here's the compilation log of fs itself on an Apple Silicon M1 running on OSX Monterey:

> install.packages("fs")
Installing package into ‘/opt/homebrew/lib/R/4.1/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://mirror.aarnet.edu.au/pub/CRAN/src/contrib/fs_1.5.0.tar.gz'
Content type 'application/x-gzip' length 796244 bytes (777 KB)
==================================================
downloaded 777 KB

* installing *source* package ‘fs’ ...
** package ‘fs’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c dir.cc -o dir.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c error.cc -o error.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c file.cc -o file.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c fs.cc -o fs.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c getmode.cc -o getmode.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c id.cc -o id.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c init.cc -o init.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c link.cc -o link.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c path.cc -o path.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c utils.cc -o utils.o
clang++ -std=gnu++14 -I"/opt/homebrew/Cellar/r/4.1.2/lib/R/include" -DNDEBUG -I./libuv-1.38.1/include -I. -pthread  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include   -fPIC  -g -O2  -c unix/getmode.cc -o unix/getmode.o
(cd libuv-1.38.1 \
	&& CC="clang" CFLAGS="-Wno-implicit-function-declaration  -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/xz/include -I/opt/homebrew/include -fPIC " AR="ar" RANLIB="ranlib" LDFLAGS="-L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib" ./configure --quiet)
Invalid configuration `arm64-apple-darwin21.1.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin21.1.0 failed
make: *** [libuv-1.38.1/Makefile] Error 1
ERROR: compilation failed for package ‘fs’
* removing ‘/opt/homebrew/lib/R/4.1/site-library/fs’

The downloaded source packages are in
	‘/private/var/folders/s8/0tz3dy0d1sbg1_cv0ylkx_m80000gn/T/Rtmp59lp4j/downloaded_packages’
Warning message:
In install.packages("fs") :
  installation of package ‘fs’ had non-zero exit status

Thanks @alexiswl for pointing this issue out.

brainstorm avatar Nov 18 '21 22:11 brainstorm

To clarify, this is only an issue with hombrew R (or if you compiled R for yourself). If you use the R build from CRAN then fs is installed from a binary package by default, and it also compiles fine from source.

gaborcsardi avatar Dec 05 '21 22:12 gaborcsardi

I will try to fix this today, but right now I can't install R from Homebrew :( https://github.com/Homebrew/discussions/discussions/2611

gaborcsardi avatar Dec 08 '21 13:12 gaborcsardi

I cannot actually reproduce this even with homebrew R.

gaborcsardi avatar Dec 08 '21 13:12 gaborcsardi

I'm still having this issue (/easily able to replicate it 😜 ) using R from conda-forge.

conda list | grep "r-base"
r-base                    4.1.1                hc29f753_2    conda-forge

https://anaconda.org/conda-forge/r-base

colinbrislawn avatar Dec 08 '21 21:12 colinbrislawn

@colinbrislawn shouldn't you use fs from conda then? https://anaconda.org/conda-forge/r-fs

gaborcsardi avatar Dec 08 '21 21:12 gaborcsardi

The conda-forge build does not support M1 chips yet, which is why I tried to build natively, which is how I got here.

If we can get it building, I'll put in a patch to r-fs-feedstock so it's available from there too.

colinbrislawn avatar Dec 08 '21 22:12 colinbrislawn

What exactly is the error that you see? What is

R.Version()$platform

in your R build?

gaborcsardi avatar Dec 08 '21 22:12 gaborcsardi

\Invalid configuration `arm64-apple-darwin20.0.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.0.0 failed
make: *** [Makevars:31: libuv-1.38.1/Makefile] Error 1
ERROR: compilation failed for package ‘fs’
* removing ‘/Users/cbrisl/miniforge3/envs/R/lib/R/library/fs’
> R.Version()$platform
[1] "aarch64-apple-darwin20.0.0"

I guess that explains it! Do you know how to fix this?

colinbrislawn avatar Dec 09 '21 00:12 colinbrislawn

Try replacing config.sub with the new one at https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

gaborcsardi avatar Dec 09 '21 08:12 gaborcsardi

I send pull request. Please merge it.

FYI: Another workaround is to simply run the following command:

echo 'echo arm-apple-darwin' > config.sub

yoshimoto avatar Dec 24 '21 05:12 yoshimoto

Have Merged ? why the main branch fs/src/libuv-1.38.1/config.sub not updated ?

cheungxi avatar Mar 08 '22 08:03 cheungxi

I still have the error for homebrew R

any idea how to fix. I use home-brew R because I use home-brew clang for all compiling including openmp, where default R does not support.

Thanks,

Jianshu

jianshu93 avatar Nov 23 '22 06:11 jianshu93