Testing preCICE installation

Hi,

I thought I am nearly successful in installing precice on ubuntu 18. The very final test did not pass :frowning: Followed the instructions as per wiki.

  1. The ‘make test’ showed below error. Guess, this is fine. Although, I am not sure if parallel coupling is possible since mpiports seem to have an issue.

The following tests FAILED:

  • 2 - precice.action (Timeout)*
    
  • 4 - precice.com.mpiports (Timeout)*
    

Errors while running CTest
Makefile:105: recipe for target ‘test’ failed
make: *** [test] Error 8

  1. Proceeded with make install and specifying the correct path PKG_CONFIG_PATH. The ‘make test_install’ in the build folder failed though. Below is the last few lines of the log file. What is the reason for this error?
CMakeFiles/test_install.dir/build.make:57: recipe for target 'CMakeFiles/test_install' failed
make[3]: *** [CMakeFiles/test_install] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/test_install.dir/all' failed
make[2]: *** [CMakeFiles/test_install.dir/all] Error 2
CMakeFiles/Makefile2:74: recipe for target 'CMakeFiles/test_install.dir/rule' failed
make[1]: *** [CMakeFiles/test_install.dir/rule] Error 2
Makefile:197: recipe for target 'test_install' failed
make: *** [test_install] Error 2

Hello again,

Thought I will give some more info in addition to the above message for easy trouble shooting.
I followed all the main 6 steps given in this link

When I then make test_install, i get this error.

*Scanning dependencies of target test_install*
*[100%] Testing the installation using the C++ solverdummy*
*CMake Error: The source directory "/home/user/Softwares/precice-2.0.1/TestInstall" does not appear to contain CMakeLists.txt.*

The TestInstall folder is empty though?
When I copied CMakeLists.txt to TestInstall, it couldn’t find other files, which is expected.
Clearly, I am doing something incorrect here. What am I missing?
Any help is very much appreciated.

Thanks,
T

Hi @Titan!

Two packages fail when you run the tests.

  • precice.action: Here, I suspect that something is wrong with your Python environment. This means you cannnot use Python actions. This is a highly optional feature. You could just ignore this or if you want to debug it check to which Python version preCICE links and which Python is used at runtime. They need to be consistent.
  • precice.com.mpiports: This is most probably a known problem. OpenMPI does not support some of the features we need for communication (though they are in the standard, of course). This, however, does not mean that you cannot use parallel coupling. You just need to use TCP/IP sockets for the communication
<m2n:sockets ...

For 99,9% of all cases, there is no visible difference in performance.

Last, the installation problem. Have you make install?

Thanks very much for the reply @uekerman

Yes, make install was compiled. Attached is the log file. log_make_install.txt (4.3 KB)
To me, everything in this log looks fine. Hence, it is unclear why make test install have issues. By the way, TestInstall directory is empty. But make test install complains if there is no CMakeLists.txt file in TestInstall folder. When I copy CMakeLists.txt to this folder, the testing fails. Here is the log file log_make_testinstall.txt (1.8 KB) Am I missing something obvious here? Any help is sincerely appreciated.

With regards to the two clarifications you made on python and mpiports, I will look into it once the installation is done successfully. I guess these should not be hindrance for make install. Correct?

Hi there @Titan,

Let me clarify a few things regarding the make test_install for future reference:

  • The source dir is the directory where the source of precice resided. It is root of the repository.
  • The binary dir is the directory where you call cmake from. This is where the configuration given to cmake will be saved and tests will be registered (peek into the CTestTestfile.cmake).
    This separation allows you to create multiple build configurations in different folders.
    It is possible to use source dir = binary dir but we actively discourage it.
  • The install prefix is configured with cmake via CMAKE_INSTALL_PREFIX and define where make install will copy the files too.
  • The solverdummy sources reside in <source dir>/examples/solverdummies/cpp

When executing make test_install:

  1. CMake uses the working directory <binary dir>/TestInstall
  2. It configures the solverdummy as a cmake project inside <binary dir>/TestInstall so that:
    • Its source dir is the directory of the solverdummy sources above
    • Its binary dir is the working directory being <binary dir>/Testinstall
    • The option -Dprecice_DIR points to <prefix>/lib/cmake/precice where the preciceConfig.cmake will be installed.
  3. Builds the solverdummy.
  4. Runs preconfigured tests of the solverdummy.

Thus in general:

  1. The directory <binary dir>/TestInstall should be empty as it will be populated by the CMake invocation of the test.
  2. You need to run make test_install inside the binary dir of preCICE just like make install.

Regarding your installation:

  1. According to the logs you send us, it looks like you configured the preCICE build in the source tree binary dir = source dir. Apart from it being considered bad practice, we do not actively test nor support this scenario.
  2. According to the following error message, running test_install confuses the binary directory with the source directory when configuring the solverdummy. This should not be the case.
    CMake Error: The source directory “/home/user/Softwares/precice-2.0.1/TestInstall” does not appear to contain CMakeLists.txt.*
    

In order to debug what is going on, please

  1. provide us the console output when configuring preCICE with CMake
  2. provide us the CMakeCache.txt located in the binary dir.
  3. try to configure preCICE in a separate directory, following the steps in the wiki.
  4. configure and build the solverdummy manual by running the following commands:
     cd /home/user/Softwares/precice-2.0.1/TestInstall
     cmake -Dprecice_DIR=/home/user/Softwares/precice-2.0.1/precice-install/lib/cmake/precice /home/user/Softwares/precice-2.0.1/examples/solverdummies/cpp
     cmake --build .
     ctest -V
    

Hi @fsimonis,

Thanks very much for your very detailed reply. I deleted my previous directories and installed everything again following exactly all the steps in Wiki as well as your suggestions. I get the same error message for make test_install. Attached are the requested files that might help in debugging
log_cmakeInBuild.txt (6.5 KB) CMakeCache.txt (36.7 KB)

As per 4th suggestion in debugging, I configured and build solverdummy manually. This went absolutely fine.

I am curious to know what exactly is going wrong in make test_install when all steps (to the best of my understanding) seems correct.

Thanks,
T

@Titan I am not sure I understand what you are doing differently than in the wiki and why.

I would just do the following:

  1. Delete your complete /home/user/Softwares/precice-2.0.1/ directory and get preCICE again (2.0.2 is coming very soon, maybe today, but it doesn’t change anything for you)
  2. Create the build directory and get inside it: mkdir build && cd build
  3. Configure without the Python actions (unless you know why you need this feature, you don’t need it) and with a prefix that is outside the preCICE repository:
    cmake -DBUILD_SHARED_LIBS=ON -DPRECICE_PythonActions=OFF -DCMAKE_INSTALL_PREFIX=/home/user/Softwares/precice-inst/ ..
    
  4. Build: make -j $(nproc)
  5. Test: make test (indeed, the mpiports is expected to fail in your system, but don’t worry about this unles you know why you want this feature)
  6. Install: make install
  7. Add your precice_inst to your PKG_CONFIG_PATH by adding the following to your ~/.bashrc file: export PKG_CONFIG_PATH="/home/user/Softwares/precice-inst/lib/pkgconfig/:$PKG_CONFIG_PATH". Open a new terminal after this, or do a source ~/.bashrc.
  8. Test your installation using make test_install or continue directly with building a solver.

I may have mistyped some path (I have not tested this), but I think it should solve your problems.


All of this, of course, assumes that you cannot just install our binary packages (which come without PETSc, disabling another special feature that is often not needed) or build your own binary package and install it using APT. If you can install packages in your system, I would actually prefer the “home-built debian packages” solution, as you don’t need to change anything else and you can easily uninstall it using APT:

cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DPRECICE_PETScMapping=ON ..
make -j $(nprocs)
make test
make package
sudo apt install ./libprecicex.y.z.deb

# And then, one day, to remove preCICE:
sudo apt purge libprecicex.y.z

If the PetRBF tests fail, try building PETSc from source.

1 Like

@Titan did any of the above suggestions help? Did you manage to solve your issue (and how)?

Hello @Makis,

Thanks for your detailed reply and clear steps.
Building from source failed at test_install again.
Below are the steps I followed and attached is the log file that contains output from executing each of those steps (except for exporting paths), but separated by $ sign for clarity allSteps.log (30.4 KB) . This is for reference in case someone encounters similar issue.

  1. mkdir build && cd build
  2. export correct paths for petsc
  3. cmake -DBUILD_SHARED_LIBS=ON -DPRECICE_PythonActions=OFF -DCMAKE_INSTALL_PREFIX=/home/user/Softwares/preCICE/precice-install/ …
  4. make -j 8 > log.make 2>&1
  5. make test > log.maketest 2>&1
  6. make install > log.makeinstall 2>&1
  7. export path for PKG_CONFIG_PATH
  8. make test_install
    Except for the last step, log file shows successful build for all the previous steps. I couldn’t understand what am I missing for the last step to fail.

Then, followed your second suggestion which is to build my own binary packages and install it using apt. The installation seem to be fine so far. Need to check by running some tutorials.

@Titan I am happy that building a Debian package and installing it worked. This is definitely a prefered solution.

Regarding your make test_install issue: What does your TestInstall directory contain? For me it exists but it is empty, and it gets populated when I run make test_install. I could imagine this being an actual issue, however.

Yes @Makis. The TestInstall directory is empty in my case too. However, make test_install complains "CMake Error: The source directory “/home/user/Softwares/preCICE/precice-2.0.2/build/TestInstall” does not appear to contain CMakeLists.txt’’. Note that I am executing this in the binary directory itself like all other previous make.

Since I installed precice by building a Debian package, I am confused with regards to the pkg config paths as we need these for adapters. From this link https://github.com/precice/precice/wiki/Linking-to-preCICE#linking-from-make-or-other-scripts, I understand that below two commands should return respective paths.
pkg-config --cflags libprecice
pkg-config --libs libprecice
In my case, I find libprecice.pc in /usr/lib/x86_64-linux-gnu/pkfconfig and Solver related files in /usr/include/precice. What should be pkg config path set to? I am afraid I am asking more questions which I do not want to!

T

In my case, I find libprecice.pc in /usr/lib/x86_64-linux-gnu/pkfconfig and Solver related files in /usr/include/precice.

That’s correct!

What should be pkg config path set to?

When installing a Debian package you get libprecice.pc in a directory already known by pkg-config, so you don’t need to set anything else.

Please note that pkg-config --cflags --libs libprecice will hide the system paths, as they are already known by the compiler.

@Titan @Makis I found the problem!

I mistakenly used command line arguments to specify the source -S and the binary directory -B, which were introduced in CMake version 3.13, thus violating our required version 3.10.

You can apply the following patch to the source to make it work correctly:

diff --git a/cmake/TestInstall.cmake b/cmake/TestInstall.cmake
index d0743004..418b96e1 100644
--- a/cmake/TestInstall.cmake
+++ b/cmake/TestInstall.cmake
@@ -7,7 +7,7 @@ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/TestInstall)
 add_custom_target(test_install
   COMMAND ${CMAKE_COMMAND} -E remove -f ${CMAKE_CURRENT_BINARY_DIR}/TestInstall/CMakeCache.txt
   COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_BINARY_DIR}/TestInstall/CMakeFiles
-  COMMAND ${CMAKE_COMMAND} -Dprecice_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/precice -S ${preCICE_SOURCE_DIR}/examples/solverdummies/cpp -B ${CMAKE_CURRENT_BINARY_DIR}/TestInstall
+  COMMAND ${CMAKE_COMMAND} -Dprecice_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/precice ${preCICE_SOURCE_DIR}/examples/solverdummies/cpp
   COMMAND ${CMAKE_COMMAND} --build . --target all
   COMMAND ${CMAKE_CTEST_COMMAND} -V
   WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/TestInstall

I am sorry for the inconvenience.

1 Like

@Makis - thank you very much for the quick clarification.

@fsimonis - thanks for identifying the problem. that’s really fantastic. As you folks have figured out by now that i am a newbie here, what exactly one has to do to apply the patch during precice installation process? I mean at what stage in the 8 steps that @Makis mentioned in the above step?

what exactly one has to do to apply the patch during precice installation process? I mean at what stage in the 8 steps that @MakisH mentioned in the above step?

Since we identified the issue, you don’t really need to test it right now. But if you want, just edit your CMakeLists.txt before running cmake (e.g. after step 2 above). Preferably remove first your CMakeCache.txt.

I see. Thanks for that clarification. I will stick to my debian build for now and get going with tutorials. Thanks very much for all your support folks :slight_smile:

1 Like

Hello
I am attempting to install preCICE on my WSL.
I was trying to follow this procedure that @Makis provided but when I tried to run “sudo make -j 6”, it gave me the following:
~/precice/precice-2.3.0$ sudo make -j 6
– Found Git: /usr/bin/git (found version “2.25.1”)
– Revision status: Detection failed
[ 0%] Built target GitRevision
[ 61%] Built target precice
[ 61%] Built target binprecice
[100%] Built target testprecice

For step 3, I ran the following:
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/precice -DPRECICE_PETScMapping=OFF -DPRECICE_PythonActions=OFF …

Would appreciate y’all’s help

Hi @mishal49 :wave:

That looks correct. It seems you built preCICE successfully.
Anything that does not work?

Please open a new topic for every real new problem. I have the feeling your situation is not really connected to this topic.

Benjamin

1 Like

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