# \[How to include openfhe in other codebase\]

**URL:** <https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515>\
**Category:** Library Questions\
**Created:** [May 1, 2023, 7:57pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515 "2023-05-01T19:57:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jason017](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@jason017](https://openfhe.discourse.group/u/jason017)\
**Post date:** [May 1, 2023, 7:57pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515/1 "2023-05-01T19:57:37Z")

</div>

Hi I am new to OpenFHE  
I run the install on mac and trying to include openfhe.h on other codebase  
But still get some error  
Here is the thing I add in my make file:

```auto
LDLIBS+=-L/usr/local/lib/ -lOPENFHEpke
LDLIBS+=-L/usr/local/lib/ -lOPENFHEcore
LDLIBS+=-L/usr/local/lib/ -lOPENFHEbinfhe

```

And then I try to include \<openfhe.h\>  
However I find that the \<openfhe.h\> is in /usr/local/include/openfhe/pke  
So I use:  
#include “openfhe/pke/openfhe.h”\>  
However know I get an error:

```auto
**/usr/local/include/openfhe/pke/openfhe.h:40:10:**  **fatal error:**  **'openfhecore.h' file not found**

#include "openfhecore.h"

```

So it seems that I am doing wrong, may I ask how I do it correctly?  
Truly appreciate for any help  
TIA

---

<div class="post-metadata">

**Author:** ![iquah](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/iquah/32/8_2.png) [@iquah](https://openfhe.discourse.group/u/iquah)\
**Post date:** [May 1, 2023, 8:15pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515/2 "2023-05-01T20:15:31Z")

</div>

Are you able to run the example scripts? Just to ensure that openfhe was installed properly?

Have you read through [Building User Applications](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/building_user_applications.html)?

---

<div class="post-metadata">

**Author:** ![jason017](https://avatars.discourse-cdn.com/v4/letter/j/7993a0/32.png) [@jason017](https://openfhe.discourse.group/u/jason017)\
**Post date:** [May 5, 2023, 3:12pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515/3 "2023-05-05T15:12:06Z")

</div>

Thanks for the reply, I am reading the [Building User Applications](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/building_user_applications.html)  
Just wants to ask that is it possible to not install using the CMAKE(since I am integrating openfhe to another library and has a complicated directories )?

---

<div class="post-metadata">

**Author:** ![iquah](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/iquah/32/8_2.png) [@iquah](https://openfhe.discourse.group/u/iquah)\
**Post date:** [May 5, 2023, 3:15pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515/4 "2023-05-05T15:15:33Z")

</div>

> is it possible to not install using the CMAKE

@dsuponitskiy-duality

Can you give your insight on this? I’m not familiar with other build systems in c++

---

<div class="post-metadata">

**Author:** ![ypolyakov](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/ypolyakov/32/47_2.png) [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Post date:** [May 5, 2023, 4:08pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515/5 "2023-05-05T16:08:31Z")

</div>

Make can be used directly. For instance, the FreeBSD port for OpenFHE ([https://www.freshports.org/security/openfhe/](https://www.freshports.org/security/openfhe/)) is built using Make. All CMake does is automatically generates Make files, which are then used for building with Make.

The OpenFHE team always recommends using CMake as it is much easier to work with than Make. But maybe other developers in the forum have experimented with Make or other options?

---

<div class="post-metadata">

**Author:** ![dsuponitskiy-duality](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@dsuponitskiy-duality](https://openfhe.discourse.group/u/dsuponitskiy-duality)\
**Post date:** [May 5, 2023, 5:51pm UTC](https://openfhe.discourse.group/t/how-to-include-openfhe-in-other-codebase/515/6 "2023-05-05T17:51:29Z")

</div>

@jason017 Seems like you use a Makefile here. for a regular make, the link line should have all include directories:  
-I/usr/local/include/openfhe/core -I/usr/local/include/openfhe/pke -I//usr/local/include/openfhe/binfhe.  
if this is a cmake file, you could add the following lines:  
include\_directories(/usr/local/include/openfhe/core)  
include\_directories(/usr/local/include/openfhe/pke)  
include\_directories(/usr/local/include/openfhe/binfhe)
