OSGeo / grass-addons

GRASS GIS Addons Repository
https://grass.osgeo.org/grass-stable/manuals/addons/
GNU General Public License v2.0
101 stars 152 forks source link

[Bug] i.vi.mpi doesn't compile on Windows #841

Open HuidaeCho opened 1 year ago

HuidaeCho commented 1 year ago

Name of the addon i.vi.mpi

Describe the bug Compiling this module using mingw-w64-x86_64-msmpi fails with this error:

test -d OBJ.x86_64-w64-mingw32 || mkdir -p OBJ.x86_64-w64-mingw32
mpicc  -I/c/OSGeo4W/include -Dsrandom=srand -Drandom=rand -I/c/OSGeo4W/include -I/c/usr/local/src/grass/dist.x86_64-w64-mingw32/include -I/c/usr/local/src/grass/dist.x86_64-w64-mingw32/include  -D_FILE_OFFSET_BITS=64  -DPACKAGE=\""grassmods"\"   -I/c/usr/local/src/grass/dist.x86_64-w64-mingw32/include -I/c/usr/local/src/grass/dist.x86_64-w64-mingw32/include -DRELDIR=\"/c/usr/local/src/grass-addons/src/imagery/i.vi.mpi\" -o OBJ.x86_64-w64-mingw32/main.o -c main.c
main.c: In function 'main':
<command-line>: error: 'grassmods' undeclared (first use in this function)
C:/usr/local/src/grass/dist.x86_64-w64-mingw32/include/grass/glocale.h:10:26: note: in expansion of macro 'PACKAGE'
   10 | #define _(str) G_gettext(PACKAGE,(str))
      |                          ^~~~~~~
main.c:80:23: note: in expansion of macro '_'
   80 |         G_add_keyword(_("vegetation index"));
      |                       ^
<command-line>: note: each undeclared identifier is reported only once for each function it appears in
C:/usr/local/src/grass/dist.x86_64-w64-mingw32/include/grass/glocale.h:10:26: note: in expansion of macro 'PACKAGE'
   10 | #define _(str) G_gettext(PACKAGE,(str))
      |                          ^~~~~~~
main.c:80:23: note: in expansion of macro '_'
   80 |         G_add_keyword(_("vegetation index"));
      |                       ^
make: *** [/c/usr/local/src/grass/include/Make/Compile.make:32: OBJ.x86_64-w64-mingw32/main.o] Error 1

To Reproduce Steps to reproduce the behavior:

  1. Install https://packages.msys2.org/package/mingw-w64-x86_64-msmpi
  2. Go to src/imagery/i.vi.mpi
  3. Compile
  4. See error

Expected behavior No errors

Screenshots If applicable, add screenshots to help explain your problem.

System description (please complete the following information):