Skip to content

netlib-lapack: Permit package to build with clang+xlf compiler combination#8394

Closed
djfitzgerald wants to merge 11 commits intospack:developfrom
serbanmaerean:fix-ibm-clang/netlib-lapack-2
Closed

netlib-lapack: Permit package to build with clang+xlf compiler combination#8394
djfitzgerald wants to merge 11 commits intospack:developfrom
serbanmaerean:fix-ibm-clang/netlib-lapack-2

Conversation

@djfitzgerald
Copy link
Copy Markdown
Contributor

@djfitzgerald djfitzgerald commented Jun 5, 2018

Modified netlib-lapack to allow it to build using the llvm compiler suite with IBM xlf for the Fortran compiler. Related to #8311, #8388, #8389, #8391, #8392, #8393.

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:')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it break the build with GCC or Clang+gfortran?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can try building without this PR, and if’s broken, then most likely it was so already

Copy link
Copy Markdown
Contributor Author

@djfitzgerald djfitzgerald Jun 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davydden I'm not sure why it was breaking before, but applying my patch over a clean Spack installation and its working now.

davydden
davydden previously approved these changes Jun 6, 2018
@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@adamjstewart @alalazo -- would either of you be willing to merge this PR?

@adamjstewart
Copy link
Copy Markdown
Member

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'):
Copy link
Copy Markdown
Member

@davydden davydden Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@davydden Could you suggest anyone that knows about Fortran and who might be a good candidate for a reviewer?

@davydden
Copy link
Copy Markdown
Member

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 ).

@davydden davydden dismissed their stale review June 12, 2018 17:03

On the second look, i think changes might break XL setup for other users

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@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").

Copy link
Copy Markdown
Member

@davydden davydden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM modulo minor comments

cmake_args.extend(['-DCBLAS=OFF'])
cmake_args.extend(['-DLAPACKE:BOOL=OFF'])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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':
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for clarity, please make it elif. I would move compiler.name part first so it fits better the previous if.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wanted to explicitly move out the portion of the patch that could apply in more than just the IBM XL case.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, if you envision this to be useful later on. Just from this PR alone that is not obvious. Thus my comment.

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@davydden Ready for re-review

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@adamjstewart @alalazo @tgamblin -- would any of you be willing to merge this PR?

@tgamblin
Copy link
Copy Markdown
Member

@djfitzgerald: looks like flake8 checks are failing here.

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@tgamblin Hopefully my latest updates fix those flake8 failures. Checks are running now.

@davydden
Copy link
Copy Markdown
Member

@djfitzgerald

var/spack/repos/builtin/packages/netlib-lapack/package.py:162: [E125] continuation line with same indent as next logical line

you can also run checks locally: spack flake8.

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@davydden Thanks for the tip. It should be all fixed now.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Feb 12, 2019

@djfitzgerald Care to rebase? @tgamblin @davydden Any reason why this was not merged?

@djfitzgerald
Copy link
Copy Markdown
Contributor Author

@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.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 18, 2019

Duplicate of #8311

@alalazo alalazo marked this as a duplicate of #8311 Nov 18, 2019
@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 18, 2019

Closing as a duplicate

@alalazo alalazo closed this Nov 18, 2019
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.

6 participants