Skip to content

WIP: Help the parmetis recipe respect spack's cflags and cxxflags.#6860

Closed
KineticTheory wants to merge 1 commit intospack:developfrom
KineticTheory:parmetis_respect_cflags
Closed

WIP: Help the parmetis recipe respect spack's cflags and cxxflags.#6860
KineticTheory wants to merge 1 commit intospack:developfrom
KineticTheory:parmetis_respect_cflags

Conversation

@KineticTheory
Copy link
Copy Markdown
Contributor

Background is provided in #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).

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).
@davydden
Copy link
Copy Markdown
Member

davydden commented Jan 9, 2018

I agree that it would be good to have CMakePackage fix.

@KineticTheory
Copy link
Copy Markdown
Contributor Author

I'm marking this as WIP as it might be replaced by #6960 and #6961.

@KineticTheory KineticTheory changed the title Help the parmetis recipe respect spack's cflags and cxxflags. WIP: Help the parmetis recipe respect spack's cflags and cxxflags. Jan 17, 2018
@KineticTheory
Copy link
Copy Markdown
Contributor Author

@KineticTheory KineticTheory deleted the parmetis_respect_cflags branch April 2, 2019 21:28
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

Successfully merging this pull request may close these issues.

2 participants