From: Axel Kohlmeyer (akohlmey_at_cmm.chem.upenn.edu)
Date: Wed Mar 04 2009 - 08:55:24 CST

On Wed, Mar 4, 2009 at 7:00 AM, Amr Rizq <Amr.Rizq_at_bibalex.org> wrote:
> Dear all,
>
> When I tried to make an IMD Simulation by using a compiled VMD 1.8.6 source (I compiled using OpenGL option for display device), I cannot connect to a running NAMD 2.6 (from VMD Menu: Extensions->Simulation->IMD Connect). I always receive the following error (in VMD log):
>
> ERROR) Unable to ascertain relative endianness of remote machine
>
> Investigating the NAMD log I noticed that error:
>
> Warning: Incompatible Interactive MD, use VMD v1.4b2 or higher
> Warning: IMD connection failed
>
> But I could be able to connect between the distributed binary version of VMD and binary distributed or compiled version of NAMD. For a version of VMD which I compiled myself and tried to connect to a running NAMD, I failed to connect.
> What's wrong here?And why didn't VMD, which I compiled, connect to NAMD?

are you using a gcc-4.x compiler? then the 1.8.6 version has a
problem. you either
have to compiler with -fno-strict-aliasing or include the following
change into your sources.

[xxx_at_yyy src]$ cvs diff -u -r1.13 imd.C
Index: imd.C
===================================================================
RCS file: /vmd/cvsroot/vmd/src/imd.C,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -u -r1.13 -r1.14
--- imd.C 27 Mar 2008 19:36:51 -0000 1.13
+++ imd.C 16 May 2008 18:49:06 -0000 1.14
@@ -11,7 +11,7 @@
  *
  * $RCSfile: imd.C,v $
  * $Author: johns $ $Locker: $ $State: Exp $
- * $Revision: 1.13 $ $Date: 2008/03/27 19:36:51 $
+ * $Revision: 1.14 $ $Date: 2008/05/16 18:49:06 $
  *
  ***************************************************************************
  * DESCRIPTION:
@@ -65,7 +65,8 @@
 static int32 imd_ntohl(int32 n) {
   int32 h = 0;
   netint net;
- net = *((netint *)&n);
+
+ memcpy((void *)&net,(void *)&n, sizeof(n));
   h |= net.highest << 24 | net.high << 16 | net.low << 8 | net.lowest;
   return h;
 }

cheers,
    axel.

>
> Best regards,
>
> Amr Rizq
>
>

-- 
=======================================================================
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.