Fix scalapack build error (#19824)

This commit is contained in:
Jean-Paul Pelteret 2020-11-12 15:55:58 +01:00 committed by GitHub
parent a99cc0fac0
commit 821b195ba4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -73,11 +73,22 @@ def cmake_args(self):
'-DBLAS_LIBRARIES=%s' % (blas.joined(';'))
])
c_flags = []
if '+pic' in spec:
options.extend([
"-DCMAKE_C_FLAGS=%s" % self.compiler.cc_pic_flag,
c_flags.append(self.compiler.cc_pic_flag)
options.append(
"-DCMAKE_Fortran_FLAGS=%s" % self.compiler.fc_pic_flag
])
)
# Work around errors of the form:
# error: implicit declaration of function 'BI_smvcopy' is
# invalid in C99 [-Werror,-Wimplicit-function-declaration]
if spec.satisfies('%clang') or spec.satisfies('%apple-clang'):
c_flags.append('-Wno-error=implicit-function-declaration')
options.append(
self.define('CMAKE_C_FLAGS', ' '.join(c_flags))
)
return options