Page Menu
Home
Solus
Search
Configure Global Search
Log In
Files
F10782219
D11518.id28593.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11518.id28593.diff
View Options
diff --git a/files/Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch b/files/Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch
new file mode 100644
--- /dev/null
+++ b/files/Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch
@@ -0,0 +1,45 @@
+From 325fb5e5ee95a597b50583846938e3ba97fa78ab Mon Sep 17 00:00:00 2001
+From: Joey Riches <josephriches@gmail.com>
+Date: Thu, 22 Jul 2021 02:54:21 +0100
+Subject: [PATCH 1/1] Try to load so.avx2 libs first if they exist and cpu is
+ supported
+
+We compile for haswell so we also check for popcnt to exclude bdver4 (Exacavator)
+
+Not really the most ideal solution but should do the trick.
+---
+ Python/dynload_shlib.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/Python/dynload_shlib.c b/Python/dynload_shlib.c
+index f271193190..f25c01dce0 100644
+--- a/Python/dynload_shlib.c
++++ b/Python/dynload_shlib.c
+@@ -61,6 +61,7 @@ _PyImport_FindSharedFuncptr(const char *prefix,
+ void *handle;
+ char funcname[258];
+ char pathbuf[260];
++ char *pathname2;
+ int dlopenflags=0;
+
+ if (strchr(pathname, '/') == NULL) {
+@@ -93,7 +94,15 @@ _PyImport_FindSharedFuncptr(const char *prefix,
+
+ dlopenflags = PyThreadState_GET()->interp->dlopenflags;
+
+- handle = dlopen(pathname, dlopenflags);
++ pathname2 = malloc(strlen(pathname) + strlen(".avx2") + 1);
++ sprintf(pathname2, "%s%s", pathname, ".avx2");
++ if (__builtin_cpu_supports("avx2") &&
++ __builtin_cpu_supports("popcnt") && // We compile for haswell, add popcnt check to exclude bdver4 (Exacavator)
++ access(pathname2, R_OK) == 0)
++ handle = dlopen(pathname2, dlopenflags);
++ else
++ handle = dlopen(pathname, dlopenflags);
++ free(pathname2);
+
+ if (handle == NULL) {
+ PyObject *mod_name;
+--
+2.32.0
+
diff --git a/files/series b/files/series
--- a/files/series
+++ b/files/series
@@ -1 +1,2 @@
0001-ensurepip-Always-install-pip-setuptools-ignoring-ins.patch
+Try-to-load-so.avx2-libs-first-if-they-exist-and-cpu.patch
diff --git a/package.yml b/package.yml
--- a/package.yml
+++ b/package.yml
@@ -1,6 +1,6 @@
name : python3
version : 3.9.6
-release : 36
+release : 37
source :
- https://www.python.org/ftp/python/3.9.6/Python-3.9.6.tar.xz : 397920af33efc5b97f2e0b57e91923512ef89fc5b3c1d21dbfc8c4828ce0108a
license : Python-2.0
diff --git a/pspec_x86_64.xml b/pspec_x86_64.xml
--- a/pspec_x86_64.xml
+++ b/pspec_x86_64.xml
@@ -5058,7 +5058,7 @@
</Description>
<PartOf>programming.devel</PartOf>
<RuntimeDependencies>
- <Dependency release="36">python3</Dependency>
+ <Dependency release="37">python3</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="header">/usr/include/python3.9/Python-ast.h</Path>
@@ -5231,7 +5231,7 @@
</Description>
<PartOf>programming.python</PartOf>
<RuntimeDependencies>
- <Dependency releaseFrom="36">python3</Dependency>
+ <Dependency releaseFrom="37">python3</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib/python3.9/test/Sine-1000Hz-300ms.aif</Path>
@@ -8536,15 +8536,15 @@
</Description>
<PartOf>programming.python</PartOf>
<RuntimeDependencies>
- <Dependency releaseFrom="36">python3</Dependency>
+ <Dependency releaseFrom="37">python3</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib64/python3.9/lib-dynload/_tkinter.cpython-39-x86_64-linux-gnu.so</Path>
</Files>
</Package>
<History>
- <Update release="36">
- <Date>2021-08-28</Date>
+ <Update release="37">
+ <Date>2021-08-31</Date>
<Version>3.9.6</Version>
<Comment>Packaging update</Comment>
<Name>Joey Riches</Name>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
May 26 2023, 1:02 PM (11 w, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5835205
Default Alt Text
D11518.id28593.diff (3 KB)
Attached To
Mode
D11518: Enable support for python to dlopen .so.avx2 libs
Attached
Detach File
Event Timeline
Log In to Comment