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

Unable to install on Mac M1 #348

Open
williamboman opened this issue Sep 18, 2021 · 13 comments
Open

Unable to install on Mac M1 #348

williamboman opened this issue Sep 18, 2021 · 13 comments
Labels
bug an unexpected problem or unintended behavior

Comments

@williamboman
Copy link

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’
@brainstorm
Copy link

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.

@gaborcsardi
Copy link
Member

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
Copy link
Member

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

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Dec 8, 2021
@gaborcsardi
Copy link
Member

I cannot actually reproduce this even with homebrew R.

@colinbrislawn
Copy link

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

@gaborcsardi
Copy link
Member

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

@colinbrislawn
Copy link

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.

@gaborcsardi
Copy link
Member

gaborcsardi commented Dec 8, 2021

What exactly is the error that you see? What is

R.Version()$platform

in your R build?

@colinbrislawn
Copy link

\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?

@gaborcsardi
Copy link
Member

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

yoshimoto added a commit to yoshimoto/fs that referenced this issue Dec 24, 2021
@yoshimoto
Copy link

I send pull request. Please merge it.

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

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

@cheungxi
Copy link

cheungxi commented Mar 8, 2022

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

@jianshu93
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

7 participants