# Problem with runnig the test line for fenicsprecice

**URL:** <https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144>\
**Category:** Official adapters and tutorials\
**Tags:** fenics\
**Created:** [August 21, 2022, 3:11am UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144 "2022-08-21T03:11:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![nmirzaei](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/nmirzaei/32/1414_2.png) [@nmirzaei](https://precice.discourse.group/u/nmirzaei)\
**Post date:** [August 21, 2022, 3:11am UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/1 "2022-08-21T03:11:59Z")

</div>

Hi all,

I am having issue running the test line

```plaintext
sudo python3 -c "import fenicsprecice"

```

I have a linux machine with a working FEniCS 2019.2.0.dev0 installed on it. I have successfully sudo installed all the dependencies including, precice, pyprecice, scipy without any errors. Installing fenicsprecice also did not produce any error for me. However, when I test it through the import line above it produces the following error:

```plaintext
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/.local/lib/python3.8/site-packages/fenicsprecice/ __init__.py", line 9, in <module>
    from .fenicsprecice import Adapter
  File "/root/.local/lib/python3.8/site-packages/fenicsprecice/fenicsprecice.py", line 8, in <module>
    import precice
  File "/root/.local/lib/python3.8/site-packages/precice/ __init__.py", line 4, in <module>
    from cyprecice import Interface, action_read_iteration_checkpoint, action_write_iteration_checkpoint, action_write_initial_data, get_version_information
ImportError: libboost_log_setup.so.1.74.0: cannot open shared object file: No such file or directory

```

I’d really appreciate it if you could help me solve this issue.

---

<div class="post-metadata">

**Author:** ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)\
**Post date:** [August 22, 2022, 7:21am UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/2 "2022-08-22T07:21:07Z")

</div>

Hi @nmirzaei

I have seen such type of an error before. It can happen if suddenly preCICE cannot access the Boost installation that you pointed it to during its build. Are you sure that preCICE is built correctly? Are you using a preCICE package or an installation from source? In general the Boost dependency comes from the preCICE core library. If you have a source installation, can you go to the build folder and run `ctest` and check if all tests pass or not?

---

<div class="post-metadata">

**Author:** ![nmirzaei](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/nmirzaei/32/1414_2.png) [@nmirzaei](https://precice.discourse.group/u/nmirzaei)\
**Post date:** [August 22, 2022, 1:19pm UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/3 "2022-08-22T13:19:19Z")

</div>

Hi @IshaanDesai ,  
Thanks for the response. I used the binary installation through the quickstart instruction here [here.](https://precice.org/quickstart.html)

---

<div class="post-metadata">

**Author:** ![nmirzaei](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/nmirzaei/32/1414_2.png) [@nmirzaei](https://precice.discourse.group/u/nmirzaei)\
**Post date:** [August 22, 2022, 1:54pm UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/4 "2022-08-22T13:54:07Z")

</div>

I re-installed preCICE and it solved the problem. However, now I am receiving an error from OpenFOAM, which used to work fine. It says, “blockmesh not found”.  
There were solutions in the OpenFOAM community which all said I need to include

```nohighlight
"source /usr/lib/openfoam/openfoam2206/etc/bashrc"

```

to my bashrc. But I checked it was already there. It seems I cannot get OpenFoam and Fenics work simultaneously. Do you know what is going on here?

---

<div class="post-metadata">

**Author:** ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)\
**Post date:** [August 22, 2022, 2:19pm UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/5 "2022-08-22T14:19:13Z")

</div>

Firstly good to know that the original issue is resolved. The problem regarding OpenFOAM seems like a classic case of the environment variable not being set properly. Are you sure the path is included properly? What happens if you open a new terminal and try to use OpenFOAM?

Just to make sure that the `fenicsprecice` issue has been resolved, can you try to import it in a Python shell or script? If that works then we can be sure that the original issue has been resolved.

---

<div class="post-metadata">

**Author:** ![nmirzaei](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/nmirzaei/32/1414_2.png) [@nmirzaei](https://precice.discourse.group/u/nmirzaei)\
**Post date:** [August 22, 2022, 6:56pm UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/6 "2022-08-22T18:56:15Z")

</div>

Dear @IshaanDesai Thank you so much for following up so patiently.  
To check whether fenicsprecice works I used the following line in my Linux terminal:

```nohighlight
sudo python3 -c "import fenicsprecice"

```

I also used the import in a Fenics script and it ran with no issues.  
As for the path this is what I see at the bottom of my .bashrc file when I type nano ~/.bashrc:

```nohighlight
if ! shopt -oq posix; then
  if [-f /usr/share/bash-completion/bash_completion]; then
    . /usr/share/bash-completion/bash_completion
  elif [-f /etc/bash_completion]; then
    . /etc/bash_completion
  fi
fi
export PATH=$PATH:$HOME/opt/openmpi/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/opt/openmpi/lib
source /usr/lib/openfoam/openfoam2206/etc/bashrc
source /usr/lib/openfoam/openfoam2206/etc/bashrc

```

There are not one but two of them added. Also, doesn’t make any difference if I delete one of them.

---

<div class="post-metadata">

**Author:** ![nmirzaei](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/nmirzaei/32/1414_2.png) [@nmirzaei](https://precice.discourse.group/u/nmirzaei)\
**Post date:** [August 22, 2022, 8:02pm UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/7 "2022-08-22T20:02:26Z")

</div>

Dear @IshaanDesai. I was able to resolve the issue by deleting all the lines and sourcing again. It is working and is coupling with Fenics just fine. Thank you for your help.

---

<div class="post-metadata">

**Author:** ![IshaanDesai](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/ishaandesai/32/1048_2.png) [@IshaanDesai](https://precice.discourse.group/u/IshaanDesai)\
**Post date:** [August 23, 2022, 7:28am UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/8 "2022-08-23T07:28:19Z")

</div>

Great to know that everything is working now! 👍

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/precice/original/1X/67d2a5fa6f80e597e2267ff17fa8c1673cd11caa.svg) [@system](https://precice.discourse.group/u/system)\
**Post date:** [August 26, 2022, 7:28am UTC](https://precice.discourse.group/t/problem-with-runnig-the-test-line-for-fenicsprecice/1144/9 "2022-08-26T07:28:55Z")

</div>

Closed on August 26, 2022, 7:28am UTC

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
