Skip to content

Commit

Permalink
Repaired cython code to build unter newer cython.
Browse files Browse the repository at this point in the history
veperf now supposed to run under python3.
  • Loading branch information
efocht committed Nov 16, 2023
1 parent 45576b1 commit 7a1551c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 3 additions & 4 deletions veosinfo/_veosinfo.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ import time
ctypedef int pid_t

cdef extern from "<sched.h>":
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 "<sys/param.h>":
enum: PATH_MAX
Expand Down Expand Up @@ -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, <cpu_set_t *>&s[0]):
raise RuntimeError("ve_create_process failed")
return s
Expand Down
4 changes: 2 additions & 2 deletions veperf
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 7a1551c

Please sign in to comment.