-
Notifications
You must be signed in to change notification settings - Fork 313
DRAFT: Enable new optional flags for petsc single double precisions #4139
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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) | ||
|
|
||
|
|
@@ -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 | ||
| # ----------------------------- | ||
|
|
||
| scalar = self.cfg.get('scalar_type') | ||
| precision = self.cfg.get('precision') | ||
|
|
||
| if scalar not in ['real', 'complex']: | ||
| raise EasyBuildError(f"Invalid scalar_type: {scalar}") | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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}' | ||
| ) | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blank line contains whitespace |
||
| self.cfg.update( | ||
| 'configopts', | ||
| f'--with-precision={precision}' | ||
| ) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'] | ||
|
|
@@ -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': | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trailing whitespace |
||
| deps=["ScaLAPACK"] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing whitespace around operator |
||
| else: | ||
| deps = ["FFTW", "ScaLAPACK"] | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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()) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blank line contains whitespace