WIP: Help the parmetis recipe respect spack's cflags and cxxflags.#6860
Closed
KineticTheory wants to merge 1 commit intospack:developfrom
Closed
WIP: Help the parmetis recipe respect spack's cflags and cxxflags.#6860KineticTheory wants to merge 1 commit intospack:developfrom
KineticTheory wants to merge 1 commit intospack:developfrom
Conversation
Background is provided in spack#6858. Essentially, this issue is that the command: ``` spack -d install parmetis%gcc` cflags="-O3 -march=native" \ cxxflags="-O3 -march=native" ``` results in compile commands of the form: `gcc -O3 -march=native <include directives> -O2 -g -o file.o -c file.c` That is, the requested optimization level is ignored because CMake's initial compiler flags for gcc are _appended_ to the compile line. To avoid this behavior, the initial `CMAKE_C_FLAGS` need to be disabled (set to an empty string). While I can do this locally for _parmetis_, it might make more sense to implement a general fix for spack's `CMakePackage` class, possibly by modifying the `flag_handler` functions (but I'm not sure how to implement this change).
Member
|
I agree that it would be good to have CMakePackage fix. |
Contributor
Author
Contributor
Author
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background is provided in #6858. Essentially, this issue is that the command:
results in compile commands of the form:
gcc -O3 -march=native <include directives> -O2 -g -o file.o -c file.cThat is, the requested optimization level is ignored because CMake's initial compiler flags for gcc are appended to the compile line. To avoid this behavior, the initial
CMAKE_C_FLAGSneed to be disabled (set to an empty string).While I can do this locally for parmetis, it might make more sense to implement a general fix for spack's
CMakePackageclass, possibly by modifying theflag_handlerfunctions (but I'm not sure how to implement this change).