Installation of precice v2 and its openfoam-adapter

Hi all,
I wanted to switch my precice installation from v1 to v2 so I uninstalled everything (libprecice + openfoam-adapter) and now I am having trouble with installing openfoam-adapter.
I was able to pass the tests after installing precice v2 (via sources or debian package) but I think the installation did not go well because if I run binprecice, the output is:

binprecice: error while loading shared libraries: libprecice.so.2: cannot open shared object file: No such file or directory

It looks to me that there might be a confusion between /usr/local and /usr but I am not an expert in this. If somebody can review the installation process with me, it would be great !

Let us say I download this package.

  1. How can I make sure there won’t be any conflict with any previous installation of precice v1 or v2 that I tried to install/uninstall ?

  2. if everything’s fine, should I just use

    dpkg -i ./libprecice2_2.0.1_bionic.deb
    or
    apt install ./libprecice2_2.0.1_bionic.deb
    ? And do I need to look at something specific before moving to openfoam-adapter ?

Many thanks for your support

After more consideration, I think my installation of libprecice is valid.
However, when I run ./Allwmake for openfoam-adapter, I get the following log:

Building the OpenFOAM adapter for preCICE…

Current OpenFOAM environment:
WM_PROJECT = OpenFOAM
WM_PROJECT_VERSION = 6

The adapter will be built into:
ADAPTER_TARGET_DIR = /home/tdg/OpenFOAM/tdg-6/platforms/linux64GccDPInt64Opt/lib

The following building options will be used:
ADAPTER_PREP_FLAGS = -DADAPTER_DEBUG_MODE
ADAPTER_WMAKE_OPTIONS = -j 20

Dependencies (preCICE) will be located using the following environment variables:
ADAPTER_PRECICE_ROOT =
preCICE dependencies: not specified (ok if preCICE is built as a shared library)
ADAPTER_PKG_CONFIG_CFLAGS = -I/usr/local/include
ADAPTER_PKG_CONFIG_LIBS = -L/usr/local/lib -lprecice
ADAPTER_GLOBAL_CPLUS_INC_PATHS =
ADAPTER_GLOBAL_LD_LIBRARY_PATHS = -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64Gcc/gperftools-svn/lib -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64Gcc/ParaView-5.4.0/lib/paraview-5.4 -L/mnt/datasim/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/lib/openmpi-system -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64GccDPInt64/lib/openmpi-system -L/usr/lib/x86_64-linux-gnu/openmpi/lib -L/home/tdg/OpenFOAM/tdg-6/platforms/linux64GccDPInt64Opt/lib -L/mnt/datasim/OpenFOAM/site/6/platforms/linux64GccDPInt64Opt/lib -L/mnt/datasim/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/lib -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64GccDPInt64/lib -L/mnt/datasim/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/lib/dummy
ADAPTER_GLOBAL_LIBRARY_PATHS =

Building with WMake (see the wmake.log log file)…

=== ERROR: Building failed. See wmake.log for more. ===
Possible causes:

Also in step 3 of the installation tutorial, it is said i may have to adapt to a specific branch of the adapter. The above log was made with the master branch. I pulled the branch related to my OF version (OF6) with the following command:

git clone --single-branch --branch OpenFOAM6 https://github.com/precice/openfoam-adapter.git

And the only change I do in ./Allwmake is :

ADAPTER_WMAKE_OPTIONS="-j $(nproc)"

And when I run the ./Allwmake I obtain

Building the OpenFOAM adapter for preCICE...

Current OpenFOAM environment:
  WM_PROJECT = OpenFOAM
  WM_PROJECT_VERSION = 6

The adapter will be built into:
  ADAPTER_TARGET_DIR    = /home/tdg/OpenFOAM/tdg-6/platforms/linux64GccDPInt64Opt/lib

The following building options will be used:
  ADAPTER_PREP_FLAGS    = -DADAPTER_DEBUG_MODE
  ADAPTER_WMAKE_OPTIONS = -j 20

Dependencies (preCICE) will be located using the following environment variables:
  ADAPTER_PRECICE_ROOT  =
      preCICE dependencies: not specified (ok if preCICE is built as a shared library)
  ADAPTER_PKG_CONFIG_CFLAGS       = -I/usr/local/include
  ADAPTER_PKG_CONFIG_LIBS         = -L/usr/local/lib -lprecice
  ADAPTER_GLOBAL_CPLUS_INC_PATHS  =
  ADAPTER_GLOBAL_LD_LIBRARY_PATHS = -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64Gcc/gperftools-svn/lib -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64Gcc/ParaView-5.4.0/lib/paraview-5.4 -L/mnt/datasim/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/lib/openmpi-system -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64GccDPInt64/lib/openmpi-system -L/usr/lib/x86_64-linux-gnu/openmpi/lib -L/home/tdg/OpenFOAM/tdg-6/platforms/linux64GccDPInt64Opt/lib -L/mnt/datasim/OpenFOAM/site/6/platforms/linux64GccDPInt64Opt/lib -L/mnt/datasim/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/lib -L/mnt/datasim/OpenFOAM/ThirdParty-6/platforms/linux64GccDPInt64/lib -L/mnt/datasim/OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt64Opt/lib/dummy
  ADAPTER_GLOBAL_LIBRARY_PATHS    =

Building with WMake (see the wmake.log log file)...

=== ERROR: Building completed with linking problems: there were undefined symbols. ===
Possible causes:
- Is preCICE discoverable at runtime? Check the content of ADAPTER_PKG_CONFIG_LIBS and ADAPTER_GLOBAL_LD_LIBRARY_PATHS above.
- If preCICE is (in purpose) only build as a static library, please set the ADAPTER_PRECICE_DEP in this script appropriately (see comments).
See wmake.log and ldd.log for more details.

Here are the log files

I managed to solve the problems with the installation by following this tutorial.
The thing that I was missing is export the right variables :

export PRECICE_ROOT = /path/to/precice/folder 

and

export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export CPATH=$CPATH:/usr/local/include/precice