Py2 (no-)support
The doc suggests YADE can still be used with Python 2. And there is a -DPYTHON_VERSION=2 cmake option.
However, the following
mkdir Test
cd Test
git clone https://gitlab.com/yade-dev/trunk.git
mkdir build
cd build
cmake -DPYTHON_VERSION=2.7 ../trunk
make install
will return compilation errors (below) e.g. because of yadeWrapper.cpp that use Python 3.sthg functions: PyMemoryView_FromMemory() (MPI=ON -specific), PyGILState_Check() (general, it seems)
See eg here and there in yadeWrapper.cpp
Do we officially abandon Py2 support ? (sensible choice in my opinion, and I could propose a MR in this sense, touching at the installation doc and CMakeLists.txt for instance)
Compilation errors:
trunk/py/wrapper/yadeWrapper.cpp: In member function ‘PyObject* yade::pyOmega::bufferFromIntrsct(const boost::shared_ptr<yade::Subdomain>&, unsigned int, unsigned int, bool)’:
trunk/py/wrapper/yadeWrapper.cpp:1209:10: error: ‘PyMemoryView_FromMemory’ was not declared in this scope
return PyMemoryView_FromMemory((char*)(subD->intersections[rank].data()), subD->intersections[rank].size() * sizeof(Body::id_t), PyBUF_WRITE);
^~~~~~~~~~~~~~~~~~~~~~~
trunk/py/wrapper/yadeWrapper.cpp:1209:10: note: suggested alternative: ‘PyMemoryView_FromBuffer’
return PyMemoryView_FromMemory((char*)(subD->intersections[rank].data()), subD->intersections[rank].size() * sizeof(Body::id_t), PyBUF_WRITE);
^~~~~~~~~~~~~~~~~~~~~~~
PyMemoryView_FromBuffer
trunk/py/wrapper/yadeWrapper.cpp:1213:10: error: ‘PyMemoryView_FromMemory’ was not declared in this scope
return PyMemoryView_FromMemory(
^~~~~~~~~~~~~~~~~~~~~~~
trunk/py/wrapper/yadeWrapper.cpp:1213:10: note: suggested alternative: ‘PyMemoryView_FromBuffer’
return PyMemoryView_FromMemory(
^~~~~~~~~~~~~~~~~~~~~~~
PyMemoryView_FromBuffer
trunk/py/wrapper/yadeWrapper.cpp: In member function ‘virtual yade::Real yade::pyGenericPotential::contactForce(const Real&, const Real&) const’:
trunk/py/wrapper/yadeWrapper.cpp:1416:49: error: ‘PyGILState_Check’ was not declared in this scope
LOG_TRACE("GIL State: " << PyGILState_Check());
^
trunk/py/wrapper/yadeWrapper.cpp:1416:49: note: suggested alternative: ‘PyGILState_STATE’
LOG_TRACE("GIL State: " << PyGILState_Check());