Member
- May
- Threads
- 1
- 26
- 1
- 3
AD: Mt2009 - Mobile & PC - 30 January 2026 CHECK THE PRESENTATION!
Hello,
i try to create the rootlib with the Avenor 2 cythonizer.
I have this folder structure:
and my error:

i try to create the rootlib with the Avenor 2 cythonizer.
I have this folder structure:
from __future__ import print_function
import sys
import os
import glob
import cStringIO
from preprocess import preprocess
import source_writer
def warning(*objs):
print("WARNING: ", *objs, file=sys.stderr)
def __CythonizeSources(nthreads=0):
root = os.path.realpath(__file__)
for i in xrange(4):
root, _ = os.path.split(root)
warning(root)
sys.path.insert(0, os.path.join(root, "_CYTHONIZER_", "extern", "include", "Cython"))
from Cython.Build import cythonize
options = {
"global_options": {
"error_on_unknown_names": False,
},
}
sys.path.append("source/cyTemp")
exts = cythonize("source/cyTemp/*.pyx", nthreads=nthreads, language="c++", **options)
module_names = []
for m in exts:
for source in m.sources:
file = os.path.split(source)[1]
module_names.append(os.path.splitext(file)[0])
source_writer.run(module_names, "rootlib")
def Main(language):
sources = glob.glob("root/*.py")
defines = {
"LANGUAGE": language,
}
for src in sources:
dst = os.path.split(src)[1]
if language == "cython":
dst += "x"
of = cStringIO.StringIO()
preprocess(src,
of,
defines,
True)
path = os.path.join("cyTemp", dst)
try:
with open(path, "r") as f:
data = f.read()
except IOError:
data = None
if not data or data != of.getvalue():
with open(path, "wb") as f:
f.write(of.getvalue())
if language == "cython":
__CythonizeSources(3)
if __name__ == "__main__":
Main(*sys.argv[1:])
import sys
import os
import glob
import cStringIO
from preprocess import preprocess
import source_writer
def warning(*objs):
print("WARNING: ", *objs, file=sys.stderr)
def __CythonizeSources(nthreads=0):
root = os.path.realpath(__file__)
for i in xrange(4):
root, _ = os.path.split(root)
warning(root)
sys.path.insert(0, os.path.join(root, "_CYTHONIZER_", "extern", "include", "Cython"))
from Cython.Build import cythonize
options = {
"global_options": {
"error_on_unknown_names": False,
},
}
sys.path.append("source/cyTemp")
exts = cythonize("source/cyTemp/*.pyx", nthreads=nthreads, language="c++", **options)
module_names = []
for m in exts:
for source in m.sources:
file = os.path.split(source)[1]
module_names.append(os.path.splitext(file)[0])
source_writer.run(module_names, "rootlib")
def Main(language):
sources = glob.glob("root/*.py")
defines = {
"LANGUAGE": language,
}
for src in sources:
dst = os.path.split(src)[1]
if language == "cython":
dst += "x"
of = cStringIO.StringIO()
preprocess(src,
of,
defines,
True)
path = os.path.join("cyTemp", dst)
try:
with open(path, "r") as f:
data = f.read()
except IOError:
data = None
if not data or data != of.getvalue():
with open(path, "wb") as f:
f.write(of.getvalue())
if language == "cython":
__CythonizeSources(3)
if __name__ == "__main__":
Main(*sys.argv[1:])
and my error:


