You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To use re2, you can add it as a project dependency and let your
package manager of choice handle it:
Build tool
Dependency spec
rebar.config
{deps, [re2]}
erlang.mk
DEPS = re2
mix.exs
{:re2, "~> 1.*"}
Installation from source into $ERL_LIBS
If you want to make re2 available globally, you can install it from
source into your Erlang installation by adding it in one of your
$ERL_LIBS paths. So, it's either somewhere like /usr/lib/erlang/lib
or $HOME/.erl.
You can either download a tagged release or clone
the git repo in the target directory. Once
that's done, cd into the directory and run rebar3 compile or just
make.
Now, if you start erl, you should be able to call functions from the
re2 module:
RE2 is automatically downloaded to
c_src/re2 by the build script, and linked into the NIF lib. If you
prefer to link against RE2 as found on
the system, you can set the env var SYSTEM_RE2=1. If you do that and
the library can not be found, it will fall back to a local copy
(c_src/re2). Also, if you want to override the RE2 version that is
fetched and built, when not using system RE2, you can do so by setting
RE2_REV to a git rev.
By default, RE2 upstream source is fetched from the Google remote. If
for some reason you need to fetch the upstream source from some other
git repository, you can do so by setting the RE2_URL environment
variable to a different git url.
Windows build
If you're trying to build on Windows, please make sure you have CMake and
Visual Studio 2017. Before trying to build with rebar3, make sure
rebar3, erlc, make, cmake are in the search path and that you've
run Visual Studio's vcvars64.bat, or are inside the equivalent shell
(spawned from the start menu entry). Windows builds are tested on Azure
Pipelines (see CI badge).
License
Unless otherwise noted, the RE2 source
files are distributed under the BSD-style license found in
c_src/re2/LICENSE.
The same
license
is used for the NIF library.