[Rivet] Rivet bootstrap issues

Andy Buckley andy.buckley at ed.ac.uk
Fri Dec 18 14:54:01 GMT 2009


Hi Holger,

The first of these is a persistent problem in SWIG's generated C++ 
source, although I believed this was now fixed in recent versions. 
Literal strings, e.g. "foo", are of type "char*" in C, but the same 
literal string with a C++ compiler is of type "const char*". Usually 
this just produces a compiler warning rather than an error, though, and 
I thought it was fixed in recent versions of SWIG. What SWIG version is 
being used here? Also, since in this case the C++ compiler is being run 
by Python distutils, maybe it is being run in an incompatible way on 
that platform. What platform is this? RHEL rather than SL? That doesn't 
look like an SL version of Python: far too new!
   You most lively will have success with generating the SWIG files 
(pyext/rivet_wrap.cc and pyext/rivet.py) on a separate system with a 
recent version of SWIG such as the version 1.3.36 found on Ubuntu 
Karmic, and copy them into the build on this platform.
   Alternatively, you can try hacking the pyext/setup.py (or if you want 
to do it "properly", hack pyext/setup.py.in then re-run configure) to 
pass a -Wno-cast-qual argument to the C++ compiler (see 
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html)

For the second problem, the LCG tag guessing function in the bootstrap 
script (yes, there is no LCG standard script to handle this critical 
portability task...) is failing to parse the "gcc -v" output in SUSE 
Linux, probably because of that extra text in square brackets about the 
branch revision. I'll take a look and see if I can make it more robust, 
but you can recommend that he overrides the guessing by passing an 
explicit --lcgtag=1686-Linux-gcc44-opt argument to the bootstrap script: 
we can't handle every weird version string that comes from GCC 
packagings, so sometimes a manual override will be necessary!

Hope that helps,
Andy


Holger Schulz wrote:
> Hi,
> 
> Andzrej is having some trouble trying to install Rivet
> (svn HEAD) on different platforms using the
> bootstrap-script:
> 
>     a) First farm, information about farm :
>      >  uname -a
>     Linux ccali28 2.6.18-164.6.1.el5 #1 SMP Tue Nov 3 23:02:51 EST 2009
>     x86_64 x86_64 x86_64 GNU/Linux
>      > gcc -v
>     gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)
>      > python -V
>     Python 2.6.4
> 
>     The error msg:
>     cc1plus: warning: command line option "-Wstrict-prototypes" is valid
>     for Ada/C/ObjC but not for C++
>     ./rivet_wrap.cc: In function 'int
>     SWIG_Python_ConvertFunctionPtr(PyObject*, void**, swig_type_info*)':
>     ./rivet_wrap.cc:2051: error: invalid conversion from 'const char*'
>     to 'char*'
>     ./rivet_wrap.cc: In function 'int SWIG_AsCharPtrAndSize(PyObject*,
>     char**, size_t*, int*)':
>     ./rivet_wrap.cc:3850: error: cannot convert 'int*' to 'Py_ssize_t*'
>     for argument '3' to 'int PyString_AsStringAndSize(PyObject*, char**,
>     Py_ssize_t*)'
>     ./rivet_wrap.cc: In function 'void
>     SWIG_Python_FixMethods(PyMethodDef*, swig_const_info*,
>     swig_type_info**, swig_type_info**)':
>     ./rivet_wrap.cc:12797: error: invalid conversion from 'const char*'
>     to 'char*'
>     /sps/atlas/s/siodmok/Programs/Install/Rivet/build/rivet/include/Rivet/Math/MathHeader.hh:
>     At global scope:
>     /sps/atlas/s/siodmok/Programs/Install/Rivet/build/rivet/include/Rivet/Math/MathHeader.hh:28:
>     warning: 'Rivet::MAXINT' defined but not used
>     error: command 'gcc' failed with exit status 1
>     make: *** [all-local] Error 1
> 
>     When I made the following changes in the rivet_wrap.cc:
>      > diff rivet_wrap.cc rivet_wrap.ccMy
>     2051c2051
>     <     char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
>     ---
>      >     char *doc = (char*)(((PyCFunctionObject *)obj) -> m_ml ->
>     ml_doc);
>     3850c3850
>     <     PyString_AsStringAndSize(obj, &cstr, &len);
>     ---
>      >     PyString_AsStringAndSize(obj, &cstr, (Py_ssize_t*)&len);
>     12797c12797
>     <       char *c = methods[i].ml_doc;
>     ---
>      >       char *c =(char*)methods[i].ml_doc;
> 
>     Installation went smooth and Rivet seems to work properly but I
>     don't like to change the orginal code,
>     therefore maybe you know how to compile it in a better way? If you
>     need additional information
>     about the farm do not hesitate to ask me.
> 
>     b) Second farm, information about farm :
>      >  uname -a
>     Linux itpssh2 2.6.31.5-0.1-default #1 SMP 2009-10-26 15:49:03 +0100
>     i686 i686 i386 GNU/Linux
>      > gcc -v
>     gcc version 4.4.1 [gcc-4_4-branch revision 150839] (SUSE Linux)
>      > python -V
>     Python 2.6.2
> 
>     In this case I couldn't run the rivet-bootstrap script, the error
>     message was the following:
>      > ./rivet-bootstrap --help
>     Traceback (most recent call last):
>       File "./rivet-bootstrap", line 145, in <module>
>         parser.add_option("--lcgtag", default=compute_lcg_tag(),
>     dest="LCGTAG",
>       File "./rivet-bootstrap", line 81, in compute_lcg_tag
>         gcc_minor = gcc_version[1]
>     IndexError: list index out of range
> 
> Any ideas?
> 
> Holger
> 
> 
> _______________________________________________
> Rivet mailing list
> Rivet at projects.hepforge.org
> http://www.hepforge.org/lists/listinfo/rivet
> 


-- 
Dr Andy Buckley
SUPA Advanced Research Fellow
Particle Physics Experiment Group, University of Edinburgh


More information about the Rivet mailing list