Re: [AMBER-Developers] latest release candidate for AmberTools 1.3

From: Jason Swails <jason.swails.gmail.com>
Date: Wed, 9 Dec 2009 19:50:35 -0500

On Wed, Dec 9, 2009 at 5:55 PM, case <case.biomaps.rutgers.edu> wrote:
> On Wed, Dec 09, 2009, Jason Swails wrote:
>
>> Also, ubuntu's sh seems overly picky about commands that don't look
>> specific to bash. In the new MMPBSA scripts we are writing in python,
>> we use system calls (to call ptraj and sander) that use /bin/sh but
>> don't work on Ubuntu until sh is redirected to /bin/bash.
>
> You should then make one of two fixes:
>
> 1.  Change the scripts to call /bin/bash rather than /bin/sh
> 2.  Fix the scripts so that they work with /bin/sh -> /bin/dash or /bin/ash.

The script is written in python with the command os.system("command"),
which is, as far as I know, the only way of doing a system call in
python. This automatically calls /bin/sh to execute those commands...

> I prefer option 2 for portability, since Unix/BSD/cygwin/others may not
> always have bash.  Certainly, a script should not claim (in its opening
> line) to be written for /bin/sh when it really requires bash.

I agree, though our script was written in python, and I found no way
to explicitly tell it to use bash short of putting "bash;" in each
call (which is also undesirable I'd think).

> The option I really *don't* like: requiring users to change the /bin/sh
> script on their machines.  That's is often a protected file that users don't
> have any control over (e.g. on a supercomputer site).  It also might break
> something else.

This is true, though I have never used a system that did not have
/bin/sh pointing to bash except Ubuntu, which are primarily personal
machines for which users will likely have permission to change that
file, though I agree this is the least attractive solution.

> Aside: what *are* these "system calls" that don't work on Ubuntu?

the command i was using was "ptraj prmtop script >& output"

apparently dash doesn't like the &, so changing these to ptraj prmtop
script > output works, so this is not really an issue for that anymore
(though like I said it was installing other programs that first drove
me to change back to bash in the first place). However, I don't know
the full extent of the differences between bash and dash, so I don't
know if every system call in the script will play nice, and it may
take awhile to find all of them.

-- 
---------------------------------------
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Graduate Student
352-392-4032
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Wed Dec 09 2009 - 17:00:02 PST
Custom Search