[AMBER-Developers] long path names

From: Eric Pettersen <pett.cgl.ucsf.edu>
Date: Thu, 18 Mar 2010 16:27:46 -0700

Hi all,
        I recently upgraded the version AmberTools that Chimera was using to
1.3 with all patches applied (please don't ask what version it was
using before!). Compilation wasn't excessively difficult but I found
I was getting random crashes with various charge calculations (e.g.
bccharge() in antechamber/charge.c). Tracking down the cause was a
headache. It turns out that string buffers used to compose commands
to hand off to system() were only allocated as 256 characters
(MAXCHAR). Now, in Chimera on a mac, the Amber executables typically
live in a directory like:

/Users/pett/Applications/Chimera-daily-aqua.app/Contents/Resources/bin/
amber11/bin

and the input/output files are in temporary system folders like:

/var/folders/VH/VHqktDJe2RWZSE+1YwqPE+++Hpc/-Tmp-/tmp4iniru

So you can see how an executable, a couple of input files, and an
output file could easily overflow 256 characters. When I recompiled
with MAXCHAR set to 2048 all the mysterious crashes went away.

        I guess I'm proposing that either MAXCHAR be increased to at least 2K
(most modern shells allocate 4K or more for commands) or that there be
a separate macro (MAXCMD?) for strings that are supposed to be handed
off to system().

--Eric

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         http://www.cgl.ucsf.edu


_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Thu Mar 18 2010 - 16:30:02 PDT
Custom Search