Need correct install incantation for modern macOS/homebrew install
Closed this issue · 6 comments
If you are using Mac OS X, I recommend installing re2 with Homebrew by running the following:
$ brew install re2
I'm running macOS on an M1 (arm64-darwin) but gem install re2
fails with
checking for re2 requires C++11 compiler... *** extconf.rb failed ***
Digging into the log shows
conftest.c:3:10: fatal error: 're2/re2.h' file not found
#include <re2/re2.h>
^~~~~~~~~~~
1 error generated.
So apparently I need one of the --with... options, but I don't know which and with which value.
(Homebrew is in /opt/homebrew
.)
Hi @cabo,
If re2 is installed into /opt/homebrew
, could you please try the following?
$ gem install re2 -- --with-re2-dir=/opt/homebrew
I tried to simulate this locally on my Intel Mac by manually compiling re2 into /opt/homebrew
and it seemed to install successfully.
Thanks -- that actually works and probably should be indicated in the README.
(I thought I had tried that and it failed, but maybe I messed something up.)
(Even better would be to test the presence of this directory and use it if present, so it "just drops in".)
Thanks to @scottmatthewman who tested this out on an Apple Silicon machine for me and confirmed you can now run:
$ brew install re2
$ gem install re2
Without having to specify a location for re2 with --with-re2-dir
.
Please let me know if you have any issues, @cabo.
I can confirm that it now works on my M1, too.
Thank you!