@@ -30,7 +30,7 @@ python3 -m pip install pybind11 lit
30
30
```
31
31
32
32
## macOS / Homebrew
33
-
33
+ In order to install the dependencies on macOS, you must have Homebrew installed and on your ` PATH ` .
34
34
``` shell
35
35
brew update
36
36
brew install \
@@ -40,19 +40,70 @@ brew install \
40
40
fmt \
41
41
git \
42
42
gmp \
43
+ grep \
43
44
jemalloc \
45
+ libffi
44
46
libyaml \
45
47
llvm@15 \
46
48
maven \
47
49
mpfr \
48
50
pkg-config \
49
51
python3 \
50
52
z3
53
+ ```
54
+
55
+ To ensure that the backend can use pybind11 correctly, we must create an virtual
56
+ environment and install the ` pybind11 ` package:
57
+ ``` shell
58
+ python3 -m venv venv
59
+ source venv/bin/activate
51
60
python3 -m pip install pybind11 lit
52
61
```
53
62
63
+ Guarantee that you have the JDK installed and on your ` PATH ` :
64
+ ``` shell
65
+ export PATH=" /opt/homebrew/opt/openjdk/bin:$PATH "
66
+ ```
67
+
68
+ Some tests rely on GNU Grep options, which are not available on macOS by
69
+ default. To ensure that the tests run correctly, you add the path of
70
+ GNU Grep to your ` PATH ` in your shell profile:
71
+ ``` shell
72
+ export PATH=/opt/homebrew/Cellar/grep/3.11/libexec/gnubin/:$PATH
73
+ ```
74
+
54
75
# Building
55
76
77
+ ## Environment Variables
78
+
79
+ If you're building on macOS, type the following command or epermanently
80
+ add it your ` env ` (` .zshrc ` , ` .bashrc ` , etc.), so that the Homebrew
81
+ installation of LLVM gets picked up correctly. We recommend adding it to
82
+ your shell profile.
83
+ ``` shell
84
+ export LLVM_DIR=$( $( brew --prefix llvm@15) /bin/llvm-config --cmakedir)
85
+ ```
86
+
87
+ If you don't usually use the ` clang ` from your Homebrew installation as
88
+ your default compiler, you can set the following CMake flg to use these
89
+ ` clang ` and ` clang++ ` :
90
+ ``` shell
91
+ -DCMAKE_C_COMPILER=" $( brew --prefix llvm@15) /bin/clang" \
92
+ -DCMAKE_CXX_COMPILER=" $( brew --prefix llvm@15) /bin/clang++"
93
+ ```
94
+ Once again, we recommend adding them and other llvm binaries to your
95
+ ` PATH ` in your shell profile:
96
+ ``` shell
97
+ export PATH=" $( brew --prefix llvm@15) /bin:$PATH "
98
+ ```
99
+
100
+ Some tests rely on GNU Grep options, which are not available on macOS by
101
+ default. To ensure that the tests run correctly, you can create an alias
102
+ for GNU Grep:
103
+ ``` shell
104
+ alias grep=ggrep
105
+ ```
106
+
56
107
Once the system dependencies have been installed, the backend can be built
57
108
locally with:
58
109
``` shell
@@ -66,12 +117,6 @@ cmake .. \
66
117
make -j$( nproc) install
67
118
```
68
119
69
- If you're building on macOS, add the following option to your CMake invocation
70
- so that the Homebrew installation of LLVM gets picked up correctly.
71
- ``` shell
72
- -DLLVM_DIR=$( $( brew --prefix llvm@15) /bin/llvm-config --cmakedir)
73
- ```
74
-
75
120
Additionally, to build the pattern-matching compiler, run:
76
121
``` shell
77
122
cd matching
@@ -91,7 +136,8 @@ To run the integration tests, run:
91
136
``` shell
92
137
lit test
93
138
```
94
- from the root source directory.
139
+ from the root source directory. You can use ` -v ` to see which test is being executed
140
+ and the output of failling tests.
95
141
96
142
There is also a unit test suite for backend internals;
97
143
Add the following option to your CMake invocation to enable it:
@@ -113,7 +159,7 @@ and conform to best practices.
113
159
114
160
``` shell
115
161
# Ubuntu
116
- apt install shellcheck clang-format-12 iwyu
162
+ apt install shellcheck clang-format-15 iwyu
117
163
118
164
# macOS
119
165
brew install shellcheck clang-format iwyu
0 commit comments