Unable to compile VAPOR with Python 3.4

I downloaded VAPOR as a tar gz file and I am trying to compile from source.

As part of that I am getting these compile errors -

I do not believe VAPOR can be compiled with Python 3.4 as Py_InitModule() has been deprecated in Python 3.4.

http://stackoverflow.com/questions/28305731/compiler-cant-find-py-initmodule-is-it-deprecated-and-if-so-what-should-i

I believe that file has to be reworked to make it compatible with Python 3.4. Comments ?

pythonpipeline.cpp(90): error: identifier “Py_InitModule” is undefined
m = Py_InitModule(“vapor”, vaporMethodDefinitions);
^

pythonpipeline.cpp(93): error: return value type does not match the function type
import_array();
^

pythonpipeline.cpp(110): error: argument of type “char *” is incompatible with parameter of type “wchar_t *”
if (pyhome) Py_SetPythonHome(pyhome);
^

pythonpipeline.cpp(133): error: argument of type “char *” is incompatible with parameter of type “wchar_t *”
Py_SetPythonHome(pyhome2);
^

pythonpipeline.cpp(137): error: argument of type "void ()()" is incompatible with parameter of type “PyObject ()()”
int rc = PyImport_AppendInittab((char
)“vapor”,&(PythonPipeLine::initvapor));
^

pythonpipeline.cpp(141): error: identifier “PyString_FromFormat” is undefined
PyObject* vaporname = PyString_FromFormat(“vapor”);
^

pythonpipeline.cpp(209): error: identifier “PyInt_AsLong” is undefined
int szval = PyInt_AsLong(sz);
^

pythonpipeline.cpp(214): error: identifier “PyString_AsString” is undefined
const char* strtext = PyString_AsString(txt);
^

pythonpipeline.cpp(423): error: identifier “PyString_FromFormat” is undefined
PyObject* myErrString = PyString_FromFormat(“myErr”);
^

pythonpipeline.cpp(428): error: identifier “PyInt_AsLong” is undefined
int szval = PyInt_AsLong(sz);
^

pythonpipeline.cpp(432): error: identifier “PyString_AsString” is undefined
const char* strtext = PyString_AsString(txt);
^

Hi winash12 and welcome to the forum :slight_smile:
AFAIK looking here: http://www.vapor.ucar.edu/internal/downloads/source-distributions they still only use python 2.7.x to build. What version of openSUSE are you building for? Is there a real need to use python 3?

Version 13.1

Yes it is essential to use Python 3.4

On Fri 22 Jul 2016 03:06:02 PM CDT, winash12 wrote:

Version 13.1

Yes it is essential to use Python 3.4

Hi
I don’t have the python skills to change the code, that could be a lot
of work. Do you know where the folks at UCAR are at with porting the
code, maybe you can find someone there who is working on it?

You only have a few months left before Evergreen 13.1 is EOL, might be
time to change to Leap, at least then you could look at docker or
flatpack to carry on at 13.1 level?


Cheers Malcolm °¿° LFCS, SUSE Knowledge Partner (Linux Counter #276890)
openSUSE Leap 42.1|GNOME 3.16.2|4.1.27-24-default
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

You are probably right about needing to convert the file, but it may not be the only file (I notice there is a reference to a c++ file. You might try using py2to3 to help, at least with the major changes between python 2 and python 3.