Test_install fail: could not find preciceTargets.cmake

preCICE version: 2.1.1
Operating system or platform: Scientific Linux release 7.7 (Nitrogen)
Installation method: building with CMake
Dependency versions: gcc/7.3.0 openmpi/1.10.7/ cmake/3.15.5 eigen/3.3.7 boost/1.73

I am using a bash script (attached) to install preCICE 2.1.1 from source. Everything seems to be going fine until I run make test_install:

CMake Error at /beegfs/users/mtree/precice/precice-2.1.1/cmake/preciceConfig.cmake:5 (include):
include could not find load file:

/beegfs/users/mtree/precice/precice-2.1.1/cmake/preciceTargets.cmake

Indeed, there is no file called preciceTargets.cmake in that location.

I’ve also attached log files for the steps along the way.

Any help will be most appreciated!

build_precice_2_1_1.txt (1.3 KB) ctest.log (3.2 KB) install.log (17.1 KB) make.log (5.1 KB) test_install.log (1.5 KB)

Welcome @Mike_Tree! We are a bit slow to respond these days due to Christmas, but let’s see if I can hellp here.

I see this in your install.log:

-- Up-to-date: /beegfs/users/mtree/precice/precice-2.1.1/lib64/cmake/precice/preciceTargets.cmake
-- Installing: /beegfs/users/mtree/precice/precice-2.1.1/lib64/cmake/precice/preciceTargets-debug.cmake
-- Up-to-date: /beegfs/users/mtree/precice/precice-2.1.1/lib64/cmake/precice/preciceConfig.cmake

make test_install is looking for /beegfs/users/mtree/precice/precice-2.1.1/cmake/preciceTargets.cmake

I also see the following in your build_precice_2_1_1.txt:

# set install location
PRECICE_PREFIX=~/precice/precice-2.1.1 # set this to your selected prefix
export LD_LIBRARY_PATH=$PRECICE_PREFIX/lib:$LD_LIBRARY_PATH
export CPATH=$PRECICE_PREFIX/include:$CPATH
# Enable detection with pkg-config and CMake
export PKG_CONFIG_PATH=$PRECICE_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export CMAKE_PREFIX_PATH=$PRECICE_PREFIX:$CMAKE_PREFIX_PATH

# make the build directory and navigate to it
mkdir -p ~/precice/precice-2.1.1/build
cd ~/precice/precice-2.1.1/build

# configure build
CC=mpicc CXX=mpicxx cmake ~/precice/precice-2.1.1 \
	-DBUILD_SHARED_LIBS=ON \
	-DCMAKE_BUILD_TYPE=Debug \
	-DCMAKE_INSTALL_PREFIX=~/precice/precice-2.1.1 \
	-DMPI_CXX_COMPILER=mpicxx \
	-DPRECICE_PETScMapping=OFF \
	-DPRECICE_PythonActions=OFF \
	-DPRECICE_InstallTest=ON \
	-DPRECICE_ALWAYS_VALIDATE_LIBS=ON

I understand that you are using the same installation prefix as the path you use for the repository. In there, we already have a directory cmake/, and this mix confuses CMake.

I would recommend the following:

  • Modify your script to use a different prefix (could also be a separate directory inside ~/precice/precice-2.1.1, but simply something separate from the root directory of the project)
  • Completely remove the directory where you cloned preCICE
  • Run your script again.

Good luck and let us know if this worked!

@Makis,

Thanks for your response. I too had a holiday break, so I’m just getting back to this now. I eventually got it to work, but wanted to make everyone aware of what I did.

First, as you suggested I changed my prefix to ~/precice/precice-2.1.1/install, removed my entire precice-2.1.1 directory, re-unpacked the precice-2.1.1.tar.gz tarball so my directory only contained the source code, and then re-ran my build script. This ran me into the same error at the same point in my build script.

Then, I noticed that I had enabled the PRECICE_InstallTest configuration variable, when the default was to leave it OFF. So, I removed this line from my cmake command and everything now works.

For reference, I’m including my revised build script and log files.

build_precice_2_1_1.txt (1.4 KB) ctest.log (3.2 KB) install.log (4.3 KB) make.log (271.8 KB) test_install.log (4.8 KB)

1 Like

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