rabauke / trng4

state of the art C++ pseudo-random number generator library for sequential and parallel Monte Carlo simulations
https://www.numbercrunch.de/trng/
BSD 3-Clause "New" or "Revised" License
120 stars 21 forks source link

Add option to skip deprecated MPICXX bindings #15

Closed wenyan4work closed 4 years ago

wenyan4work commented 4 years ago

First thanks a lot for this very useful library!

In many recent versions of mpi libraries the MPICXX binding has been removed (MPICXX refers to the MPI-2 C++ API that was removed again in MPI-3). This gives some compilation problems of the mpi examples in the example folder.

I suggest a quick fix: Change the following line in examples/CMakeLists.txt if (MPI_FOUND) to if (MPI_MPICXX_FOUND)

Then the user can define a macro MPI_CXX_SKIP_MPICXX=ON during the cmake phase to skip the compilation of these mpi examples if the mpicxx binding has been removed from their compilers.

rabauke commented 4 years ago

Thanks for drawing my attention to this issue. I was aware of the fact that the C++ MPI bindings have been depreciated and more recently removed from the MPI standard. I expected, however, that most MPI libraries would continue to provide the C++ bindings (without accounting for newer MPI features of course).

To fix this issue I revised the examples to employ the C language bindings. I think this approach is better than following your suggestion to adjust the cmake configuration.