-
Notifications
You must be signed in to change notification settings - Fork 58
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
sysdetect: fix bug where Makefile sets -ffree-form
everywhere
#147
sysdetect: fix bug where Makefile sets -ffree-form
everywhere
#147
Conversation
To fix ARM compiler builds, icl-utk-edu#108 added these lines to the `Makefile` for `sysdetect` tests: ```diff + FFLAGS += -ffree-form + ifeq ($(notdir $(F77)),gfortran) FFLAGS +=-ffree-form -ffree-line-length-none else ifeq ($(notdir $(F77)),flang) FFLAGS +=-ffree-form else ifneq ($(findstring $(notdir $(F77)), $(intel_compilers)),) FFLAGS +=-free else ifneq ($(findstring $(notdir $(F77)), $(cray_compilers)),) FFLAGS +=-ffree endif ``` but this adds `-ffree-form` to every compiler. This breaks [cray compiler builds for PAPI 7.1.0](https://gitlab.spack.io/spack/spack/-/jobs/9684882): ``` 1307 /home/gitlab-runner-protected-3/builds/Cj9btwqn/0/spack/spack/lib/ spack/env/cce/ftn -ffree-form -ffree -I../../.. -o query_device_si mple_f query_device_simple_f.F ../../../libpapi.a 1308 ftn-78 ftn: ERROR in command line 1309 The -f option has an invalid argument, "free-form". ``` You can see that CCE gets both `-ffree-form` and `-ffree` there. This patch removes the global `-ffree-form` and makes the flang condition above a bit more permissive, so that both `flang`, `armflang`, `amdflang`, or really anything ending in `flang` adds `-free-form`: ```diff FFLAGS +=-ffree-form -ffree-line-length-none - else ifeq ($(notdir $(F77)),flang) + else ifeq ($(patsubst %flang,,$(notdir $(F77))),) # compiler name ends with flang FFLAGS +=-ffree-form ``` This should fix the bug that icl-utk-edu#108 fixed and it should also work on other compilers.
The pipeline on spack/spack#41886, confirms this fixes the build for CCE (successful build is here: https://gitlab.spack.io/spack/spack/-/jobs/9685218). We don't currently test PAPI 7.1.0 with ARM compilers, so maybe @gcongiu can verify whether this fixes the issue he tried to solve in #108 -- I think it should. |
I'm not sure what to do with the CI failure here. But unfortunately making patch application idempotent can cause us to silently fail to apply patches (unix patch does not give you a way to differentiate between the two cases) so we had to revert: Any suggestions? |
Actually, looking at your CI, think I can fix this on the spack side if I just restrict the patch to 7.1.0. You’re building |
@tgamblin it will definitely be in the next release, but that will not necessarily be versioned as |
I should ask better questions. If I restrict the patch to 7.1.0, does that cover all the PAPIs we might see with the issue? |
@tgamblin if you restrict the patch to |
Ok, spack/spack#41892 restricts the patch to 7.1.0 so CI should pass. |
I've triggered a rerun of the papi-spack CI test. |
It is fixed! A holiday miracle! |
To fix ARM compiler builds, #108 added these lines to the
Makefile
forsysdetect
tests:but this adds
-ffree-form
to every compiler. This breaks cray compiler builds for PAPI 7.1.0:You can see that CCE gets both
-ffree-form
and-ffree
there.This patch removes the global
-ffree-form
and makes the flang condition above a bit more permissive, so that bothflang
,armflang
,amdflang
, or really anything ending inflang
adds-free-form
:This should fix the bug that #108 fixed and it should also work on other compilers.
Pull Request Description
Author Checklist
Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
Commits are self contained and only do one thing
Commits have a header of the form:
module: short description
Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
The PR needs to pass all the tests