---
# System prepended metadata

title: Obliv-C installation and FLORAM Benchmarking

---

# Obliv-C installation and FLORAM Benchmarking

This document describes how to quickly install Obliv-C and run FLORAM benchmarks.

## Obliv-C Installation

First, clone the ```Obliv-C``` repository as

```bash
git clone -b obliv-c https://github.com/samee/obliv-c
```

making sure to use the branch corresponding to the stable release. The folder will attempt to use OCaml to set it up. Install `opam`, the OCaml package manager, as

```bash
sudo apt-get install ocaml libgcrypt20-dev ocaml-findlib opam m4
```

which installs all the dependencies. The latest OCaml version with which Obliv-C has been tested is 4.06.0, and you can switch to that with

```bash
opam switch 4.06.0
eval `opam config env`
```

After that, download some additional dependencies with

```bash
opam install camlp4 ocamlfind ocamlbuild batteries
```

After this, just navigate to the Obliv-C repository and install with

```bash
./configure && make
```

## Floram Benchmarking

Clone the Floram repository as 

```bash
git clone https://gitlab.com/neucrypt/floram/
```

At this point, `make` will probably not work. You could potentially get two errors:

1. `<obliv.h>` header not found. If this is the case, then $PATH hasn't been set correctly. To do this, run

```bash
export OBLIVC_PATH="<your/obliv-c/repository>"
```

2. Some kind of parse error. This occurs due to a bug in the code when dealing with floats. The solution is to compile with the `-D _Float128=double` flag. To do this, add the flag 
```makefile
CFLAGS+= -O3 -march=native -I/usr/include -I . -I $(SRC_PATH) -std=c99 -fopenmp -D _Float128=double 
```
to the Makefile. The first few lines of the Makefile should now look like this

```makefile=
CC ?= gcc
CPP ?= cpp
AR ?= ar
OBLIVCC = $(OBLIVC_PATH)/bin/oblivcc
OBLIVCH = $(OBLIVC_PATH)/src/ext/oblivc
OBLIVCA = $(OBLIVC_PATH)/_build/libobliv.a
CFLAGS+= -O3 -march=native -I/usr/include -I . -I $(SRC_PATH) -std=c99 -fopenmp -D _Float128=double 
LDFLAGS += -lm -lgomp -lgcrypt
```

### Running Benchmarks

Once make is complete, the `build` repository should contain tests. The tests are designed to be run using a server and a client. To run as a server, just run

```bash
/your/obliv-c/repository/build/tests/test_name
```

To run as a client, add

```bash
/your/obliv-c/repository/build/tests/test_name -c <address>
```

If it's the same computer, then the address is just

```bash
/your/obliv-c/repository/build/tests/test_name -c localhost
```

The final command is 

```
/your/obliv-c/repository/build/tests/test_name & /your/obliv-c/repository/build/tests/test_name -c localhost
```

The benchmarks should then be running.