Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 32 additions & 2 deletions easybuild/easyblocks/p/petsc.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ def extra_options():
],
'download_deps_static': [[], "Dependencies that should be downloaded and installed static", CUSTOM],
'download_deps_shared': [[], "Dependencies that should be downloaded and installed shared", CUSTOM],
'download_deps': [[], "Dependencies that should be downloaded and installed", CUSTOM]
'download_deps': [[], "Dependencies that should be downloaded and installed", CUSTOM],
'scalar_type': ['real', "PETSc scalar type", CUSTOM],
'precision': ['double', "PETSc precision", CUSTOM],
'complex_support': [False, "Enable complex PETSc", CUSTOM],
}
return ConfigureMake.extra_options(extra_vars)

Expand Down Expand Up @@ -199,6 +202,29 @@ def configure_step(self):
self.cfg.update('configopts', '--with-pic=%d' % self.toolchain.options['pic'])
self.cfg.update('configopts', '--with-x=0 --with-windows-graphics=0')

# -----------------------------
# PETSc scientific configuration
# -----------------------------

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

blank line contains whitespace

scalar = self.cfg.get('scalar_type')
precision = self.cfg.get('precision')

if scalar not in ['real', 'complex']:
raise EasyBuildError(f"Invalid scalar_type: {scalar}")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

blank line contains whitespace

if precision not in ['single', 'double']:
raise EasyBuildError(f"Invalid precision: {precision}")

self.cfg.update(
'configopts',
f'--with-scalar-type={scalar}'
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

blank line contains whitespace

self.cfg.update(
'configopts',
f'--with-precision={precision}'
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace


# PAPI support
if self.cfg['with_papi']:
papi_inc = self.cfg['papi_inc']
Expand Down Expand Up @@ -228,7 +254,11 @@ def configure_step(self):
self.cfg.update('configopts', '%s=1' % with_mpi4py_opt)

# FFTW, ScaLAPACK
deps = ["FFTW", "ScaLAPACK"]
if precision == 'single':

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

trailing whitespace

deps=["ScaLAPACK"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

missing whitespace around operator

else:
deps = ["FFTW", "ScaLAPACK"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

blank line contains whitespace

for dep in deps:
libdir = os.getenv('%s_LIB_DIR' % dep.upper())
libs = os.getenv('%s_STATIC_LIBS' % dep.upper())
Expand Down
Loading