update build system to make it auto-adapt to include python support or not into MLIAP
This commit is contained in:
@ -26,7 +26,7 @@
|
||||
#include <cstring>
|
||||
#include <Python.h> // IWYU pragma: export
|
||||
|
||||
#ifdef LMP_MLIAPPY
|
||||
#ifdef MLIAP_PYTHON
|
||||
#include "mliap_model_python.h"
|
||||
// The above should somehow really be included in the next file.
|
||||
// We could get around this with cython --capi-reexport-cincludes
|
||||
@ -58,14 +58,14 @@ PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp)
|
||||
// one-time initialization of Python interpreter
|
||||
// pyMain stores pointer to main module
|
||||
external_interpreter = Py_IsInitialized();
|
||||
|
||||
#ifdef LMP_MLIAPPY
|
||||
|
||||
#ifdef MLIAP_PYTHON
|
||||
// Inform python intialization scheme of the mliappy module.
|
||||
// This -must- happen before python is initialized.
|
||||
int err = PyImport_AppendInittab("mliap_model_python_couple", PyInit_mliap_model_python_couple);
|
||||
if (err) error->all(FLERR,"Could not register MLIAPPY embedded python module.");
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Py_Initialize();
|
||||
PyEval_InitThreads();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user