Skip to content

Commit 99b6aaf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into connorjward/upstream-update
2 parents 2285b60 + 1b1a6e4 commit 99b6aaf

File tree

116 files changed

+1332
-1115
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+1332
-1115
lines changed

.gitlab-ci.yml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ gnu-cxx-int64:
421421
pip-install:
422422
extends: .test
423423
stage: stage-2
424-
allow_failure: true # set this after release before the new petsc4py version is uploaded to pypi
425424
tags:
426425
- pip, name:jepri
427426
before_script:
@@ -433,34 +432,45 @@ pip-install:
433432
- ccache --zero-stats
434433
- printf "PYTHON:${PYTHON}\n"
435434
script:
436-
- unset PETSC_DIR PETSC_ARCH SLEPC_DIR
437435
- |
438-
if [ $(awk '/define SLEPC_VERSION_RELEASE/{print $3}' include/slepcversion.h) == 1 ]; then
439-
pip install --user .;
440-
pip install --user src/binding/slepc4py;
441-
make -C src/binding/slepc4py/demo;
436+
unset PETSC_DIR PETSC_ARCH SLEPC_DIR
437+
slepc=$PWD
438+
cd ..
439+
if [ ! -d petsc ]; then git clone https://gitlab.com/petsc/petsc.git; fi
440+
cd petsc
441+
git clean ${GIT_CLEAN_FLAGS}
442+
git fetch
443+
if [ -z ${PETSC_BRANCH+x} ]; then
444+
if [ $(awk '/define SLEPC_VERSION_RELEASE/{print $3}' $slepc/include/slepcversion.h) == 1 ]; then
445+
git checkout origin/release
446+
else
447+
git checkout origin/main
448+
fi
442449
else
443-
slepc=$PWD;
444-
cd ..;
445-
if [ ! -d petsc ]; then git clone https://gitlab.com/petsc/petsc.git; fi;
446-
cd petsc;
447-
petsc=$PWD;
448-
git clean ${GIT_CLEAN_FLAGS}
449-
git fetch;
450-
if [ -z ${PETSC_BRANCH+x} ]; then git checkout origin/main; else git checkout origin/$PETSC_BRANCH; fi;
451-
set -eu pipefail;
452-
rm -rf /tmp/env;
453-
python -m venv /tmp/env;
454-
source /tmp/env/bin/activate;
455-
set -x;
456-
python -m pip install -U pip==23.0.1 # pin version due to issue with pip 23.1
457-
pip install numpy;
458-
pip install $petsc;
459-
pip install $petsc/src/binding/petsc4py;
460-
pip install $slepc;
461-
pip install $slepc/src/binding/slepc4py;
462-
make -C $slepc/src/binding/slepc4py/demo;
450+
git checkout origin/$PETSC_BRANCH
463451
fi
452+
petsc=$PWD
453+
cd ..
454+
set -eu pipefail
455+
rm -rf /tmp/venv
456+
python -m venv /tmp/venv
457+
source /tmp/venv/bin/activate
458+
set -x
459+
python -m pip install --upgrade pip
460+
wheelhouse=$PWD/wheelhouse
461+
rm -rf $wheelhouse
462+
mkdir -p $wheelhouse
463+
export PIP_WHEEL_DIR=$wheelhouse
464+
export PIP_FIND_LINKS=$wheelhouse
465+
python -m pip wheel $petsc
466+
python -m pip wheel $petsc/src/binding/petsc4py
467+
python -m pip wheel $slepc
468+
python -m pip wheel $slepc/src/binding/slepc4py
469+
python -m pip install --pre slepc4py
470+
python -m pip list
471+
python -m slepc --prefix
472+
python -m slepc4py
473+
make -C $slepc/src/binding/slepc4py/demo
464474
after_script:
465475
- date
466476

CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,25 @@
44

55
### Added
66

7-
- `ST`: new function `STShellSetApplyHermitianTranspose` and other improvements for handling
7+
- `BV`: new function `BVGetSplitRows()` to split a `BV` row-wise using index sets.
8+
9+
### Changed
10+
11+
- In slepc4py now `EPS.getEigenpair()` and `EPS.getEigenvalue()` will return a real value
12+
instead of a complex, if the problem is of Hermitian or generalized Hermitian type.
13+
14+
## [3.21] - 2024-03-30
15+
16+
### Added
17+
18+
- `ST`: new function `STShellSetApplyHermitianTranspose()` and other improvements for handling
819
the conjugate transpose of the operator.
920

21+
### Changed
22+
23+
- `SVDGetSignature()` now takes a `Vec` argument instead of `Vec*`. The former interface
24+
could not be used from Fortran.
25+
1026
## [3.20] - 2023-09-29
1127

1228
### Changed
@@ -454,7 +470,8 @@
454470
- Classical and modified Gram-Schmidt orthogonalization use iterative refinement, with user options
455471
for parameter adjustment.
456472

457-
[unreleased]: https://gitlab.com/slepc/slepc/compare/v3.20...main
473+
[unreleased]: https://gitlab.com/slepc/slepc/compare/v3.21...main
474+
[3.21]: https://gitlab.com/slepc/slepc/compare/v3.20...v3.21
458475
[3.20]: https://gitlab.com/slepc/slepc/compare/v3.19...v3.20
459476
[3.19]: https://gitlab.com/slepc/slepc/compare/v3.18...v3.19
460477
[3.18]: https://gitlab.com/slepc/slepc/compare/v3.17...v3.18

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2002-2023, Universitat Politecnica de Valencia, Spain
1+
Copyright (c) 2002-2024, Universitat Politecnica de Valencia, Spain
22
All rights reserved.
33

44
Redistribution and use in source and binary forms, with or without

config/install.py

Lines changed: 142 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
from __future__ import print_function
3-
import os, sys, shutil
3+
import re, os, sys, shutil
44
import subprocess
55

66
try:
@@ -302,6 +302,144 @@ def fixConf(self):
302302
self.fixConfFile(os.path.join(self.destIncludeDir,'slepcconf.h'))
303303
return
304304

305+
def fixPythonWheel(self):
306+
import glob
307+
import shutil
308+
#
309+
for pattern in (
310+
self.destLibDir + '/*.a',
311+
self.destLibDir + '/*.la',
312+
self.destLibDir + '/pkgconfig', # TODO: keep?
313+
self.destConfDir + '/configure-hash',
314+
self.destConfDir + '/uninstall.py',
315+
self.destConfDir + '/reconfigure-*.py',
316+
self.destConfDir + '/pkg.conf.*',
317+
self.destConfDir + '/pkg.git*.*',
318+
self.destConfDir + '/modules', # TODO: keep?
319+
self.destShareDir + '/*/examples/src/*',
320+
self.destShareDir + '/*/datafiles',
321+
):
322+
for pathname in glob.glob(pattern):
323+
if os.path.isdir(pathname):
324+
shutil.rmtree(pathname)
325+
elif os.path.exists(pathname):
326+
os.remove(pathname)
327+
#
328+
for filename in (
329+
self.destIncludeDir + '/slepcconf.h',
330+
self.destShareDir + '/slepc/examples/gmakefile.test',
331+
self.destConfDir + '/slepc_rules_doc.mk',
332+
self.destConfDir + '/slepc_rules_util.mk',
333+
self.destConfDir + '/slepc_rules',
334+
self.destConfDir + '/slepcrules',
335+
self.destConfDir + '/slepc_variables',
336+
self.destConfDir + '/slepcvariables',
337+
):
338+
with open(filename, 'r') as oldFile:
339+
contents = oldFile.read()
340+
contents = contents.replace(self.installDir, '${SLEPC_DIR}')
341+
contents = contents.replace(self.rootDir, '${SLEPC_DIR}')
342+
contents = contents.replace(self.petscDir, '${PETSC_DIR}')
343+
with open(filename, 'w') as newFile:
344+
newFile.write(contents)
345+
#
346+
def lsdir(dirname, *patterns):
347+
return glob.glob(os.path.join(dirname, *patterns))
348+
def shell(*args):
349+
out = subprocess.check_output(list(args), universal_newlines=True)
350+
return out[:-1] if out[-1:] == '\n' else out
351+
plibdir = os.path.join(self.petscDir, 'lib')
352+
slibdir = os.path.join(self.installDir, 'lib')
353+
if sys.platform == 'linux':
354+
libraries = [
355+
lib for lib in lsdir(self.destLibDir, 'lib*.so*')
356+
if not os.path.islink(lib)
357+
]
358+
for shlib in libraries:
359+
# fix shared library rpath
360+
rpath = shell('patchelf', '--print-rpath', shlib)
361+
rpath = rpath.split(os.path.pathsep)
362+
if plibdir in rpath:
363+
rpath.insert(0, '$ORIGIN/../../petsc/lib')
364+
while plibdir in rpath:
365+
rpath.remove(plibdir)
366+
if slibdir in rpath:
367+
rpath.insert(0, '$ORIGIN')
368+
while slibdir in rpath:
369+
rpath.remove(slibdir)
370+
if rpath:
371+
rpath = os.path.pathsep.join(rpath)
372+
shell('patchelf', '--set-rpath', rpath, shlib)
373+
# fix shared library file and symlink
374+
basename = os.path.basename(shlib)
375+
libname, ext, _ = basename.partition('.so')
376+
liblink = libname + ext
377+
soname = shell('patchelf', '--print-soname', shlib)
378+
for symlink in lsdir(self.destLibDir, liblink + '*'):
379+
if os.path.islink(symlink):
380+
os.unlink(symlink)
381+
curdir = os.getcwd()
382+
try:
383+
os.chdir(os.path.dirname(shlib))
384+
if soname != basename:
385+
os.rename(basename, soname)
386+
if soname != liblink:
387+
os.symlink(soname, liblink)
388+
finally:
389+
os.chdir(curdir)
390+
if sys.platform == 'darwin':
391+
def otool(cmd, dylib):
392+
pattern = r'''
393+
^\s+ cmd \s %s$\n
394+
^\s+ cmdsize \s \d+$\n
395+
^\s+ (?:name|path) \s (.*) \s \(offset \s \d+\)$
396+
''' % cmd
397+
return re.findall(
398+
pattern, shell('otool', '-l', dylib),
399+
flags=re.VERBOSE | re.MULTILINE,
400+
)
401+
libraries = [
402+
lib for lib in lsdir(self.destLibDir, 'lib*.dylib')
403+
if not os.path.islink(lib)
404+
]
405+
for dylib in libraries:
406+
install_name = otool('LC_ID_DYLIB', dylib)[0]
407+
dependencies = otool('LC_LOAD_DYLIB', dylib)
408+
runtime_path = otool('LC_RPATH', dylib)
409+
# fix shared library install name and rpath
410+
install_name = '@rpath/' + os.path.basename(install_name)
411+
shell('install_name_tool', '-id', install_name, dylib)
412+
for libdir in (plibdir, slibdir):
413+
if libdir in runtime_path:
414+
shell('install_name_tool', '-delete_rpath', libdir, dylib)
415+
for rpath in ('@loader_path', '@loader_path/../../petsc/lib'):
416+
if rpath not in runtime_path:
417+
shell('install_name_tool', '-add_rpath', rpath, dylib)
418+
for dep in dependencies:
419+
if os.path.dirname(dep) in (plibdir, slibdir):
420+
newid = '@rpath/' + os.path.basename(dep)
421+
shell('install_name_tool', '-change', dep, newid, dylib)
422+
# fix shared library file and symlink
423+
basename = os.path.basename(dylib)
424+
libname, ext = os.path.splitext(basename)
425+
libname = libname.partition('.')[0]
426+
liblink = libname + ext
427+
dyname = os.path.basename(install_name)
428+
for symlink in lsdir(self.destLibDir, libname + '*' + ext):
429+
if os.path.islink(symlink):
430+
os.unlink(symlink)
431+
curdir = os.getcwd()
432+
try:
433+
os.chdir(os.path.dirname(dylib))
434+
if dyname != basename:
435+
os.rename(basename, dyname)
436+
if dyname != liblink:
437+
os.symlink(dyname, liblink)
438+
finally:
439+
os.chdir(curdir)
440+
#
441+
return
442+
305443
def createUninstaller(self):
306444
uninstallscript = os.path.join(self.destConfDir, 'uninstall.py')
307445
f = open(uninstallscript, 'w')
@@ -441,14 +579,16 @@ def runcopy(self):
441579
self.installBin()
442580
self.installLib()
443581
self.installShare()
582+
self.createUninstaller()
444583
return
445584

446585
def runfix(self):
447586
self.fixConf()
587+
if os.environ.get('PEP517_BUILD_BACKEND'):
588+
self.fixPythonWheel()
448589
return
449590

450591
def rundone(self):
451-
self.createUninstaller()
452592
if self.destDir == self.installDir:
453593
self.outputInstallDone()
454594
else:

config/packages/elpa.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self,argdb,log):
1818
self.packagetype = 'gnu'
1919
self.installable = True
2020
self.downloadable = True
21-
self.version = '2023.11.001'
21+
self.version = '2024.03.001'
2222
self.archive = 'elpa-'+self.version+'.tar.gz'
2323
self.url = 'https://elpa.mpcdf.mpg.de/software/tarball-archive/Releases/'+self.version+'/'+self.archive
2424
self.supportssingle = True

config/packages/hpddm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def __init__(self,argdb,log):
1717
package.Package.__init__(self,argdb,log)
1818
self.packagename = 'hpddm'
1919
self.downloadable = True
20-
# self.gitcommit = 'a789a193f3c9c7c3c2674eb8d1f8db95cd1ae48c'
21-
self.version = '2.2.5'
20+
self.gitcommit = '28add19c6968c41497468f4f4ac156196b051ea9'
21+
# self.version = '2.3.0'
2222
obj = self.version if hasattr(self,'version') else self.gitcommit
2323
self.url = 'https://github.com/hpddm/hpddm/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz'
2424
self.archive = 'hpddm-'+obj+'.tar.gz'

config/packages/slicot.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ def __init__(self,argdb,log):
1717
self.packagename = 'slicot'
1818
self.installable = True
1919
self.downloadable = True
20-
self.gitcommit = '401037e4992827cd7476baae615be6fe818b71d4'
21-
#self.version = '5.8'
20+
#self.gitcommit = 'a037f7eb76134d45e7d222b7f017d5cbd16eb731'
21+
self.version = '5.9'
2222
obj = self.version if hasattr(self,'version') else self.gitcommit
2323
self.url = 'https://github.com/SLICOT/SLICOT-Reference/archive/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz'
2424
self.archive = 'slicot-'+obj+'.tar.gz'
@@ -56,20 +56,6 @@ def DownloadAndInstall(self,slepcconf,slepcvars,slepc,petsc,archdir,prefixdir):
5656
cont += 'LPKAUXLIB = ../'+libname+'\n' # TODO: use a separate library for this
5757
self.WriteMakefile('make_Unix.inc',builddir,cont)
5858

59-
# Patch top level makefile_Unix
60-
(result,output) = self.RunCommand('cd '+builddir+' && '+petsc.sedinplace+' -e "s?MAKE.?MAKE) -f makefile_Unix?" makefile_Unix')
61-
if result:
62-
self.log.Exit('Problem when patching file makefile_Unix')
63-
64-
# Patch makefile_Unix in src
65-
sedargs = ' -e "s?make.inc?make_Unix.inc?"'
66-
remfiles = ['MB04RD', 'MB04RS', 'MB04RT', 'MB04RV', 'MB04RW', 'MB04RZ', 'zelctg']
67-
for f in remfiles:
68-
sedargs = sedargs + ' -e "s?'+f+'.o??"'
69-
(result,output) = self.RunCommand('cd '+os.path.join(builddir,'src')+' && '+petsc.sedinplace+' '+sedargs+' makefile_Unix')
70-
if result:
71-
self.log.Exit('Problem when patching file makefile_Unix in src')
72-
7359
# Build package
7460
target = 'lib'
7561
(result,output) = self.RunCommand('cd '+builddir+' && '+petsc.make+' -f makefile_Unix cleanlib && '+petsc.make+' -f makefile_Unix -j'+petsc.make_np+' '+target)

config/packages/sowing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ def __init__(self,argdb,log):
1818
self.packagename = 'sowing'
1919
self.downloadable = True
2020
self.inplace = False
21-
#self.gitcommit = '7e1bbd0d8427274768a13849372ce0ee911f4ac5'
22-
self.version = '1.1.26-p7'
21+
#self.gitcommit = '2fe1f1f12257b274cbb0b4425f2994965bcc9bde'
22+
self.version = '1.1.26.9'
2323
obj = self.version if hasattr(self,'version') else self.gitcommit
2424
self.url = 'https://bitbucket.org/petsc/pkg-sowing/get/'+('v'+obj if hasattr(self,'version') else obj)+'.tar.gz'
2525
self.archive = 'sowing-'+obj+'.tar.gz'

docs/changes.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@
210210
<td> 3.20 </td>
211211
<td> Sep 2023 </td>
212212
</tr>
213+
<tr>
214+
<td> 3.21 </td>
215+
<td> 3.21 </td>
216+
<td> Mar 2024 </td>
217+
</tr>
213218
</table>
214219

215220
<font face="Arial, Helvetica, sans-serif" size="2">A changelog of the different versions can be found <a href="https://gitlab.com/slepc/slepc/-/blob/main/CHANGELOG.md" target=_blank>here</a>.</font>

docs/instal.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
The main steps for the installation are:</p>
3333
<ol>
3434
<li style="padding-top: 0.5em">
35-
Unbundle the distribution file <strong>slepc-3.20.0.tar.gz</strong> with a usual
36-
command such as <code>tar xzf slepc-3.20.0.tar.gz</code>.
35+
Unbundle the distribution file <strong>slepc-3.21.0.tar.gz</strong> with a usual
36+
command such as <code>tar xzf slepc-3.21.0.tar.gz</code>.
3737
This will create a directory and unpack the software there.<br>
3838
</li>
3939
<li style="padding-top: 0.5em">Set the environment variable <code>SLEPC_DIR</code>
4040
to the full path of the SLEPc home directory, for example,<br>
4141
<div style="padding-top: 0.4em; padding-bottom: 0.4em;">
42-
<code style="margin-left: 1cm">export SLEPC_DIR=/home/username/slepc-3.20.0</code><br>
42+
<code style="margin-left: 1cm">export SLEPC_DIR=/home/username/slepc-3.21.0</code><br>
4343
</div>
4444
In addition to this variable, <code>PETSC_DIR</code>
4545
and <code>PETSC_ARCH</code> must also be set appropriately.<br>

0 commit comments

Comments
 (0)