From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Thu Mar 27 2008 - 18:14:23 CDT

On Thu, 27 Mar 2008, John Stone wrote:

JS>
JS> Axel,
JS> Yes, that's correct. It should still be possible to compile
JS> VMD against other versions, but Python 2.5 is what I'll be working

almost. to compile the current cvs against older versions of python
you need to include a hack like the following:

Index: src/py_vmd.C
===================================================================
RCS file: /vmd/cvsroot/vmd/src/py_vmd.C,v
retrieving revision 1.3
diff -u -u -r1.3 py_vmd.C
--- src/py_vmd.C 17 Jan 2008 22:56:59 -0000 1.3
+++ src/py_vmd.C 27 Mar 2008 23:31:19 -0000
@@ -105,7 +105,12 @@
   };
   for (unsigned i=0; i<sizeof(modules)/sizeof(const char *); i++) {
     const char *m = modules[i];
- PyModule_AddObject(vmdmodule, m, PyImport_ImportModule(m));
+#if (PY_MAJOR_VERSION == 2) && (PY_MINOR_VERSION < 5)
+#define CAST_HACK (char *)
+#else
+#define CAST_HACK
+#endif
+ PyModule_AddObject(vmdmodule, CAST_HACK m, PyImport_ImportModule( CAST_HACK m));
   }
 }
 
cheers,
   axel.

-- 
=======================================================================
Axel Kohlmeyer   akohlmey_at_cmm.chem.upenn.edu   http://www.cmm.upenn.edu
   Center for Molecular Modeling   --   University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582,  fax: 1-215-573-6233,  office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.