Skip to content

Commit 7d44ead

Browse files
authored
Merge pull request #6 from firedrakeproject/connorjward/upstream-update
Upstream update
2 parents 2285b60 + 6a64b92 commit 7d44ead

File tree

172 files changed

+1594
-4292
lines changed

Some content is hidden

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

172 files changed

+1594
-4292
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: 146 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,20 @@ 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+
using_build_backend = any(
588+
os.environ.get(prefix + '_BUILD_BACKEND')
589+
for prefix in ('_PYPROJECT_HOOKS', 'PEP517')
590+
)
591+
if using_build_backend:
592+
self.fixPythonWheel()
448593
return
449594

450595
def rundone(self):
451-
self.createUninstaller()
452596
if self.destDir == self.installDir:
453597
self.outputInstallDone()
454598
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 = '66c82a45db9fb64ece5a69de8b4d27896b96c30e'
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/slepc.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''):
5555
self.AddDefine(slepcconf,'PETSC_ARCH',petsc.arch)
5656
self.AddDefine(slepcconf,'DIR',slepc.dir)
5757
self.AddDefine(slepcconf,'LIB_DIR',os.path.join(slepc.prefixdir,'lib'))
58-
if slepc.isrepo:
58+
if slepc.isrepo and slepc.gitrev != 'unknown':
5959
self.AddDefine(slepcconf,'VERSION_GIT',slepc.gitrev)
6060
self.AddDefine(slepcconf,'VERSION_DATE_GIT',slepc.gitdate)
6161
self.AddDefine(slepcconf,'VERSION_BRANCH_GIT',slepc.branch)
@@ -69,7 +69,7 @@ def Process(self,slepcconf,slepcvars,slepcrules,slepc,petsc,archdir=''):
6969

7070
def ShowInfo(self):
7171
self.log.Println('\nSLEPc directory:\n '+self.dir)
72-
if self.isrepo:
72+
if self.isrepo and self.gitrev != 'unknown':
7373
self.log.Println(' It is a git repository on branch: '+self.branch)
7474
if self.isinstall:
7575
self.log.Println('SLEPc prefix directory:\n '+self.prefixdir)
@@ -110,28 +110,36 @@ def LoadVersion(self):
110110
# Check whether this is a working copy of the repository
111111
self.isrepo = False
112112
if os.path.exists(os.path.join(self.dir,'src','docs')):
113+
self.log.write('This appears to be a repository clone - src/docs exists')
113114
self.isrepo = True
114-
(status, output) = self.RunCommand('git help')
115-
if status:
116-
self.log.Warn('SLEPC_DIR appears to be a git working copy, but git is not found in PATH')
117-
self.gitrev = 'unknown'
118-
self.gitdate = 'unknown'
119-
self.branch = 'unknown'
120-
else:
121-
(status, output) = self.RunCommand('git rev-parse')
115+
if os.path.exists(os.path.join(self.dir,'.git')):
116+
self.log.write('.git directory exists')
117+
(status, output) = self.RunCommand('git help')
122118
if status:
123-
self.log.Warn('SLEPC_DIR appears to be a git working copy, but the .git folder is missing')
119+
self.log.Warn('SLEPC_DIR appears to be a git working copy, but git is not found in PATH')
124120
self.gitrev = 'unknown'
125121
self.gitdate = 'unknown'
126122
self.branch = 'unknown'
127123
else:
128-
(status, self.gitrev) = self.RunCommand('git describe')
124+
(status, self.gitrev) = self.RunCommand('git describe --match=v*')
129125
if not self.gitrev:
130126
(status, self.gitrev) = self.RunCommand('git log -1 --pretty=format:%H')
131127
(status, self.gitdate) = self.RunCommand('git log -1 --pretty=format:%ci')
132128
(status, self.branch) = self.RunCommand('git describe --contains --all HEAD')
133129
if status:
134-
self.branch = 'unknown'
130+
(status, self.branch) = self.RunCommand('git rev-parse --abbrev-ref HEAD')
131+
if status:
132+
self.branch = 'unknown'
133+
else:
134+
self.log.write('This repository clone is obtained as a tarball as no .git dirs exist')
135+
self.gitrev = 'unknown'
136+
self.gitdate = 'unknown'
137+
self.branch = 'unknown'
138+
else:
139+
if os.path.exists(os.path.join(self.dir,'.git')):
140+
self.log.Exit('Your SLEPc source tree is broken. Use "git status" to check, or remove the entire directory and start all over again')
141+
else:
142+
self.log.write('This is a tarball installation')
135143

136144
def CreateFile(self,basedir,fname):
137145
''' Create file basedir/fname and return path string '''

0 commit comments

Comments
 (0)