SysFera / vishnu

Modular and high-level middleware for tasks, files and information management in heterogeneous and distributed HPC environments
http://sysfera.github.com/vishnu.html
Other
4 stars 12 forks source link

Vishnu does not work with swig 2 #384

Closed douardda closed 10 years ago

douardda commented 10 years ago

Cannot compile vishnu python wrappers (client part only) on a debian wheezy (which comes with swig 2.0.7).

swig->cxx file produce a lot of warnings, and comoilation fails with messages like:

/home/david/local/Downloads/VISHNU_v3.1.1/build/swigAPI/vishnuPYTHON_wrap.cxx: In function ‘PyObject* _wraplistSessions(PyObject, PyObject, PyObject)’: /home/david/local/Downloads/VISHNU_v3.1.1/build/swigAPI/vishnuPYTHONwrap.cxx:34986:75: error: invalid conversion from ‘void’ to ‘PyObject* {aka object}’ [-fpermissive] /home/david/local/Downloads/VISHNU_v3.1.1/build/swigAPI/vishnuPYTHON_wrap.cxx:34986:75: error: invalid conversion from ‘int’ to ‘swig_typeinfo’ [-fpermissive] /home/david/local/Downloads/VISHNU_v3.1.1/build/swigAPI/vishnuPYTHON_wrap.cxx:34986:75: error: too few arguments to function ‘PyObject* SWIG_PythonNewPointerObj(PyObject, void_, swig_type_info*, int)’ /home/david/local/Downloads/VISHNU_v3.1.1/build/swigAPI/vishnuPYTHON_wrap.cxx:2569:1: note: declared here

cmake cmd:

cmake -DCLIENT_ONLY=ON -DENABLE_SWIG=ON -DENABLE_PYTHON=ON -DCMAKE_INSTALL_PREFIX=/opt/projects/vishnu .. 
rchakode commented 10 years ago

Hi David, Which version of swig are you using? Only the versions 1.x are supported for vishnu, but you will still have lot of warning. Rodrigue

keoo commented 10 years ago

Hi,

To be more precise swig 1.3.41. Other 1.x are not guaranted to work.

Kevin

hguemar commented 10 years ago

Only changing to swig 1.3.41 won't do the trick too. :snake: Debian Wheezy comes with python 2.7 by default which is not yet supported by Vishnu, you have to use python 2.6 (which is still provided by Wheezy)

douardda commented 10 years ago

The version of swig is in Wheezy 2.0.7...

As a consequence, Vishnu cannot be compiled on Wheezy nor can it be compiled on squeeze (since it comes with boost 1.42)... Quite annoying IMHO.

keoo commented 10 years ago

Vishnu can be compiled on both wheezy and squeeze for python without swig, there is a 'swig_api/generated' repository that contains the files that are generated. If you do not enable SWIG in cmake, you can still compile vishnu with both python and java. The problem is we force all the modules to be activated if one activate python and does not activate SWIG. The best course is to compile only the client when one compile with python and without swig. As a consequence, some vishnu client function will be installed and there may be no corresponding server installed.

douardda commented 10 years ago

I don't get the point. On a fresh wheezy, I want to build a vishnu client system with python bindings. In fact, I don't really care whether I should regenerate the wrapper files with or not. When I tried to cmake the vishnu client with Python (from the published tgz archive of vishnu 3.1.1), I had an error message telling me the swig files need to be regenerated. Which fails due to this lack of swig2 support.

So maybe it's only a matter of documentation, but...

BTW, how do I tell which version of Python cmake must use?

More, why the cmake file does not properly check for versions of dependencies: python (which must NOT be > 2.6 if i understand correctly), swig (which must NOT be > 1.3,), zeromq (which must NOT be > 2), etc. ?

The best course is to compile only the client when one compile with python and without swig.

I'm not sure I understand this sentence, but I think it's what I am trying to do (on a wheezy machine)...

Ok, for the record, I've tried again to compile a vishnu client setup with Python bindings, and it worked this time (not exactly sure why) with python 2.7 (without renebrating swig wraper files of course).

keoo commented 10 years ago

Can you tell me the options you used to get the error message ? I can compile python bindings on a swig-less machine. To do so, assuming i'm on a build repository in the root directory : cmake -DCOMPILE_CLIENT_CLI=ON -DCOMPILE_FMS=ON -DCOMPILE_UMS=ON -DCOMPILE_TMS=ON -DCOMPILE_IMS=ON -DENABLE_PYTHON=ON ..

Concerning the python cmake uses, it uses the one it finds on your system (probably in /usr/bin/python), the fastest way to not change the whole system is to make an alias in the terminal : alias python='python2.6' for instance.

The problem with python 2.7 is not at the compilation but at run-time, it crashes the client on some commands.

douardda commented 10 years ago

I'll try to reproduce it ASAP.

Just to let you know, I've used a bit the Python 2.7 module and for now I've not encountered problems. Do you know which commands are known to crash?

keoo commented 10 years ago

Swig2 support and python 2.7 support added in main branch, will be available in the next release to come