CMake unable to find preciceConfig.cmake

Hi,

I get the following error when I run cmake in any of the tests in solverdummies:

CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a package configuration file provided by "precice" with any
  of the following names:

    preciceConfig.cmake
    precice-config.cmake

  Add the installation prefix of "precice" to CMAKE_PREFIX_PATH or set
  "precice_DIR" to a directory containing one of the above files.  If
  "precice" provides a separate development package or SDK, be sure it has
  been installed.

I am using CMake 3.11.4 and precice-2.2.0. I noticed this issue when I tried to build the dealii adapter, as even when I set -Dprecice_DIR correctly I got this error. When I set CMAKE_PREFIX_PATH instead, I got the error that cmake was unable to load cmake/preciceTargets.cmake.
Any ideas for why this might be? I have also been using this same version of precice with the openfoam adapter and calculix adapter without any installation issues.

Thanks in advance for your help,
Rachael

I tried to debug this live with Rachael, the most strange part was that in the CMakeCache.txt, the file that was reported to not exist, was actually there, owned by the same user, and non-empty.

Hi, lets first ensure the installation is working.
Could you please check the following:

  1. Please make sure that preCICE is build as a shared library. -DBUILD_SHARED_LIBS=ON
  2. Please run make install && make test_install in the binary directory of preCICE. This will attempt to build the cpp solverdummy against the preCICE installation. This is also known as a smoke test.
  3. In case you use precice_DIR, ensure that the precice_DIR contains the files preciceConfig.cmake and preciceTargets.cmake.

Best regards
Frédéric

Hi Frédéric,

I have built preCICE as a shared library. Here are the log files from running make install and make test_install. When I ran make test_install I got the same cmake error (unable to find cmake/preciceTargets.cmake)

install.log (11.1 KB)
testinstall.log (784 Bytes)

Many thanks,
Rachael

I seem to have it working now. When I set CMAKE_PREFIX_PATH=$precice_install_dir, precice_DIR=$precice_install_dir/lib64/cmake/precice and added precice_install_dir/include to CPATH, everything worked. Sorry for the trouble

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