urbanjost / M_system

Call C system routines (mostly POSIX) from Fortran
The Unlicense
15 stars 2 forks source link

Cannot build on Windows -- no grp.h file #3

Closed Beliavsky closed 3 years ago

Beliavsky commented 3 years ago

I have gfortran and gcc installed on Windows. When I try to follow the gfortran instructions, I need to define

CC := gcc

Then I run make F90=gfortran gfortran and get the following error:

c:\fortran\public_domain\github\M_system\src>make F90=gfortran gfortran
makefile:125: warning: overriding recipe for target '.f90.o'
makefile:122: warning: ignoring old recipe for target '.f90.o'
gcc -O   -c -o C-M_system.o C-M_system.c
C-M_system.c:4:10: fatal error: grp.h: No such file or directory
    4 | #include <grp.h>
      |          ^~~~~~~
compilation terminated.
make: *** [<builtin>: C-M_system.o] Error 1
urbanjost commented 3 years ago

M_system requires a POSIX system. Windows is not POSIX-compliant so the file defining group-related information is not there. You would have to install a POSIX layer by installing something like CygWin or use the Linux interface available with Windows 10, or we would need to write a MSWindows wrapper from scratch to call the equivalent routines. So sorry, but in it's current state it would not work on a vanilla MSWindows environment.

Beliavsky commented 3 years ago

Thanks for the explanation. When I try building it on cygwin I get the same error. But I can use WSL as you mention.

urbanjost commented 3 years ago

I have used it on cygwin for years. I must have an optional package installed that supplies the file. I am not where I can check which package supplies the files put I will find that and add a fuller explanation of how to use it on a Windows system to the README.txt for the module.