Add MPI_INCLUDED macro if compiled with MPI and netCDF

Thanks to Dmitry Mikushin for reporting this bug
parent 60d0d798
...@@ -273,6 +273,9 @@ if 'libSDLDir' in env: ...@@ -273,6 +273,9 @@ if 'libSDLDir' in env:
if env['writeNetCDF'] == True: if env['writeNetCDF'] == True:
env.Append(CPPDEFINES=['WRITENETCDF']) env.Append(CPPDEFINES=['WRITENETCDF'])
env.Append(LIBS=['netcdf']) env.Append(LIBS=['netcdf'])
# define MPI_INCLUDED, if writeNetCDF is used together with MPI
if env['parallelization'] != 'none' and env['parallelization'] != 'cuda':
env.Append(CPPDEFINES=['MPI_INCLUDED'])
# set netCDF location # set netCDF location
if 'netCDFDir' in env: if 'netCDFDir' in env:
env.Append(CPPPATH=[env['netCDFDir']+'/include']) env.Append(CPPPATH=[env['netCDFDir']+'/include'])
......
...@@ -32,6 +32,12 @@ ...@@ -32,6 +32,12 @@
#include <cstring> #include <cstring>
#include <string> #include <string>
#include <vector> #include <vector>
// Needed for NetCDF
#ifdef USEMPI
#include <mpi.h>
#endif
#include <netcdf.h> #include <netcdf.h>
#include "writer/Writer.hh" #include "writer/Writer.hh"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment