Project

General

Profile

Bug #345

gmxcpp incorrect path behavior

Added by Berk Hess about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

The Gromacs cpp code does not change the search path
when parsing an included file that is not in the current directory.
The current directory should be changed to the one where the file
currently parsed resides.
The attached file gives an example of this problem.
But I guess that currently we also have the incorrect behavior
that gmxcpp will search also in the work directory for files
included from files in, for instance, the share/top directory.

Berk

cpp_subdir.tar (20 KB) cpp_subdir.tar example system Berk Hess, 09/18/2009 12:25 PM

History

#1 Updated by Berk Hess about 10 years ago

Created an attachment (id=387)
example system

Added example.

#2 Updated by David van der Spoel about 10 years ago

I think I've fixed it in the git master. I hope the chdir is portable enough. Please test. The example did not contain a conf.gro though. The debug output (grompp -debug 1) shows the chdir commands (search for GMXCPP).

#3 Updated by Berk Hess about 10 years ago

My test case now work and it also, correctly, gives an error
when I include a file present only in the original dir from
an itp file in the subdir.
We will need this to reorganize the force field files such that
each force field has its own subdir.

Berk

#4 Updated by Berk Hess about 10 years ago

Ah, forgot to say that you should also commit this fix in the 4.0
release branch.
(If you are lucky you can use git cherry-pick)

Berk

Also available in: Atom PDF