mpitest now gives a warning instead of a compilation failure if MPI is not enabled

This commit is contained in:
jpekkila
2020-03-26 15:31:29 +02:00
parent 08f567619a
commit 5a898b8e95

View File

@@ -22,6 +22,8 @@
#include "astaroth.h" #include "astaroth.h"
#include "astaroth_utils.h" #include "astaroth_utils.h"
#if AC_MPI_ENABLED
#include <mpi.h> #include <mpi.h>
int int
@@ -67,3 +69,12 @@ main(void)
MPI_Finalize(); MPI_Finalize();
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
#else
int
main(void)
{
printf("The library was built without MPI support, cannot run mpitest. Rebuild Astaroth with cmake -DMPI_ENABLED=ON .. to enable.\n");
return EXIT_FAILURE;
}
#endif // AC_MPI_ENABLES