How to use the pyodesys.native.cvode.NativeCvodeCode function in pyodesys

To help you get started, we’ve selected a few pyodesys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bjodah / pyodesys / pyodesys / native / cvode.py View on Github external
def __init__(self, *args, **kwargs):
        self.compile_kwargs = copy.deepcopy(_compile_kwargs)
        self.compile_kwargs['define'] = ['PYCVODES_NO_KLU={}'.format("0" if config.get('KLU', True) else "1"),
                                         'PYCVODES_NO_LAPACK={}'.format("0" if config.get('LAPACK', True) else "1"),
                                         'ANYODE_NO_LAPACK={}'.format("0" if config.get('LAPACK', True) else "1")]
        self.compile_kwargs['include_dirs'].append(get_include())
        self.compile_kwargs['libraries'].extend(_libs.get_libs().split(','))
        self.compile_kwargs['libraries'].extend([l for l in os.environ.get(
            'PYODESYS_LAPACK', "lapack,blas" if config["LAPACK"] else "").split(",") if l != ""])
        self.compile_kwargs['flags'] = [f for f in os.environ.get("PYODESYS_CVODE_FLAGS", "").split() if f]
        self.compile_kwargs['ldflags'] = [f for f in os.environ.get("PYODESYS_CVODE_LDFLAGS", "").split() if f]
        super(NativeCvodeCode, self).__init__(*args, **kwargs)