# How to install OpenFOAM-Adapter and Calculix-Adapter in supercomputing platform

**URL:** https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138
**Category:** Official adapters and tutorials
**Tags:** openfoam, calculix, adapters
**Created:** [August 16, 2022, 1:15am UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138 "2022-08-16T01:15:39Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tianhk](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tianhk](https://precice.discourse.group/u/tianhk)
#### Post date: [August 16, 2022, 1:15am UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138/1 "2022-08-16T01:15:39Z")

</div>

Hi everyone, I’ve been using Precice coupled OpenFOAM with Calculix for half a year now. But I’ve been doing it on a personal computer. Due to the recent increase in the amount of computing, personal computers cannot meet the requirements of computing, so it is necessary to install and configure PreCICE on the supercomputing platform.  
However, there are some problems:  
The first way to install software on supercomputing platform is using Miniconda, but there is no installation package for PreCICE, Openfoam-Adapter and Calculix-Adapter on conda website.  
The second way is to compile and install in a local directory using source code, but the supercomputer platform does not provide users with access to the root directory or administrator rights. Therefore, the compiled Adapter cannot be stored under the root directory $FOAM\_USER\_LIBBIN. Because of this problem, I changed the directory where the adapter is stored, However, Unknown function type preciceAdapterFunctionObject mistakes is always displayed ([Get the OpenFOAM adapter | preCICE - The Coupling Library](https://precice.org/adapter-openfoam-get.html#unknown-function-type-preciceadapterfunctio) Nobject).  
Could you please give me some suggestions on installing Openfoam-Adapter and Calculix-Adapter on the supercomputer platform? Thank you!

---

<div class="post-metadata">

### Author: ![Mike\_Tree](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/mike_tree/32/472_2.png) [@Mike\_Tree](https://precice.discourse.group/u/Mike_Tree)
#### Post date: [August 18, 2022, 2:03pm UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138/2 "2022-08-18T14:03:29Z")

</div>

I have successfully compiled OpenFOAM, Calculix, preCICE, the OpenFOAM adaptor, and the Calculix adapter on a supercomputer-accessible file system for which I don’t have root permissions. It’s all a matter of setting the proper environment variables such that the libraries and executables you need are seen.

I believe the error you’re referring to is because OpenFOAM is already installed on your file system, but the `FOAM_USER_LIBBIN` location is inaccessible to you. This is one of the places that OpenFOAM will look for libraries when you add them to the system/controlDict file. However, you can also add libraries to the system/controlDict file using an absolute path. See [this](https://www.cfd-online.com/Forums/openfoam-solving/134308-loading-libraries-e-g-new-boundary-conditions-stored-locally-controldict.html) thread.

I suggest you follow the advice from this thread and add the `libpreciceAdapterFunctionObject.so` file to the system/controlDict file by its absolute path.

---

<div class="post-metadata">

### Author: ![tianhk](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tianhk](https://precice.discourse.group/u/tianhk)
#### Post date: [August 19, 2022, 8:00am UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138/3 "2022-08-19T08:00:54Z")

</div>

Thank you for your reply. I tried it as you suggested. When calculating the Flow-over-plate-nearest-projection example of PreCICE, I used two OpenFOAM solvers, so as to test whether the Openfoam-Adapter can be used normally. But the following problem arises:

The output file looks like this:

 ![1](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/a/a5ef3955cec0ed67b2a28edd78380658d00d5702.png)

and the error file is shown below:

 ![2](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/7/7a55d5b7ed1d2a7a3cf6327b5ac79eedc74403c8.png)

I think it is possible that PreCICE is not installed correctly. Because I moved libpreciceAdapterFunctionObject.so on PC. So the file location and the corresponding path in controlDict file changes. It turns out it works fine. The complete output and error file have also been uploaded. Could you please help me find out why this problem occurs? Thank you!  
[err.txt](https://precice.discourse.group/uploads/short-url/qfbs0DmK1V0Ie2fABYrxiEu2lCF.txt) (15.8 KB)  
[out.txt](https://precice.discourse.group/uploads/short-url/euLq7HKycwshnJBNdu9cAeIfFNB.txt) (9.2 KB)

---

<div class="post-metadata">

### Author: ![Mike\_Tree](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/mike_tree/32/472_2.png) [@Mike\_Tree](https://precice.discourse.group/u/Mike_Tree)
#### Post date: [August 22, 2022, 12:27am UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138/4 "2022-08-22T00:27:20Z")

</div>

Well, it looks like OpenFOAM is now finding the `libpreciceAdapterFunctionObject.so` file just fine. The preCICE adaptor gets loaded and then starts to try and read the preCICE input .xml file (`precice-config.xml`). It seems that somewhere in this xml parse you don’t have the properly library loaded. It also looks like the xml parsing is using a library that comes with the compiler you currently have loaded (gcc-11.2). When I compiled preCICE, OpenFOAM, Calculix, the OpenFOAM adapter and the Calculix adapter I did so using the same compiler and MPI versions. I _think_ this is your problem. If you didn’t compile OpenFOAM yourself then you probably don’t know what compiler and / or MPI version were used to do so. If it were me, I would try and find out what versions of these were used and use the same ones to compile the OpenFOAM adapter. I think this will solve your error.

---

<div class="post-metadata">

### Author: ![tianhk](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@tianhk](https://precice.discourse.group/u/tianhk)
#### Post date: [August 27, 2022, 2:58am UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138/5 "2022-08-27T02:58:10Z")

</div>

I’m sorry to reply you so late. Thanks for your advice. I consulted the supercomputer staff for Compiler and MPI versions, and then tried again, but the previous error still appeared (you can see my submission command in the image below). I think there may be some problems during the software installation. Maybe I should reinstall the software Precice-2.4.0. In addition, when installing precice-2.4.0 and Calculix-Adapter, the supercomputer staff told me that they were also consistently unsuccessful. Installation problems have been bothering me for a long time, and since I don’t have much experience with computer compilation, I’m not sure what to do next. So could you please tell me how you were installed on the supercomputer through source code compilation? Or can you share some of your installation suggestions? Thank you very much!

![precice](https://global.discourse-cdn.com/free1/uploads/precice/original/2X/7/70024a1d4b2f92cd424ef7674a4a4dea40237749.jpeg)

---

<div class="post-metadata">

### Author: ![Makis](https://yyz2.discourse-cdn.com/free1/user_avatar/precice.discourse.group/makis/32/25_2.png) [@Makis](https://precice.discourse.group/u/Makis)
#### Post date: [September 9, 2022, 7:49am UTC](https://precice.discourse.group/t/how-to-install-openfoam-adapter-and-calculix-adapter-in-supercomputing-platform/1138/6 "2022-09-09T07:49:00Z")

</div>

@tianhk several aspects may be going wrong here, but as an alternative, have you tried installing preCICE (and OpenFOAM) via Spack? [Using Spack | preCICE - The Coupling Library](https://precice.org/installation-spack.html)

Spack is designed for HPC systems with module systems and can give you, e.g., a module of preCICE with any dependency versions and optimization options you ask for.

As for Conda, there is a [community-contributed package for preCICE](https://anaconda.org/conda-forge/precice).
