Fix configure script for python3.13

This commit is contained in:
David Bold 2024-08-06 11:54:44 +02:00
parent 740b34cbf7
commit f863cc10a0
3 changed files with 82 additions and 0 deletions

29
no-parse_makefile.patch Normal file
View File

@ -0,0 +1,29 @@
diff --git a/config/gmakegen.py b/config/gmakegen.py
index c9c476822c5..f58caab4d71 100644
--- a/config/gmakegen.py
+++ b/config/gmakegen.py
@@ -1,7 +1,6 @@
#! /usr/bin/python3 -sP
import os
-from sysconfig import _parse_makefile as parse_makefile
import sys
import logging
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
@@ -36,6 +35,16 @@ def getlangsplit(name):
def stripsplit(line):
return line[len('#requires'):].replace("'","").split()
+def parse_makefile(fn):
+ out = {}
+ with open(fn) as f:
+ for l in f:
+ print(l[:-1])
+ if "=" in l:
+ a,b = l.split("=", 1)
+ out[a.strip()] = b.strip()
+ return out
+
PetscPKGS = 'sys vec mat dm ksp snes ts tao'.split()
# the key is actually the language suffix, it won't work for suffixes such as 'kokkos.cxx' so use an _ and replace the _ as needed with .
LANGS = dict(kokkos_cxx='KOKKOS', hip_cpp='HIP', sycl_cxx='SYCL', raja_cxx='RAJA', c='C', cxx='CXX', cpp='CPP', cu='CU', F='F', F90='F90')

48
no-xdrlib.patch Normal file
View File

@ -0,0 +1,48 @@
diff --git a/config/BuildSystem/RDict.py b/config/BuildSystem/RDict.py
index cc90f3e26c5..d68ab095e06 100755
--- a/config/BuildSystem/RDict.py
+++ b/config/BuildSystem/RDict.py
@@ -83,7 +83,7 @@ Arg class, which wraps the usual value.'''
def __init__(self, parentAddr = None, parentDirectory = None, load = 1, autoShutdown = 1, readonly = False):
import atexit
import time
- import xdrlib
+ #import xdrlib
self.logFile = None
self.setupLogFile()
@@ -98,8 +98,8 @@ Arg class, which wraps the usual value.'''
self.isServer = 0
self.readonly = readonly
self.parentDirectory = parentDirectory
- self.packer = xdrlib.Packer()
- self.unpacker = xdrlib.Unpacker('')
+ #self.packer = xdrlib.Packer()
+ #self.unpacker = xdrlib.Unpacker('')
self.stopCmd = pickle.dumps(('stop',))
self.writeLogLine('Greetings')
self.connectParent(self.parentAddr, self.parentDirectory)
@@ -116,8 +116,8 @@ Arg class, which wraps the usual value.'''
if 'parent' in d: del d['parent']
if 'saveTimer' in d: del d['saveTimer']
if '_setCommandLine' in d: del d['_setCommandLine']
- del d['packer']
- del d['unpacker']
+ #del d['packer']
+ #del d['unpacker']
del d['logFile']
return d
@@ -126,9 +126,9 @@ Arg class, which wraps the usual value.'''
self.logFile = open('RDict.log', 'a')
self.writeLogLine('Unpickling RDict')
self.__dict__.update(d)
- import xdrlib
- self.packer = xdrlib.Packer()
- self.unpacker = xdrlib.Unpacker('')
+ #import xdrlib
+ #self.packer = xdrlib.Packer()
+ #self.unpacker = xdrlib.Unpacker('')
self.connectParent(self.parentAddr, self.parentDirectory)
return

View File

@ -309,6 +309,9 @@ Patch4: %{name}-3.19.4-fix_metis64.patch
Patch6: %{name}-3.14.1-fix_pkgconfig_file.patch Patch6: %{name}-3.14.1-fix_pkgconfig_file.patch
Patch7: %{name}-3.17.0-avoid_fake_MKL_detection.patch Patch7: %{name}-3.17.0-avoid_fake_MKL_detection.patch
Patch100: no-xdrlib.patch
Patch101: no-parse_makefile.patch
%if %{with superlu} %if %{with superlu}
BuildRequires: SuperLU-devel >= 5.2.0 BuildRequires: SuperLU-devel >= 5.2.0
%endif %endif
@ -587,6 +590,8 @@ done
pushd %{name}-%{version} pushd %{name}-%{version}
%patch -P 7 -p1 -b .backup %patch -P 7 -p1 -b .backup
%patch -P 100 -p1
%patch -P 101 -p1
popd popd
# Remove pregenerated Cython C sources # Remove pregenerated Cython C sources