|
85 | 85 | from sage_setup.autogen import autogen_all
|
86 | 86 | autogen_all()
|
87 | 87 |
|
88 |
| - log.info("Discovering Python/Cython source code....") |
89 |
| - t = time.time() |
| 88 | + log.info("Discovering Python/Cython source code...") |
90 | 89 |
|
91 | 90 | # Exclude a few files if the corresponding distribution is not loaded
|
92 | 91 | optional_packages = ['mcqd', 'bliss', 'tdlib',
|
|
103 | 102 | python_packages = find_namespace_packages(where=SAGE_SRC, include=['sage', 'sage.*'])
|
104 | 103 | log.debug(f"python_packages = {python_packages}")
|
105 | 104 |
|
106 |
| - log.info(f"Discovered Python/Cython sources, time: {(time.time() - t):.2f} seconds.") |
| 105 | + log.info(f"Discovering Python/Cython source code... done") |
107 | 106 |
|
108 | 107 | # from sage_build_cython:
|
109 | 108 | import Cython.Compiler.Options
|
110 | 109 | Cython.Compiler.Options.embed_pos_in_docstring = True
|
111 | 110 | gdb_debug = os.environ.get('SAGE_DEBUG', None) != 'no'
|
112 | 111 |
|
| 112 | + aliases = cython_aliases() |
| 113 | + log.debug(f"aliases = {aliases}") |
| 114 | + include_path = sage_include_directories(use_sources=True) + ['.'] |
| 115 | + log.debug(f"include_path = {include_path}") |
| 116 | + nthreads = sage_build_ext_minimal.get_default_number_build_jobs() |
| 117 | + log.info(f"Cythonizing with {nthreads} threads...") |
113 | 118 | try:
|
114 | 119 | from Cython.Build import cythonize
|
115 | 120 | from sage.env import cython_aliases, sage_include_directories
|
|
118 | 123 | extensions = cythonize(
|
119 | 124 | ["sage/**/*.pyx"],
|
120 | 125 | exclude=files_to_exclude,
|
121 |
| - include_path=sage_include_directories(use_sources=True) + ['.'], |
| 126 | + include_path=include_path, |
122 | 127 | compile_time_env=compile_time_env_variables(),
|
123 | 128 | compiler_directives=compiler_directives(False),
|
124 |
| - aliases=cython_aliases(), |
| 129 | + aliases=aliases, |
125 | 130 | create_extension=create_extension,
|
126 | 131 | gdb_debug=gdb_debug,
|
127 |
| - nthreads=sage_build_ext_minimal.get_default_number_build_jobs()) |
| 132 | + nthreads=nthreads) |
128 | 133 | except Exception as exception:
|
129 | 134 | log.warn(f"Exception while cythonizing source files: {repr(exception)}")
|
130 | 135 | raise
|
| 136 | + log.info(f"Cythonizing with {nthreads} threads... done") |
131 | 137 |
|
132 | 138 | # ########################################################
|
133 | 139 | # ## Distutils
|
|
0 commit comments