-
-
Notifications
You must be signed in to change notification settings - Fork 272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDF5 1.12.1: Unable to compile the parallel version using CMake #833
Comments
The C++ libraries are no longer enabled by default and therefore CMake could not reconcile your CXX=g++ option when looking for MPI compilers. |
Ok. I have tried the following CMake command:
Unfortunately, I still got the same CMake Error. |
I haven't tried just using CC=gcc. I either leave it unset and use the CMake detected compiler or set CC=mpicc, the mpi compiler wrapper |
Also, when I use CC=mpicc, I add the following CMake command line define - MPI_C_COMPILER=mpicc |
Yes, that works. This will mean that everything will be built using the MPI compiler. Even targets which supposed to be compiled with only gcc without any MPI flags. I do not know if there are such targets in your build. If not, then using mpicc is a nice workaround for the problem. Furthermore, it may be worthwhile to mention this somewhere in the release note because it is different compared to the build of the parallel version of HDF5 1.12.0. |
You could try just the define MPI_C_COMPILER=mpicc? |
I have tried the all of the following options
Only the last one works for me. |
Thanks! Very useful information. Interesting that the key seems to be CC=mpicc. |
I have found the problem. In line 286 of the file ConfigureChecks.cmake
says you want to store the value 1 in the variable of the value of RUN_RESULT_VAR. This looks like a mistake to me. I think what you want to do is the following
Using this modification in building the parallel version of the library with CC=gcc solves the problem. Looking at the code, maybe your intention was to store the value 1 into the value of RETURN_VAR. In this case the line becomes
Again, I tested it and this also works. If you want, I can create a pull request for this bug fix. |
Yes I believe you have found the problem, this error was hidden until now in the Fortran configure. Allen |
See PR #843 |
Thanks. One question. How will this bug fix be distributed? I mean are you going to update the 1.12.1 release, create 1.12.2 release or some other method? |
We will include it in releases going forward. Given that CC=mpicc works correctly, I don't see a need for a patch. The end result is that the mpi compiler will be found and used for all compiles. |
Allen, I think we can close this issue or is there a special reason to keep it open? |
@jwsblokland - Just waiting for you to verify. |
Hello,
The other day I tried to compile the parallel version of the released HDF5 library 1.12.1 using CMake on Linux. Unfortunately, I got a strange CMake error from FindMPI.cmake about could not find MPI_C. Here is the CMake command I have used
and the resulting CMake error is
This command worked fine for version 1.12.0 using CMake version 3.18.4. I also tried using CMake version 3.14.0 which resulted in the same error.
I did some additional investigation and I noticed that you have introduced a compile+run test using a macro in ConfigureChecks.cmake (line 252 - 359). In this macro the function try_run() is used and when I commented out this function the CMake step runs fine. It was able to find the required MPI libraries. At this moment, it is unclear to me if you made a mistake in how to use the try_run() function or it is a bug in CMake itself.
The text was updated successfully, but these errors were encountered: