I thought I am nearly successful in installing precice on ubuntu 18. The very final test did not pass Followed the instructions as per wiki.
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
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?
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.
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?
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?
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:
CMake uses the working directory <binary dir>/TestInstall
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.
Builds the solverdummy.
Runs preconfigured tests of the solverdummy.
Thus in general:
The directory <binary dir>/TestInstall should be empty as it will be populated by the CMake invocation of the test.
You need to run make test_install inside the binary dir of preCICE just like make install.
Regarding your installation:
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.
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
provide us the console output when configuring preCICE with CMake
provide us the CMakeCache.txt located in the binary dir.
try to configure preCICE in a separate directory, following the steps in the wiki.
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
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.
@Titan I am not sure I understand what you are doing differently than in the wiki and why.
I would just do the following:
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)
Create the build directory and get inside it: mkdir build && cd build
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:
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)
Install: make install
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.
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.
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.
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.
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!
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:
@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
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 …