1 |
commit: 454de437bac0e12b75efa56e3b4d2bfced4ddf62 |
2 |
Author: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Nov 14 22:27:16 2019 +0000 |
4 |
Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 14 22:27:16 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=454de437 |
7 |
|
8 |
sci-mathematics/petsc: do not run mpiexec during configure |
9 |
|
10 |
Package-Manager: Portage-2.3.79, Repoman-2.3.18 |
11 |
Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org> |
12 |
|
13 |
.../files/petsc-3.12.1-do_not_run_mpiexec.patch | 32 ++++++++++++++++++++++ |
14 |
sci-mathematics/petsc/petsc-3.12.1.ebuild | 1 + |
15 |
2 files changed, 33 insertions(+) |
16 |
|
17 |
diff --git a/sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch b/sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..9c3d5047b0a |
20 |
--- /dev/null |
21 |
+++ b/sci-mathematics/petsc/files/petsc-3.12.1-do_not_run_mpiexec.patch |
22 |
@@ -0,0 +1,32 @@ |
23 |
+diff --git a/config/BuildSystem/config/packages/MPI.py b/config/BuildSystem/config/packages/MPI.py |
24 |
+index c85bb504..7720eba9 100644 |
25 |
+--- a/config/BuildSystem/config/packages/MPI.py |
26 |
++++ b/config/BuildSystem/config/packages/MPI.py |
27 |
+@@ -209,26 +209,11 @@ shared libraries and run with --known-mpi-shared-libraries=1') |
28 |
+ raise RuntimeError('Could not locate MPIEXEC - please specify --with-mpiexec option') |
29 |
+ # Support for spaces and () in executable names; also needs to handle optional arguments at the end |
30 |
+ # TODO: This support for spaces and () should be moved to core BuildSystem |
31 |
+- self.mpiexec = self.mpiexec.replace(' ', '\\ ').replace('(', '\\(').replace(')', '\\)').replace('\ -',' -') |
32 |
+- if (hasattr(self, 'ompi_major_version') and int(self.ompi_major_version) >= 3): |
33 |
+- (out, err, ret) = Configure.executeShellCommand(self.mpiexec+' -help all', checkCommand = noCheck, timeout = 10, log = self.log) |
34 |
+- if out.find('--oversubscribe') >=0: |
35 |
+- self.mpiexec = self.mpiexec + ' --oversubscribe' |
36 |
++ self.mpiexec = self.mpiexec + ' --oversubscribe' |
37 |
+ |
38 |
+ # using mpiexec environmental variables make sure mpiexec matches the MPI libraries and save the variables for testing in PetscInitialize() |
39 |
+ # the variable HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE is not currently used. PetscInitialize() can check the existence of the environmental variable to |
40 |
+ # determine if the program has been started with the correct mpiexec (will only be set for parallel runs so not clear how to check appropriately) |
41 |
+- (out, err, ret) = Configure.executeShellCommand(self.mpiexec+' -n 1 printenv', checkCommand = noCheck, timeout = 10, log = self.log) |
42 |
+- if ret: raise RuntimeError('Unable to run '+self.mpiexec+' with option "-n 1"\n'+err) |
43 |
+- if out.find('MPIR_CVAR_CH3') > -1: |
44 |
+- if hasattr(self,'ompi_major_version'): raise RuntimeError("Your libraries are from OpenMPI but it appears your mpiexec is from MPICH"); |
45 |
+- self.addDefine('HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE', 'MPIR_CVAR_CH3') |
46 |
+- elif out.find('MPIR_CVAR_CH3') > -1: |
47 |
+- if hasattr(self,'ompi_major_version'): raise RuntimeError("Your libraries are from OpenMPI but it appears your mpiexec is from MPICH"); |
48 |
+- self.addDefine('HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE', 'MPICH') |
49 |
+- elif out.find('OMPI_COMM_WORLD_SIZE') > -1: |
50 |
+- if hasattr(self,'mpich_numversion'): raise RuntimeError("Your libraries are from MPICH but it appears your mpiexec is from OpenMPI"); |
51 |
+- self.addDefine('HAVE_MPIEXEC_ENVIRONMENTAL_VARIABLE', 'OMP') |
52 |
+ self.addMakeMacro('MPIEXEC', self.mpiexec) |
53 |
+ self.mpiexec = self.mpiexec + ' -n 1' |
54 |
+ |
55 |
|
56 |
diff --git a/sci-mathematics/petsc/petsc-3.12.1.ebuild b/sci-mathematics/petsc/petsc-3.12.1.ebuild |
57 |
index c2b32ce1afb..2e5365823ea 100644 |
58 |
--- a/sci-mathematics/petsc/petsc-3.12.1.ebuild |
59 |
+++ b/sci-mathematics/petsc/petsc-3.12.1.ebuild |
60 |
@@ -56,6 +56,7 @@ PATCHES=( |
61 |
"${FILESDIR}"/${PN}-3.7.0-disable-rpath.patch |
62 |
"${FILESDIR}"/${PN}-3.9.0-fix_sandbox_violation.patch |
63 |
"${FILESDIR}"/${PN}-3.12.1-make_hypre_configure.patch |
64 |
+ "${FILESDIR}"/${PN}-3.12.1-do_not_run_mpiexec.patch |
65 |
) |
66 |
|
67 |
src_prepare() { |