OpenMP helpersΒΆ

We provide a helper function add_openmp_flags_if_available() that can be used to automatically add OpenMP flags for C/Cython extensions, based on whether OpenMP is available and produces executable code. To use this, edit the file where you define a C extension, import the helper function:

from extension_helpers import add_openmp_flags_if_available

then once you have defined the extension and before returning it, use it as:

extension = Extension(...)


return [extension]