-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix METIS compilation error on MinGW (gettimeofday issue) #490
Conversation
This commit resolves the compilation error in the METIS library when building Elmer FEM on Windows using MinGW. The error was caused by the use of the POSIX function \`gettimeofday\`, which is not directly available in Windows. Changes made: 1. Modified \`elmergrid/src/metis-5.1.0/GKlib/gk_arch.h\` to define \`gettimeofday\` as \`mingw_gettimeofday\` when compiling with MinGW. 2. Updated \`elmergrid/src/metis-5.1.0/GKlib/timers.c\` to include \`gk_arch.h\`. These changes allow the METIS library to compile successfully on Windows with MinGW, resolving the \"implicit declaration of function 'gettimeofday'\" error. Fixes #489
Thank you for looking into this and proposing a fix. Adding
I'm not sure if you should call |
As I noted in #489, this is likely not MinGW-specific. Instead, it is probably because the latest versions of GCC and LLVM default to C17 where implicit function declarations are an error. (These compilers emitted a warning in earlier versions for that.) The issue should indeed be fixed by including |
Dear @mmuetzel , Thanks for the kind support. Checking out the latest commits on the repo Dear @tzwinger , please feel free to reject this PR. |
@Foadsf: No worries. |
@mmuetzel thanks for the response. It is not about secrecy 😅 but that there are others on Discord who, for whatever reason, do not use GitHub. Also to avoid bloating the discussions here on GitHub. 🖖 |
OK, I then hereby close this PR, as it has been resolved with another code change |
This commit resolves the compilation error in the METIS library when building Elmer FEM on Windows using MinGW. The error was caused by the use of the POSIX function
gettimeofday
, which is not directly available in Windows.Changes made:
elmergrid/src/metis-5.1.0/GKlib/gk_arch.h
to definegettimeofday
asmingw_gettimeofday
when compiling with MinGW.elmergrid/src/metis-5.1.0/GKlib/timers.c
to includegk_arch.h
.These changes allow the METIS library to compile successfully on Windows with MinGW, resolving the "implicit declaration of function 'gettimeofday'" error.
Fixes #489