# Problem installing the library on Ubuntu 20.04

**URL:** <https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077>\
**Category:** Library Questions\
**Created:** [February 15, 2024, 12:03pm UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077 "2024-02-15T12:03:15Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Reaneling](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Reaneling](https://openfhe.discourse.group/u/Reaneling)\
**Post date:** [February 15, 2024, 12:03pm UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/1 "2024-02-15T12:03:15Z")

</div>

Hello!  
I installed the library according to the instructions in the documentation. And I ran into two problems.  
The library was installed in the Home directory.  
When using command

```auto
sudo make install

```

Everything happens fine, but when I try to build a custom project, the following error appears

```auto
./test: error while loading shared libraries: libOPENFHEbinfhe.so.1: cannot open shared object file: No such file or directory

```

If you use the command

```auto
make install

```

Then this error is thrown at the very end

```auto
CMake Error at cmake_install.cmake:46 (file):
  file INSTALL cannot set permissions on
  "/usr/local/include/openfhe/core/config_core.h": Operation not permitted.

```

Errors are present both in Debug and in Release

---

<div class="post-metadata">

**Author:** ![Caesar](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/caesar/32/63_2.png) [@Caesar](https://openfhe.discourse.group/u/Caesar)\
**Post date:** [February 15, 2024, 2:24pm UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/2 "2024-02-15T14:24:31Z")

</div>

Run `export LD_LIBRARY_PATH=LD_LIBRARY_PATH:<the_path_to_your_installed_library>`, and it should solve the problem.

---

<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:** [February 16, 2024, 12:17am UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/3 "2024-02-16T00:17:29Z")

</div>

You can also use `-DCMAKE_INSTALL_PREFIX` during the install top control where OpenFHE gets installed, as mentioned in the installation instructions. See [CMAKE\_INSTALL\_PREFIX — CMake 3.29.0-rc1 Documentation](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) for more details

---

<div class="post-metadata">

**Author:** ![Reaneling](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Reaneling](https://openfhe.discourse.group/u/Reaneling)\
**Post date:** [February 16, 2024, 5:09am UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/4 "2024-02-16T05:09:49Z")

</div>

I used the commands:

```auto
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/home/reaneling/openfhe-development/build/lib/

export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/local/lib/

```

It did not help

---

<div class="post-metadata">

**Author:** ![Reaneling](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Reaneling](https://openfhe.discourse.group/u/Reaneling)\
**Post date:** [February 16, 2024, 5:11am UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/5 "2024-02-16T05:11:13Z")

</div>

Thank you, but I did not change and did not want to change the installation location. The standard installation location suits me.

---

<div class="post-metadata">

**Author:** ![Reaneling](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@Reaneling](https://openfhe.discourse.group/u/Reaneling)\
**Post date:** [February 16, 2024, 11:43am UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/6 "2024-02-16T11:43:46Z")

</div>

I found an error, but I don’t understand how to fix it. While executing the command, you can see this line.

```auto
Set non-toolchain portion of runtime path of "/usr/local/lib/libOPENFHEpke.so.1.1.2" to ""

```

It is precisely this file that the user project cannot find a link to. I tried downloading the library again - it didn’t help.  
So I checked previous versions. Runs on version 1.1.0. All dependencies are installed. Custom projects work.

---

<div class="post-metadata">

**Author:** ![dcousins](https://yyz1.discourse-cdn.com/flex031/user_avatar/openfhe.discourse.group/dcousins/32/71_2.png) [@dcousins](https://openfhe.discourse.group/u/dcousins)\
**Post date:** [February 16, 2024, 4:07pm UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/7 "2024-02-16T16:07:25Z")

</div>

one more thing if you install into `/usr/local/include/...`  
you need to have root permission, i.e. you need to `su make install`

---

<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:** [February 19, 2024, 7:25pm UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/8 "2024-02-19T19:25:42Z")

</div>

@Reaneling Hi, I do not get any error linking my own (user) application with the openfhe1.1.2 libraries installed in the default location. i can try this again if you could provide your step-by-step instructions how to replicate the issue.

---

<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:** [February 23, 2024, 5:10pm UTC](https://openfhe.discourse.group/t/problem-installing-the-library-on-ubuntu-20-04/1077/9 "2024-02-23T17:10:44Z")

</div>

@Reaneling there is one more thing that could have triggered errors. If you check LD\_LIBRARY\_PATH after having run:

```auto
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/home/reaneling/openfhe-development/build/lib/
export LD_LIBRARY_PATH=LD_LIBRARY_PATH:/usr/local/lib/

```

you will get “LD\_LIBRARY\_PATH:/usr/local/lib/” as the LD\_LIBRARY\_PATH value as the variable gets completely overwritten. The correct way of adding a new path to LD\_LIBRARY\_PATH is

```auto
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/home/reaneling/openfhe-development/build/lib/
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib/

```

In this case LD\_LIBRARY\_PATH gets 2 more paths in addition to the value it had before
