netlib-lapack: Permit package to build with clang+xlf compiler combination#8394
netlib-lapack: Permit package to build with clang+xlf compiler combination#8394djfitzgerald wants to merge 11 commits intospack:developfrom
Conversation
make it build with clang+xlf.
This change requires another change to the compilers/clang.py file to use the IBM XL Fortran compiler on CORAL systems.
|
|
||
| patch('ibm-xl.patch', when='@3.7: %xl') | ||
| patch('ibm-xl.patch', when='@3.7: %xl_r') | ||
| patch('ibm-xl.patch', when='@3.7:') |
There was a problem hiding this comment.
Does it break the build with GCC or Clang+gfortran?
There was a problem hiding this comment.
@davydden This should not, as the patch applies to a portion of code that is only run when cmake detects that the Fortran compiler is an IBM XL or VisualAge compiler. I did verify that it did not break the build with gcc. However, the clang+gfortran build appears to be broken. It may already have been broken on Power, but I'll poke at it for a bit.
There was a problem hiding this comment.
You can try building without this PR, and if’s broken, then most likely it was so already
There was a problem hiding this comment.
@davydden I'm not sure why it was breaking before, but applying my patch over a clean Spack installation and its working now.
|
@adamjstewart @alalazo -- would either of you be willing to merge this PR? |
|
I don't really know anything about Fortran, Clang, or Xl, so this is outside my area of expertise... |
| '-DCMAKE_Fortran_FLAGS=%s' % ( | ||
| ' '.join(self.spec.compiler_flags['fflags'])), | ||
| ]) | ||
| if spec.satisfies('arch=linux-rhel7-ppc64le'): |
There was a problem hiding this comment.
Surely XL are not only used here? I think u need to rework this if.
Ps.i don’t know anything about XL either.
EDIT:
I would keep
if self.compiler.name == 'xl' or self.compiler.name == 'xl_r':
and add your part
elif spec.satisfies('arch=linux-rhel7-ppc64le'):
At least you would not break the setup for somebody who uses xl directly, not as a mixture with clang.
|
@davydden Could you suggest anyone that knows about Fortran and who might be a good candidate for a reviewer? |
maybe try asking in Slack channel ? @tgamblin merged in the past some PR related to XL compilers (at least judging by history ). |
On the second look, i think changes might break XL setup for other users
|
@davydden Please re-review. I addressed the changes that you had requested before (although now appear to have dismissed), although this new code won't have an effect until #8389 is merged. This change makes it so that xlf handling is done under clang only under the conditions where clang would be using xlf (that is to say, on Power64 Linux and when spack_f77 is "xlf_r"). |
| cmake_args.extend(['-DCBLAS=OFF']) | ||
| cmake_args.extend(['-DLAPACKE:BOOL=OFF']) | ||
|
|
||
There was a problem hiding this comment.
please remove white space, falke8 will complain
| ' '.join(self.spec.compiler_flags['fflags'])), | ||
| ]) | ||
|
|
||
| if spec.satisfies('arch=linux-rhel7-ppc64le') and self.compiler.name == 'clang': |
There was a problem hiding this comment.
for clarity, please make it elif. I would move compiler.name part first so it fits better the previous if.
There was a problem hiding this comment.
I feel that elif is inappropriate here (none of the other compiler checks around this line are in elif cases), but will make the other changes.
There was a problem hiding this comment.
I feel that elif is inappropriate here (none of the other compiler checks around this line are in elif cases)
that's ok with me, that was just a suggestion.
| +++ b/CBLAS/CMakeLists.txt | ||
| @@ -12,8 +12,8 @@ | ||
| SYMBOL_NAMESPACE "F77_") | ||
| if(NOT FortranCInterface_GLOBAL_FOUND OR NOT FortranCInterface_MODULE_FOUND) |
There was a problem hiding this comment.
btw, any reason to split this part of the patch into a separate cblas-cmake-fix.patch? The stand-alone part looks identical to this one. In other words, if you don't touch patches at all and only change the condition
patch('ibm-xl.patch', when='@3.7:')
you should get the same end result, right?
There was a problem hiding this comment.
We wanted to explicitly move out the portion of the patch that could apply in more than just the IBM XL case.
There was a problem hiding this comment.
ok, if you envision this to be useful later on. Just from this PR alone that is not obvious. Thus my comment.
|
@davydden Ready for re-review |
|
@adamjstewart @alalazo @tgamblin -- would any of you be willing to merge this PR? |
|
@djfitzgerald: looks like flake8 checks are failing here. |
|
@tgamblin Hopefully my latest updates fix those flake8 failures. Checks are running now. |
you can also run checks locally: |
|
@davydden Thanks for the tip. It should be all fixed now. |
|
@djfitzgerald Care to rebase? @tgamblin @davydden Any reason why this was not merged? |
|
@alalazo I can take a stab at it, but it will have to wait until early March. I also haven't touched this stuff in almost 9 months, so I'll need to remember what the heck it was I was actually doing. |
|
Duplicate of #8311 |
|
Closing as a duplicate |
Modified
netlib-lapackto allow it to build using the llvm compiler suite with IBM xlf for the Fortran compiler. Related to #8311, #8388, #8389, #8391, #8392, #8393.