GMXLIB can double list of forcefields in pdb2gmx, making -ff flag not work - Redmine #1928
Archive from user: Chris Neale
In gromacs version 5.1.2, the effect of GMXLIB on the behaviour of pdb2gmx has changed since v4.6.7. Now, defining GMXLIB can cause the -ff flag not to work. Also, an empty GMXLIB gives an error, which I would expect to not be the case since gromacs should fall back to the compiled location (I presume GMXLIB is still a colon delimited list of paths).
######## 1: desired behaviour is obtained when GMXLIB is not set:
$ unset GMXLIB
$ gmx pdb2gmx ...
Select the Force Field:
From '/nh/nest/u/cneale/exe/GROMACS/exec/gromacs-5.1.2/serial/share/gromacs/top':
1: AMBER03 protein, nucleic AMBER94 (Duan et al., J. Com Chem. 24, 1999-2012, 2003)
2: AMBER94 force field (Cornell et al., JACS 117, 5179-5197, 1995)
3: AMBER96 protein, nucleic AMBER94 (Kollman et al., Acc. Chem. Res. 29, 461-469, 1996)
...
######## 2: explicitly setting GMXLIB to the compile directory gives two copies of everything:
$ echo $GMXLIB
/nh/nest/u/cneale/exe/GROMACS/exec/gromacs-5.1.2/serial/share/gromacs/top
$ gmx pdb2gmx ...
Select the Force Field:
From '/nh/nest/u/cneale/exe/GROMACS/exec/gromacs-5.1.2/serial/share/gromacs/top':
1: AMBER03 protein, nucleic AMBER94 (Duan et al., J. Com Chem. 24, 1999-2012, 2003)
2: AMBER03 protein, nucleic AMBER94 (Duan et al., J. Com Chem. 24, 1999-2012, 2003)
3: AMBER94 force field (Cornell et al., JACS 117, 5179-5197, 1995)
4: AMBER94 force field (Cornell et al., JACS 117, 5179-5197, 1995)
5: AMBER96 protein, nucleic AMBER94 (Kollman et al., Acc. Chem. Res. 29, 461-469, 1996)
6: AMBER96 protein, nucleic AMBER94 (Kollman et al., Acc. Chem. Res. 29, 461-469, 1996)
...
NOTE: this causes a problem when combined with -ff flag to pdb2gmx:
Program: gmx pdb2gmx, VERSION 5.1.2
Source file: src/gromacs/gmxpreprocess/pdb2tocpp (line 199)
Function: void choose_ff_impl(const char*, char*, int, char*, int)
Inconsistency in user input:
Force field 'amber03' occurs in 2 places, but not in the current directory.
Run without the -ff switch and select the force field interactively.
######## 3: setting an empty string for GMXLIB gives an error:
$ GMXLIB=""
$ gmx pdb2gmx ...
Program: gmx pdb2gmx, VERSION 5.1.2
Source file: src/gromacs/utility/directoryenumerator.cpp (line 279)
Function: gmx::DirectoryEnumerator::DirectoryEnumerator(const char*, bool)
Assertion failed:
Condition: dirname != NULL && dirname[0] != '\0'
Attempted to open empty/null directory path
(from redmine: issue id 1928, created on 2016-03-25 by gmxdefault, closed on 2018-01-03)
- Changesets:
- Revision 5fd2b449 by Teemu Murtola on 2016-03-26T05:45:42Z:
Ignore empty GMXLIB
If the GMXLIB env.var. was set, but empty, it triggered an assert
(at least) in pdb2gmx. Now this case is silently handled as if
the variable wasn't set at all.
Part of #1928.
Change-Id: I51646ec659d119b20b7cb429f9292bffa5775aaa
- Revision 2873d40f by Erik Lindahl on 2018-01-03T11:14:40Z:
Remove duplications in GMXLIB search paths
Remove entries that are duplicated, or identical
to the default search path, to avoid e.g.
listing identical force fields multiple times.
Fixes #1928.
Change-Id: Ib3caa116b4a6e1ce50424408832a96da52eba774