Ibrahim M. Moustafa wrote:
Hi gmx-users,

   I have a little problem with gromacs-3.3.1 installed on a Mac-OSX.
After installation (either building the package myself as instructed, or using a binary form GROMACS web site) I could not run any program with just typing the name on the xterm! for example, issuing "pdb2gmx" command line gives an error message "segmentation fault". However, typing the whole path name "$GMXBIN/pdb2gmx or any other modules " works fine. The variables for GROMACS are configured after the installation. My .cshrc sources from the GMXRC.csh and the variables are defined; the PATH includes the $GMXBIN also. For the moment, I'm using alias to define the whole path for GROMACS programs to run; though, this a bit annoying.

I posted this problem in CCL and M.L. Dodson, replied with some explanation for this weird problem:

 " Ahh... Think I have it.  Looking at the source code on my BSD Unix
box, I see in src/gmxlib/copyrite.c the following:

void CopyRight(FILE *out,char *szProgram)
{
  /* Dont change szProgram arbitrarily - it must be argv[0], i.e. the
   * name of a file. Otherwise, we won't be able to find the library dir.
   */
#define NCR (int)asize(CopyrightText)
#define NGPL (int)asize(GPLText)

  char buf[256],tmpstr[1024];

  char *ptr;

  int i;

  set_program_name(szProgram);
 .
 .
 .

So I was right, it does use argv[0] for something: finding its
library directory."

I wonder if there is a quick fix for this in the code, so I can run the programs by just typing the name without need for the whole path!

A question here: if Dodson is right, why the programer wrote the code this way! is there any advantage?

P.S. I have no previous experience with GROMACS

     thanks,
   Ibrahim
_______________________________________________
gmx-users mailing list    gmx-users@gromacs.org
http://www.gromacs.org/mailman/listinfo/gmx-users
Please don't post (un)subscribe requests to the list. Use the www interface or send it to [EMAIL PROTECTED]
Can't post? Read http://www.gromacs.org/mailing_lists/users.php
Have you tried
source $GMXBIN/GMXRC
It will set up the necessary environment variables after which you can run it as usual (I do it all the time on my Macs).

The advantage with this code is that you should be able to move the entire gromacs installation somewhere else.

--
David.
________________________________________________________________________
David van der Spoel, PhD, Assoc. Prof., Molecular Biophysics group,
Dept. of Cell and Molecular Biology, Uppsala University.
Husargatan 3, Box 596,          75124 Uppsala, Sweden
phone:  46 18 471 4205          fax: 46 18 511 755
[EMAIL PROTECTED]       [EMAIL PROTECTED]   http://folding.bmc.uu.se
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
_______________________________________________
gmx-users mailing list    gmx-users@gromacs.org
http://www.gromacs.org/mailman/listinfo/gmx-users
Please don't post (un)subscribe requests to the list. Use the www interface or send it to [EMAIL PROTECTED]
Can't post? Read http://www.gromacs.org/mailing_lists/users.php

Reply via email to