Goddard-Fortran-Ecosystem / pFUnit

Parallel Fortran Unit Testing Framework
Other
172 stars 45 forks source link

Confusing ENABLE_MPI_F08 usage #366

Closed nasa-ceporter closed 2 years ago

nasa-ceporter commented 2 years ago

The new ENABLE_MPI_F08 appears to have confusing usage. cmake respects values of -DENABLE_MPI_F08=YES, -DENABLE_MPI_F08=TRUE, and -DENABLE_MPI_F08=1. All of the usages lead to a prompt from cmake informing the user that mpi_f08 is being enabled.

However, the variable PF_USE_MPI_F08 that is used as the argument for the preprocess directive in pf_mpi_defines.fh inherits the value provided by the user in src/pfunit/CMakeLists.txt

target_compile_definitions (pfunit-mpi-defines INTERFACE PF_USE_MPI_F08=${ENABLE_MPI_F08})

The only option the user specifies that actually chooses the correct preprocessor branch is -DENABLE_MPI_F08=1. All other options appear to define the variables as integers.

tclune commented 2 years ago

Thank you for reporting this. I'll try to take a look soon. Just back from 2 weeks travel (and caught COVID at the end to boot).

tclune commented 2 years ago

Will roll out a new release (v4.4.2) that fixes this shortly.