Skip to content
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

Compilation error on mingW64 #75

Open
Plume-SPH opened this issue Sep 17, 2023 · 1 comment
Open

Compilation error on mingW64 #75

Plume-SPH opened this issue Sep 17, 2023 · 1 comment

Comments

@Plume-SPH
Copy link

Plume-SPH commented Sep 17, 2023

Hi, when I try to compile on mingW64, I am seeing the following error:
cd C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/build/programs && C:/msys64/mingw64/bin/cc.exe @CMakeFiles/gpmetis.dir/includes_C.rsp -std=c99 -fno-strict-aliasing -march=native -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label -DNDEBUG -DNDEBUG2 -O3 -MD -MT programs/CMakeFiles/gpmetis.dir/gpmetis.c.obj -MF CMakeFiles/gpmetis.dir/gpmetis.c.obj.d -o CMakeFiles/gpmetis.dir/gpmetis.c.obj -c C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/programs/gpmetis.c
C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/programs/gpmetis.c: In function 'GPReportResults':
C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/programs/gpmetis.c:244:19: error: storage size of 'usage' isn't known
244 | struct rusage usage;
| ^~~~~
C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/programs/gpmetis.c:245:5: error: implicit declaration of function 'getrusage' [-Werror=implicit-function-declaration]
245 | getrusage(RUSAGE_SELF, &usage);
| ^~~~~~~~~
C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/programs/gpmetis.c:245:15: error: 'RUSAGE_SELF' undeclared (first use in this function)
245 | getrusage(RUSAGE_SELF, &usage);
| ^~~~~~~~~~~
C:/Users/hitca/Documents/New_pre/code/dependencies-new/METIS/programs/gpmetis.c:245:15: note: each undeclared identifier is reported only once for each function it appears

This seems due to METIS is using getrusage() which is only available on Linux? Could you give some advice on how to walk around this issue?

@gfaster
Copy link

gfaster commented Sep 18, 2023

A quick solution would be to just change the ifdef flags in those files.

At mpmetis.c:191, gpmetis.c:242, and ndmetis.c:175, change from

#ifndef MACOS

to

#if !defined(MACOS) && !defined(WIN32) && !defined(__MINGW32__)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants