From 7a1551c5b2273f2d6f545d90b1597f59712e7807 Mon Sep 17 00:00:00 2001 From: Erich Focht Date: Thu, 16 Nov 2023 12:23:35 +0100 Subject: [PATCH] Repaired cython code to build unter newer cython. veperf now supposed to run under python3. --- Makefile | 5 ++++- setup.py | 2 +- veosinfo/_veosinfo.pyx | 7 +++---- veperf | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a41e582..8800620 100644 --- a/Makefile +++ b/Makefile @@ -22,8 +22,11 @@ sdist: upload: python -m twine upload dist/py-veosinfo*.tar.gz +RELEASE := $(shell grep -e "^release =" setup.cfg | sed -e "s,release = ,,") +DISTRO := $(shell rpm --eval "%{dist}") + rpm: veosinfo/_veosinfo.so - python setup.py bdist_rpm + python setup.py bdist_rpm --release=$(RELEASE)$(DISTRO) srpm: veosinfo/_veosinfo.so python setup.py bdist_rpm --source-only diff --git a/setup.py b/setup.py index 95d4e9a..0255dd6 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ setup( name = "py-veosinfo", - version = "2.6.0", + version = "2.6.1", ext_modules = ext_mods, scripts = ["veperf"], author = "Erich Focht", diff --git a/veosinfo/_veosinfo.pyx b/veosinfo/_veosinfo.pyx index ad843a4..8798135 100644 --- a/veosinfo/_veosinfo.pyx +++ b/veosinfo/_veosinfo.pyx @@ -40,11 +40,10 @@ import time ctypedef int pid_t cdef extern from "": - enum: __CPU_SETSIZE - enum: __NCPUBITS + DEF CPUSET_LONGS = 128 ctypedef unsigned long int __cpu_mask ctypedef struct cpu_set_t: - unsigned long int __bits[__CPU_SETSIZE / __NCPUBITS] + unsigned long int __bits[CPUSET_LONGS] cdef extern from "": enum: PATH_MAX @@ -395,7 +394,7 @@ def cpufreq_info(int nodeid): def create_process(int nodeid, int pid, int flag, int numa_num, int membind_flag): #cdef cpu_set_t s - cdef long s[__CPU_SETSIZE / __NCPUBITS] + cdef long s[CPUSET_LONGS] if ve_create_process(nodeid, pid, flag, numa_num, membind_flag, &s[0]): raise RuntimeError("ve_create_process failed") return s diff --git a/veperf b/veperf index f508e29..e39c769 100755 --- a/veperf +++ b/veperf @@ -1,6 +1,6 @@ -#!/usr/bin/python +#!/usr/bin/python3 # -# Copyright (C) 2018 Erich Focht +# Copyright (C) 2018-2023 Erich Focht # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by