-
Notifications
You must be signed in to change notification settings - Fork 2.4k
metis doesn't always respect cflags #6839
Copy link
Copy link
Closed
Description
Summary
The current recipe for metis allows conflicting optimization levels to appear on the compile line in a way that isn't expected. For example: spack -d install metis build_type=RelWithDebInfo cflags="-O3 -g" doesn't compile with the expected CFLAGS. I expect to see compile lines similar to this:
/usr/bin/gcc -O3 -g <include directives and defines> -o file.o -c file.c
Actual Result
/usr/bin/gcc -O3 -g <include directives and defines> -O3 -O2 -g -DDNDEBUG -o file.o -c file.c
Because -O2 is listed after -O3 the optimization is not what I expect. I believe the -O2 -g -DDNDEBUG flags are inserted by CMake as they are the default CMAKE_C__FLAGS_RELWITHDEBINFO values for gcc.
I'm actually not sure where that second -O3 is coming from.
Possible solution
If SPACK_CFLAGS is set in the build environment, then zero-out the cmake defaulted CMAKE_C_FLAGS_XXX variables.
I have a patch incoming (#6840) to fix this problem (if it passes review).
Related Issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels