Skip to content

Commit 900ccdf

Browse files
Add tips for building MLIR and OpenFHE on low-RAM systems
1 parent 116c457 commit 900ccdf

File tree

1 file changed

+59
-0
lines changed

1 file changed

+59
-0
lines changed

docs/content/en/docs/development.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,65 @@ Based on what you're trying to do, this may require some extra steps.
206206
Send any upstream changes to HEIR-relevant MLIR files to @j2kun (Jeremy Kun) who
207207
has LLVM commit access and can also suggest additional MLIR reviewers.
208208

209+
## Tips for building dependencies / useful external libraries
210+
211+
### MLIR
212+
213+
Instructions for building MLIR can be found on the
214+
[Getting started](https://mlir.llvm.org/getting_started/) page of the MLIR
215+
website. The instructions there seem to work as written (tested on Ubuntu
216+
22.04). However, the command shown in `Unix-like compile/testing:` may require a
217+
large amount of RAM. If building on a system with 16GB of RAM or less, and if
218+
you don't plan to target GPUs, you may want to replace the line
219+
220+
```
221+
-DLLVM_TARGETS_TO_BUILD="Native;NVPTX;AMDGPU" \
222+
```
223+
224+
with
225+
226+
```
227+
-DLLVM_TARGETS_TO_BUILD="Native" \
228+
```
229+
230+
### OpenFHE
231+
232+
A simple way to build OpenFHE is to follow the instructions in the
233+
[openfhe-configurator](https://github.com/openfheorg/openfhe-configurator)
234+
repository. This allows to build the library with or without support for the
235+
Intel [HEXL library](https://github.com/intel/hexl). First, clone the repository
236+
and configure it using:
237+
238+
```
239+
git clone https://github.com/openfheorg/openfhe-configurator.git
240+
cd openfhe-configurator
241+
scripts/configure.sh
242+
```
243+
244+
You will be asked whether to stage a vanilla OpenFHE build or add support for
245+
HEXL. You can then build the library using
246+
247+
```
248+
./scripts/build-openfhe-development.sh
249+
```
250+
251+
The build may fail on systems with less than 32GB or RAM due to parallel
252+
compilation. You can disable it by editing
253+
`./scripts/build-openfhe-development.sh` and replacing
254+
255+
```
256+
make -j || abort "Build of openfhe-development failed."
257+
```
258+
259+
with
260+
261+
```
262+
make || abort "Build of openfhe-development failed."
263+
```
264+
265+
Compilation will be significantly slower but should then take less than 8GB of
266+
memory.
267+
209268
## Creating a New Pass
210269

211270
The `scripts/templates` folder contains Python scripts to create boilerplate for

0 commit comments

Comments
 (0)