damonge / CoLoRe

CoLoRe - Cosmological Lofty Realizations
GNU General Public License v3.0
17 stars 13 forks source link

Building without MPI or OMP does not work #1

Closed dkirkby closed 8 years ago

dkirkby commented 8 years ago

If I set USE_OMP and USE_MPI both to no in the Makefile, the build fails with:

gcc -Wall -O3 -D_LONGIDS -D_DEBUG -D_SPREC -I./src    -c src/grid_tools.c -o src/grid_tools.o
src/grid_tools.c:126:3: warning: implicit declaration of function 'MPI_Allreduce' is invalid in C99
      [-Wimplicit-function-declaration]
  MPI_Allreduce(&(par->nsources_this),&(par->nsources_total),1,LINT_MPI,MPI_SUM,MPI_COMM_WORLD);
  ^
src/grid_tools.c:126:64: error: use of undeclared identifier 'LINT_MPI'
  MPI_Allreduce(&(par->nsources_this),&(par->nsources_total),1,LINT_MPI,MPI_SUM,MPI_COMM_WORLD);
                                                               ^
src/grid_tools.c:126:73: error: use of undeclared identifier 'MPI_SUM'
  MPI_Allreduce(&(par->nsources_this),&(par->nsources_total),1,LINT_MPI,MPI_SUM,MPI_COMM_WORLD);
                                                                        ^
src/grid_tools.c:126:81: error: use of undeclared identifier 'MPI_COMM_WORLD'
  MPI_Allreduce(&(par->nsources_this),&(par->nsources_total),1,LINT_MPI,MPI_SUM,MPI_COMM_WORLD);
                                                                                ^
1 warning and 3 errors generated.
make: *** [src/grid_tools.o] Error 1
dkirkby commented 8 years ago

After installing OpenMPI (so the headers with the undeclared identifiers are present), the build still fails with the same errors, so it looks like the necessary headers are only included when USE_MPI is enabled. Is there any scenario where it is possible to build the code with USE_MPI=no?

damonge commented 8 years ago

This should hopefully be fixed now. Sorry for that.