alexxy/gromacs.git
11 years agoMerge "Reorganize CommandLineHelpWriter implementation."
Christoph Junghans [Tue, 4 Sep 2012 16:41:17 +0000 (18:41 +0200)]
Merge "Reorganize CommandLineHelpWriter implementation."

11 years agoMerge "Fix SelectionParserParameter move constructor problem."
Christoph Junghans [Tue, 4 Sep 2012 16:40:50 +0000 (18:40 +0200)]
Merge "Fix SelectionParserParameter move constructor problem."

11 years agoReorganize CommandLineHelpWriter implementation.
Teemu Murtola [Sun, 26 Aug 2012 03:50:07 +0000 (06:50 +0300)]
Reorganize CommandLineHelpWriter implementation.

Instead of separate classes to write out descriptions and different
types of options, there is now three main local classes:
 - OptionsFilter: has output format independent logic to do the
   filterting that was previously implemented in each class separately.
 - OptionsFormatterInterface: interface that OptionsFilter uses to do
   output format specific formatting for the options.
 - OptionsConsoleFormatter: implements the above interface to produce
   the console help that was previously done by the separate classes.

Prerequisite for #969 independent of the chosen solution.
May need additional work as part of that issue.

Change-Id: Ica506f3567b4527f210c48c1b43069d4b64007ec

11 years agoRemove obsolete .gitignore entries.
Teemu Murtola [Fri, 31 Aug 2012 04:30:13 +0000 (07:30 +0300)]
Remove obsolete .gitignore entries.

Now that binaries are built under bin/ and libraries under lib/, most
.gitignore files are unnecessary (and they didn't work previously that
well, either).

Change-Id: Id438f45e896a0d0018c80feafc32242067248855

11 years agoMore generic way to obtain OptionInfo for options.
Teemu Murtola [Thu, 30 Aug 2012 19:08:55 +0000 (22:08 +0300)]
More generic way to obtain OptionInfo for options.

Options::addOption() now returns a pointer to the OptionInfo object that
corresponds to the created option.  This provides a nicer and more
generic way compared to SelectionOption::getAdjuster(), and hopefully
makes it easier for static analysis and compilers to understand that the
info object always gets initialized to a non-NULL value.

Since this change requires the declaration of the corresponding info
object to be available whenever addOption() is called, one could also
get rid of the separate *optioninfo.h headers and merge them to the
corresponding *option.h headers.  This would reduce the number of files
for one option type, and possibly make it a bit easier to maintain.
Didn't do that in this change to keep it more clear.

Change-Id: I143592ed3a0750d3908c6bc8897179d9059ea546

11 years agoFix SelectionParserParameter move constructor problem.
Teemu Murtola [Thu, 30 Aug 2012 02:58:05 +0000 (05:58 +0300)]
Fix SelectionParserParameter move constructor problem.

C++11 only declares move constructors implicitly if a class does not
have a user-defined destructor.

Change-Id: I3c12b0e93920c102d77bb436c417ceef90a9c6c6

11 years agoEnable C++ use in selection methods.
Teemu Murtola [Fri, 24 Aug 2012 09:56:42 +0000 (12:56 +0300)]
Enable C++ use in selection methods.

The method that frees the internal data structure for a selection method
now also has the responsibility of freeing the data structure itself.
This makes it possible to allocate the data structure using operator new
in the initialization function, and then correctly free it.

Prerequisite for using C++ types in selection methods before #652 is
implemented.

Change-Id: I99e5a907cbdc4975d20becb0fb1d33e0026c135c

11 years agoAdd syntax to force selection string matching mode.
Teemu Murtola [Fri, 24 Aug 2012 09:42:19 +0000 (12:42 +0300)]
Add syntax to force selection string matching mode.

The selection syntax for string keyword matching no longer depends on
whether regular expression support is available.  Instead, an error is
now given if the string looks like a regexp (the logic for the deduction
is not changed), but regexp support is not available.  Added syntax to
force the string matching to use either literal, wildcard, or regexp
matching.

This change allows removing a few more direct prints to stderr (related
to #655).

Closes #938.

Change-Id: I7b998050c8b00b5f1229ed23a0a15685c514010f

11 years agoRemove remaining GMX_ERROR uses.
Teemu Murtola [Thu, 23 Aug 2012 17:44:31 +0000 (20:44 +0300)]
Remove remaining GMX_ERROR uses.

Replaced those still left in selection parsing code by exceptions or
assertions.

Related to #655 and #880.

Change-Id: I89bff0c03eb15176e699529888aaae532f0c4138

11 years agoFix internal error with selection "resname help".
Teemu Murtola [Thu, 23 Aug 2012 04:00:56 +0000 (07:00 +0300)]
Fix internal error with selection "resname help".

- Always recognize "help" as a help request token, which then causes a
  syntax error in invalid context instead of an internal error in the
  tokenizer symbol table lookup.
- Change the internal error in question to use an exception for error
  reporting to make it possible to easily check it in a unit test.

Change-Id: I4a4057840b47a818cc840654945e84ec536e35b0

11 years agoHandle SelectionParserParameter as a value type.
Teemu Murtola [Thu, 23 Aug 2012 03:24:07 +0000 (06:24 +0300)]
Handle SelectionParserParameter as a value type.

Now that SelectionParserValue is also a C++ object, it is
straightforward to treat SelectionParserParameter as a (movable, but not
copyable) value type instead of storing it through a smart pointer in a
container.  Leads to more consistent and less complex code.

Related to #655 and #880.

Change-Id: I377bac05b1bd990ad95b38887f0f7b825bf0a805

11 years agoC++ classes for selection parser values.
Teemu Murtola [Wed, 22 Aug 2012 15:32:29 +0000 (18:32 +0300)]
C++ classes for selection parser values.

Converted t_selexpr_value to gmx::SelectionParserValue and introduced
smart pointers and standard containers to manage all memory related to
these objects.

Related to #655 and #880.

Change-Id: Ide2d9db80e89f36c94dccc25085d49959e4115a8

11 years agoC++ classes for selection parser parameters.
Teemu Murtola [Fri, 17 Aug 2012 11:13:40 +0000 (14:13 +0300)]
C++ classes for selection parser parameters.

Converted t_selexpr_param to gmx::SelectionParserParameter and
introduced smart pointers and standard containers to manage all memory
related to these objects.  Solves several exception safety issues in the
selection parser.

Related to #655 and #880.

Change-Id: Ia4c477f1313b49cd1da3b0407bec6e7a1a8b9296

11 years agoC++ classes for selection parser symbol table.
Teemu Murtola [Sat, 11 Aug 2012 11:53:38 +0000 (14:53 +0300)]
C++ classes for selection parser symbol table.

Convert the implementation of selection parser symbol table to use C++
classes.
 - Removes a few exception safety issues that were present in the
   initialization, as well as direct prints to stderr.
 - Documentation now follows the new Doxygen layout.
 - Removes some underscore-prefixed global names.

Related to #655 and #880.

Change-Id: Iecb690fa2e413c9dc487aacffac62a248ea3867a

11 years agoRationalize selection element name handling.
Teemu Murtola [Thu, 2 Aug 2012 19:13:24 +0000 (22:13 +0300)]
Rationalize selection element name handling.

The name of SelectionTreeElement is now a plain std::string that manages
its own memory instead of pointing to memory managed somewhere else.
The original design has been a pain to maintain at times, as the memory
for the name easily gets freed, leaving a dangling pointer.

Change-Id: I7b975c67ce9eee7f981128e29d8d9dd75fc70c89

11 years agoMoved selection parser helpers into separate file.
Teemu Murtola [Sun, 12 Aug 2012 09:24:45 +0000 (12:24 +0300)]
Moved selection parser helpers into separate file.

Makes parser.y much more streamlined, as there is now nearly only Bison
declarations and the actual semantic actions.  Also, editing the helpers
no longer requires regenerating the parser (which most likely also
changes the line numbers in parser.cpp, which is typically the largest
part of such changes).

Change-Id: I60e76b95725fb9f647f3cddf64773b3f94185b06

11 years agoUse smart pointers to manage the selection tree.
Teemu Murtola [Thu, 2 Aug 2012 04:14:25 +0000 (07:14 +0300)]
Use smart pointers to manage the selection tree.

Changed t_selelem to gmx::SelectionTreeElement and t_selelem * to
gmx::SelectionTreeElementPointer (or a const reference).  The latter is
a boost::shared_ptr because there may be multiple references to some
elements in the evaluation tree.  Some exceptions to the above rule are
present, because it was not straightforward to change those parts.

Prerequisite for using exceptions throughout the selection code, which
in turn is a prerequisite for many tasks that would introduce more C++
there.

There are some parts that are not yet exception-safe, but may throw
std::bad_alloc as the result of these changes.  Will fix those in
subsequent commits.

Related to #655 and #880.

Change-Id: Ib36c08bac1ab2c9818604e45e2eb14a90069efdb

11 years agoRemove most uses of t_selelem::refcount.
Teemu Murtola [Sat, 28 Jul 2012 19:35:28 +0000 (22:35 +0300)]
Remove most uses of t_selelem::refcount.

This is a prerequisite for using smart pointers to manage the selection
evaluation tree, as it's difficult to keep a similar reference count
up-to-date and (or use pointer reference counts for the purposes it is
currently used for).

Related to #655 and #880.

Change-Id: I9e6ae98067f8fe96d39aea6df076e2675ecb8a1f

11 years agoAdded a sfree_guard for exception safety.
Teemu Murtola [Thu, 2 Aug 2012 04:11:44 +0000 (07:11 +0300)]
Added a sfree_guard for exception safety.

Added a helper class for calling sfree() on scope exit.  This is useful
for exception safety in code that calls old C functions, as well as in
piecewise conversion of old code to use exceptions.

Change-Id: Ie31483734b66895ad8148eff3db0300ae28b38b4

11 years agoImprove the build system for gmx_header_config.h.
Teemu Murtola [Wed, 8 Aug 2012 04:02:38 +0000 (07:02 +0300)]
Improve the build system for gmx_header_config.h.

- Configure gmx_header_config.h in the binary directory to make it work
  with multiple coexisting binary directories.
- Or rather, configure a gmx_header_config_gen.h there, and include it
  using a relative path from a fixed gmx_header_config.h.  Add location
  of the generated file to include path.  This makes relative include
  paths still work in the source, as headers can continue to include
  gmx_header_config.h, which is still in the source tree.
- Add Doxygen comments for the files, with an explicit todo item to try
  to get rid of the CMake-generated defines (or even better, all of
  them).
- Make config.h include gmx_header_config.h to make it easier (and less
  error-prone) to move stuff between these two headers.  Remove
  unnecessary (after this change) #includes for gmx_header_config.h
  from source files.

Fixes #991.

Change-Id: Ib9686356c681b8fd2cce34511557566c9f4d20a2

11 years agoMerge "Clarify TestFileManager naming and comments."
Christoph Junghans [Mon, 6 Aug 2012 17:20:32 +0000 (19:20 +0200)]
Merge "Clarify TestFileManager naming and comments."

11 years agoImprove Doxygen output layout.
Teemu Murtola [Mon, 11 Jun 2012 04:35:30 +0000 (07:35 +0300)]
Improve Doxygen output layout.

- Move detailed description to the top.  Mainly wanted to do this for
  modules (because the member lists can be quite long, and the
  description is the most interesting part), but did it for other
  entities as well for consistency.
- Move the file list to the end of the module documentation because it
  takes so much space.
- Removed namespace documentation from file docs, since there aren't
  that many namespaces, so it doesn't make sense to repeat their
  documentation for each file.
- Rename the "Related Pages" tab to "Other Docs" and move it after the
  "Modules" tab.

Related to #638.

Change-Id: Iefccac61d611be9d7a13dfef4df29781e3b54cca

11 years agoClarify TestFileManager naming and comments.
Teemu Murtola [Sun, 5 Aug 2012 05:54:09 +0000 (08:54 +0300)]
Clarify TestFileManager naming and comments.

- Rename datapath.* to testfilemanger.*, since they now only declare
  that one class.
- Make functions that return input data paths have "Input" explicitly in
  their name to make it clear what data path they are returning.  Also
  remove redundant "Test" from the names and replace "Path" by
  "Directory" for the functions that deal with directories.
- Some Doxygen documentation updates.

Change-Id: If80b5d83d075f3ce29b7b40c0d17f319166332b8

11 years agoFix GMX_USE_RELATIVE_INSTALL_PATH with GMX_INTERNAL_BOOST
Roland Schulz [Sun, 29 Jul 2012 15:12:37 +0000 (11:12 -0400)]
Fix GMX_USE_RELATIVE_INSTALL_PATH with GMX_INTERNAL_BOOST

GMX_USE_RELATIVE_INSTALL_PATH was added by 62967269 and the merge
3791fc5e didn't make the required change for boost.

Change-Id: I5b9b890a2fac034b39d6b07fc39ca429f608c40a

11 years agoReorganize Doxygen build.
Teemu Murtola [Mon, 23 Jul 2012 15:55:44 +0000 (18:55 +0300)]
Reorganize Doxygen build.

- All doxygen-related cmake code and input files are now under
  doxygen/.
- Renamed the unsuffixed Doxyfile to Doxyfile-full for consistency, and
  renamed the output directory and custom target as well.
- Added a target to build all three types of doxygen documentation in
  one go.
- Added an index.html file as a starting point for browsing all three
  levels of documentation.

Related to #638.

Change-Id: Ia977c1aa93c55f152a15e560a60c8a1323e5d3f8

11 years agoMerge "Increase miminum boost version to 1.44"
Christoph Junghans [Sat, 28 Jul 2012 23:53:18 +0000 (01:53 +0200)]
Merge "Increase miminum boost version to 1.44"

11 years agoMerge "Fix a few doxygen warnings."
Christoph Junghans [Sat, 28 Jul 2012 23:52:23 +0000 (01:52 +0200)]
Merge "Fix a few doxygen warnings."

11 years agoMerge "Fix clang 3.2 warnings."
Roland Schulz [Sat, 28 Jul 2012 21:44:22 +0000 (23:44 +0200)]
Merge "Fix clang 3.2 warnings."

11 years agoIncrease miminum boost version to 1.44
Roland Schulz [Sat, 28 Jul 2012 00:18:42 +0000 (20:18 -0400)]
Increase miminum boost version to 1.44

Tested serveral earlier version and they had each different problems.
1.43: Warnings without C++11, Error with C++11 (gcc 4.7.1)

Change-Id: If94ead13fca410d7ae6c70888d11de5feb1e3921

11 years agoFix clang 3.2 warnings.
Teemu Murtola [Fri, 27 Jul 2012 17:39:50 +0000 (20:39 +0300)]
Fix clang 3.2 warnings.

Majority of these were false positives, but the fixes were simple.
Took the simplest route with gtest and edited the source.  We just need
to fix this thing again if/when we update to a newer version if it isn't
fixed upstream.

Change-Id: I5007d26ac9f38c61d5f0258d5bd4ccb7c08f4336

11 years agoFix a few doxygen warnings.
Teemu Murtola [Fri, 27 Jul 2012 04:25:36 +0000 (07:25 +0300)]
Fix a few doxygen warnings.

These gave warnings only on some versions of Doxygen. The issue in
numa_alloc.h resulted in undesirable output on 1.8, which didn't give
the warning.

Change-Id: I8129b3cab156eda601cdb7e4ccc0073bb9602854

11 years agoMerge remote-tracking branch 'origin/release-4-6' into HEAD
Roland Schulz [Thu, 26 Jul 2012 23:32:43 +0000 (19:32 -0400)]
Merge remote-tracking branch 'origin/release-4-6' into HEAD

Conflicts:
CMakeLists.txt

Change-Id: Icf9d0d92b977e35d42d55f1a077a2cdc8fbad86f

11 years agoMerge changes I33cd59e6,I8a2e539f
Christoph Junghans [Thu, 26 Jul 2012 22:41:06 +0000 (00:41 +0200)]
Merge changes I33cd59e6,I8a2e539f

* changes:
  Draft support for multiple help output formats.
  Improve option initialization in traj. analysis.

11 years agoFix that VMD version check was performed for binary not plugin
Roland Schulz [Tue, 3 Jul 2012 00:05:19 +0000 (20:05 -0400)]
Fix that VMD version check was performed for binary not plugin

Gromacs is not using the VMD binary and thus it is not very
insightful to check the VMD binary version. Also checking the VMD
binary version was potential very slow.
The new code tries to find and load one of the VMD plugins and
check the version of the plugin.

Change-Id: Iba7be9cb742c530ce4edb8963597b8ea467e5520

11 years agoMerge "cmake: allow switch between single and double" into release-4-6
Roland Schulz [Wed, 25 Jul 2012 23:27:56 +0000 (01:27 +0200)]
Merge "cmake: allow switch between single and double" into release-4-6

11 years agoMerge "fix a segfault in sse_mask_init" into release-4-6
Roland Schulz [Wed, 25 Jul 2012 23:24:54 +0000 (01:24 +0200)]
Merge "fix a segfault in sse_mask_init" into release-4-6

11 years agoFix installation rules for man pages: don't install gromacs.7.cmakein
Roland Schulz [Tue, 24 Jul 2012 11:44:07 +0000 (07:44 -0400)]
Fix installation rules for man pages: don't install gromacs.7.cmakein

8c87e60 added gromacs.7.cmakein and didn't add an exclusion rule.

Change to CPackInit.cmake: Removing wrong (incorrect path) and unnessary file in message.

Change-Id: I8fe7436b8164d80ad6db64eb54dc81424cd44e4a

11 years agoAdd default root folder to cpack archives
Roland Schulz [Tue, 24 Jul 2012 11:26:07 +0000 (07:26 -0400)]
Add default root folder to cpack archives

Fixes that source archives had no root folder. If non-default
root folder for binary archives is wanted, this still can be
achived by:
cmake -DGMX_INSTALL_PREFIX={path}/ -DCPACK_INCLUDE_TOPLEVEL_DIRECTORY=0

Fixes #977

Change-Id: Iaf42afd3617873e5c1e5e7cb7c327986efa20fcd

11 years agoMerge remote-tracking branch 'gerrit/release-4-6'
Teemu Murtola [Tue, 24 Jul 2012 04:37:37 +0000 (07:37 +0300)]
Merge remote-tracking branch 'gerrit/release-4-6'

Conflicts:
    src/gromacs/selection/compiler.cpp (resolved in favor of master)

Change-Id: I4d6696dbac8c2cc4dd9fdd1f3b9601bd1856dff0

11 years agoClean up of environment variables
Mark Abraham [Tue, 24 Jul 2012 00:16:27 +0000 (10:16 +1000)]
Clean up of environment variables

In particular, reduce ambiguous usage of "force".

Refs #974

Change-Id: Ia6178ce3392f66451341dd7a4af98312f9e72c0f

11 years agocmake: allow switch between single and double
Christoph Junghans [Thu, 19 Jul 2012 22:34:54 +0000 (16:34 -0600)]
cmake: allow switch between single and double

* only use FFTW_INCLUDE_DIR and FFTW_LIBRARY if user set them
* otherwise do not initialize them
* description will still show up in ccmake as advanced
* fixes #971 (linking error when switching without "make rebuild_cache")

Change-Id: Idfce7d912c3d432f48fd3a7021c8c04d6311569b

11 years agofix a segfault in sse_mask_init
Berk Hess [Tue, 17 Jul 2012 16:50:24 +0000 (10:50 -0600)]
fix a segfault in sse_mask_init

* work array was unaligned in some cases
* fixes #970

Change-Id: I1b474019bf93e6ef6f7cc935aa3f73f2597a91a8

11 years agoMerge "Removed commas from gmx_hbond OpenMP constructs." into release-4-6
Christoph Junghans [Mon, 16 Jul 2012 15:26:35 +0000 (17:26 +0200)]
Merge "Removed commas from gmx_hbond OpenMP constructs." into release-4-6

11 years agoMerge "Enforced rotation: PBC/restart fix" into release-4-6
Christoph Junghans [Mon, 16 Jul 2012 15:25:35 +0000 (17:25 +0200)]
Merge "Enforced rotation: PBC/restart fix" into release-4-6

11 years agoDraft support for multiple help output formats.
Teemu Murtola [Sun, 15 Jul 2012 09:51:07 +0000 (12:51 +0300)]
Draft support for multiple help output formats.

- Added a HelpWriterContext class. An instance is now passed to all
  methods that write help text.  In addition to keeping track of the
  output format, it also allows other context information to be kept
  (e.g., for formatting reasonable cross-references; earlier I had to
  remove those that were in the selection help because static text was
  not appropriate for all situations).
- Moved current output format specific methods to be members of this
  class.
- Adjusted using methods to work as before for console output, but did
  not yet implement any additional output formats.  All methods with
  console-specific code now throw a NotImplementedError to make it easy
  to find them once #969 is decided.

Once there has been some discussion on the markup and output formats
in #969, this approach can be extended to actually implement it.
No matter which of the alternatives is chosen, the parts in this commit
are useful, but the decisions made in #969 affect the direction to which
the implementation should be extended.

Prerequisite for #969.

Change-Id: I33cd59e6f3b5450db99e0e1afba4a2d1b9e30e29

11 years agoTake first description if programs.txt has more than one entry
Roland Schulz [Wed, 11 Jul 2012 19:31:33 +0000 (15:31 -0400)]
Take first description if programs.txt has more than one entry

26bd5f7ac took the last description of programs.txt. I wasn't
aware at the time that programs.txt can have more than one
description for one program. I think this is not a particularly
good to allow more than one description, and then somewhat
arbitrary take the first one. But this is how mknroff.pl behaved
and I don't want to change more then needed at this point.

Change-Id: Ia4fba1b1a66baab8b409fbb3932ee099cec80298

11 years agoMerge "Autogenerate gromacs.7 from programs.txt" into release-4-6
David van der Spoel [Sun, 15 Jul 2012 12:44:04 +0000 (14:44 +0200)]
Merge "Autogenerate gromacs.7 from programs.txt" into release-4-6

11 years agoAdding missing entries in programs.txt
Roland Schulz [Tue, 10 Jul 2012 16:49:32 +0000 (12:49 -0400)]
Adding missing entries in programs.txt

Change-Id: I323524d32f07409c02de6066a24e73fb8a966481

11 years agoRemoved commas from gmx_hbond OpenMP constructs.
Teemu Murtola [Sun, 15 Jul 2012 09:44:39 +0000 (12:44 +0300)]
Removed commas from gmx_hbond OpenMP constructs.

Commas between clauses within #pragma omp caused compilation to fail
with some compilers (e.g., gcc 4.2 on OS X 10.5), even with OpenMP
disabled.

Change-Id: I089d67a6442a745faa3bf5e3be1c779855725a67

11 years agoMerge release-4.5-patches into HEAD
Roland Schulz [Fri, 13 Jul 2012 13:04:58 +0000 (09:04 -0400)]
Merge release-4.5-patches into HEAD

Conflicts:
src/mdlib/mdebin.c
src/mdlib/minimize.c
src/tools/gmx_hbond.c
src/tools/gmx_tune_pme.c

Change-Id: I114f1ab4d58c9ccca0261e8588b61c39feaae874

11 years agoFlat-bottomed position restraints
Jochen Hub [Fri, 22 Jun 2012 15:56:48 +0000 (17:56 +0200)]
Flat-bottomed position restraints

Conflicts:
src/gromacs/gmxlib/bondfree.c
src/gromacs/gmxlib/tpxio.c
src/gromacs/mdlib/sim_util.c

Change-Id: I89feae17d1304bc9acde61c9303e9f9fdd4d04e8

11 years agoImprove option initialization in traj. analysis.
Teemu Murtola [Wed, 11 Jul 2012 08:25:03 +0000 (11:25 +0300)]
Improve option initialization in traj. analysis.

All methods that add options to an options object now take an externally
provided options object.  This both simplifies the calling code,
allowing them to control the lifetime of the objects, as well as the
implementing code, since they no longer need to have an internal options
object just for the purpose of returning it.  With the old interface, it
was also impossible to get a reference to the options object more than
once; with the new, the caller has much more flexibility.

Change-Id: I8a2e539fa5abefe696a26919b8591691a1cccc61

11 years agoExtended g_wham to allow the selection of the pull groups to be applied in WHAM
Jochen Hub [Wed, 20 Jun 2012 18:54:40 +0000 (20:54 +0200)]
Extended g_wham to allow the selection of the pull groups to be applied in WHAM

Also did a lot of minor cleanup and documentation to move to C++.

Change-Id: I4c2ac3bbc9c7d8247d9423997027f1c79761e74b

11 years agoAdding missing entries in programs.txt
Roland Schulz [Tue, 10 Jul 2012 16:32:05 +0000 (12:32 -0400)]
Adding missing entries in programs.txt

Change-Id: I3b7879fc93d9b3a7c5eed5f14825331a12589b25

11 years agoUse relative rpath to support relocatable binary packages
Roland Schulz [Tue, 10 Jul 2012 07:28:24 +0000 (03:28 -0400)]
Use relative rpath to support relocatable binary packages

Change-Id: I7ec8707acf021b0f168691014fb0ba2f68ae29a6

11 years agoMerge remote-tracking branch 'origin/release-4-6' into HEAD
Roland Schulz [Tue, 10 Jul 2012 04:46:15 +0000 (00:46 -0400)]
Merge remote-tracking branch 'origin/release-4-6' into HEAD

Conflicts:
admin/mknroff.pl (deleted)
share/template/CMakeLists.txt (added both)
src/CMakeLists.txt (trivial)
src/gromacs/gmxlib/oenv.cpp (see next)
src/gromacs/gmxlib/statutil.cpp (change moved to
           src/gromacs/utility/programinfo.cpp)
src/kernel/CMakeLists.txt (added gmx_add_man_page
           to programs/*/CMakeLists.txt)
src/kernel/mk_ghat.c (was deleted. no change)
src/ngmx/CMakeLists.txt (trivial)

Change-Id: Ic8c69541f8d801e3b1d32b26e886cf0602c34cf4

11 years agoAllow usage of relative install paths
Roland Schulz [Sun, 8 Jul 2012 16:56:05 +0000 (12:56 -0400)]
Allow usage of relative install paths

Relative install paths is recommended(*) and required by some
cpack generators (e.g. NSIS). Using relative install paths should
always work, but to take no risks the absolute install paths are
still the default.

*) http://www.cmake.org/pipermail/cmake/2008-May/021663.html

Change-Id: Ie656d5fcfa62f9c7e0fee605c90251084a421a72

11 years agoMerge "Fixed bug in sfactor.c that makes g_rdf -sq give wrong results." into release...
Christoph Junghans [Mon, 9 Jul 2012 23:44:01 +0000 (01:44 +0200)]
Merge "Fixed bug in sfactor.c that makes g_rdf -sq give wrong results." into release-4-5-patches

11 years agoFixed bug in sfactor.c that makes g_rdf -sq give wrong results.
Jochen Hub [Mon, 9 Jul 2012 19:46:02 +0000 (21:46 +0200)]
Fixed bug in sfactor.c that makes g_rdf -sq give wrong results.

The number of neutrons is not any more in sfactor.dat, but the
respective sscanf line in sfactor.c has still a placeholder for it.
Consequently, the Cromer-Mann parameter were read incorrectly.

I left the element n (for number of neurons) in gmx_structurefactors_t
for now, but the variable is at present not used.

Fixes Bug #919

Change-Id: I20a78b0b1cf4bf2271ba0ce8c785d900502d7656

11 years agoFix memory error with complex boolean selections.
Teemu Murtola [Fri, 22 Jun 2012 06:25:59 +0000 (09:25 +0300)]
Fix memory error with complex boolean selections.

Backported from dd3a102.

Conflicts:
src/gmxlib/selection/compiler.c

Fixes #968.

Change-Id: If92b5b1eb8cf6b3acb510ba43f64fc82b63ab82a

11 years agoExtension completion for FileNameOption.
Teemu Murtola [Sun, 8 Jul 2012 05:27:43 +0000 (08:27 +0300)]
Extension completion for FileNameOption.

- Make FileNameOption to complete extensions for input files, like the
  old file options did.
- Add descriptions for all file name options to improve the help output.
- Make defaultValueIfSet() really appear in the help output: it worked
  only in the case the option value was not stored.
- Adjust the reference for command-line help tests to match the new
  output.

Part of #642.

Change-Id: I4a749e3e82a42a6e64e0a78c91120f96a00381b9

11 years agoAutogenerate gromacs.7 from programs.txt
Roland Schulz [Sat, 7 Jul 2012 03:25:08 +0000 (23:25 -0400)]
Autogenerate gromacs.7 from programs.txt

Change-Id: I958906dc9967155bccd3f43e5a6882632a829951

11 years agoEnforced rotation: PBC/restart fix
Carsten Kutzner [Fri, 15 Jun 2012 12:43:35 +0000 (14:43 +0200)]
Enforced rotation: PBC/restart fix

... for rot groups consisting of >1 molecule. This commit fixes a problem with checkpoint-restarts
when using a rotation group consisting of more than a single molecule.

Change-Id: I7378047b5cd0909b864a62200ded747682f627a1

11 years agoBetter invalid option value handling.
Teemu Murtola [Thu, 28 Jun 2012 09:04:31 +0000 (12:04 +0300)]
Better invalid option value handling.

- Give an error when trying to give an empty string as a value for a
  numeric option, as well as when the given value overflows/underflows
  the target variable.
- Don't give extra errors (e.g., about too few valid values) when a
  value for an option was invalid.
- Make assignment more atomic: if there was an error in a set of values,
  ignore other values.

Change-Id: I30fd471f6d65246b4215a5ee775f0d16492a21d0

11 years agoMerge "Remove remaining underscore-prefixed C++ symbols."
Roland Schulz [Fri, 6 Jul 2012 10:41:15 +0000 (12:41 +0200)]
Merge "Remove remaining underscore-prefixed C++ symbols."

11 years agoMerge "Set common output directory for binaries"
Roland Schulz [Fri, 6 Jul 2012 10:33:36 +0000 (12:33 +0200)]
Merge "Set common output directory for binaries"

11 years agoRemove remaining underscore-prefixed C++ symbols.
Teemu Murtola [Fri, 6 Jul 2012 05:19:14 +0000 (08:19 +0300)]
Remove remaining underscore-prefixed C++ symbols.

More of the same as in e39fb5f (I7f4bf42e), no manual editing.
The C++ code should now consistently use underscore suffixes instead of
prefixes for member variables.

Change-Id: I94ae31da201cc23d1a0d87e5ec1251b30c085cc0

11 years agoBugfix for the segfault that occurs with g_hbond -hbm -contact.
Erik Marklund [Fri, 6 Jul 2012 07:32:32 +0000 (09:32 +0200)]
Bugfix for the segfault that occurs with g_hbond -hbm -contact.

Fixes #967

Change-Id: I23968ca45683b5867f919bf32e588058bd391c67

11 years agoMerge "Test framework for TrajectoryAnalysisModules."
Teemu Murtola [Fri, 6 Jul 2012 05:10:20 +0000 (07:10 +0200)]
Merge "Test framework for TrajectoryAnalysisModules."

11 years agoTest framework for TrajectoryAnalysisModules.
Teemu Murtola [Wed, 23 May 2012 07:14:50 +0000 (10:14 +0300)]
Test framework for TrajectoryAnalysisModules.

- Add a test fixture that makes it simple to test analysis tools that
  are implemented as TrajectoryAnalysisModule subclasses (moduletest.*).
- Add tests using the new fixture for most of the functionality of the
  Select module.
- Minor adjustment to reference data test fixture to make it more usable
  in this context.
- Move all dataset registration calls to trajectory analysis module
  constructors from initAnalysis().  Also moved static initialization of
  the datasets, in particular calls to setMultipoint().
  In addition to enabling the tests to access the datasets before any
  initialization of the module is done, this also makes the modules
  easier to use for other interfacing than the command-line runner.

Main part of #920, may need some additional features.

Change-Id: I67e123f8361fe7710e936d9b4a880e65a3dc89c5

11 years agoAdding FFT Unit Tests
Roland Schulz [Tue, 5 Jun 2012 01:38:14 +0000 (21:38 -0400)]
Adding FFT Unit Tests

Change-Id: I3de741e6c66ac1e611d78962606253a3c903cbef

11 years agoDon't prevent GMX_PREFER_STATIC_LIBS with BUILD_SHARED_LIBS
Roland Schulz [Thu, 5 Jul 2012 23:08:41 +0000 (19:08 -0400)]
Don't prevent GMX_PREFER_STATIC_LIBS with BUILD_SHARED_LIBS

In general it seems better to not overwrite the user requested
settings unless the settings are not possible.
In this case the combination makes sense for binary packages.
Static external libraries make them easier to distribute and
shared gromacs libraries make them much smaller.

Change-Id: Icb9c4dfa2e7d211ab6bd2efcb2f2437504a87cfe

11 years agoSet common output directory for binaries
Roland Schulz [Tue, 3 Jul 2012 01:49:43 +0000 (21:49 -0400)]
Set common output directory for binaries

This causes all binaries to be placed in "bin" in the build
directory and all libraries in the "lib". This makes it easier
to call binaries without installing.

Change-Id: I9dd7b5bde06b1ff9b0e7e9171854198bb8c1d749

11 years agoMerge "Extract doxygen documentation for static symbols."
Christoph Junghans [Thu, 5 Jul 2012 21:00:15 +0000 (23:00 +0200)]
Merge "Extract doxygen documentation for static symbols."

11 years agoBuild man-pages instead of distributing them in the source
Roland Schulz [Wed, 4 Jul 2012 01:55:29 +0000 (21:55 -0400)]
Build man-pages instead of distributing them in the source

One less thing to do manual for releasing the code. And thus
avoiding to accidental releasing which old version of man-pages.

Writing copyright notice to stderr for all programs (was inconsistent)
and caused copyright notice to be displayed during build.

The CPack source package continues to contain the man pages pre-build.
CPack verifies that they are genenerated before building the source
package.

Added .isreposource to distinquish code obtained from git from code
downloaded as CPack source package.

Related to #645, #854, #735
Fixes #878

Change-Id: I7d7145fb99d3f1991d0f3992ca4f3ea20668dd9a

11 years agoMerge "Improve ProgramInfo and use it everywhere."
David van der Spoel [Thu, 5 Jul 2012 20:13:24 +0000 (22:13 +0200)]
Merge "Improve ProgramInfo and use it everywhere."

11 years agoExtract doxygen documentation for static symbols.
Teemu Murtola [Sat, 30 Jun 2012 09:35:16 +0000 (12:35 +0300)]
Extract doxygen documentation for static symbols.

The full doxygen documentation now includes documentation for static
methods.  Fixed warnings from undocumented static methods in documented
files.

Change-Id: Ib77dc8e19882c6b2f4a1a97a4fcab63277aae211

11 years agoMerge "Fix most doxygen warnings."
Christoph Junghans [Thu, 5 Jul 2012 19:53:55 +0000 (21:53 +0200)]
Merge "Fix most doxygen warnings."

11 years agoMerge "Don't rerun checks and be quiet 2nd time cmake is run" into release-4-6
Christoph Junghans [Thu, 5 Jul 2012 19:45:36 +0000 (21:45 +0200)]
Merge "Don't rerun checks and be quiet 2nd time cmake is run" into release-4-6

11 years agoMerge "Allow also FindMPI for cmake<2.8.5" into release-4-6
Christoph Junghans [Thu, 5 Jul 2012 19:42:15 +0000 (21:42 +0200)]
Merge "Allow also FindMPI for cmake<2.8.5" into release-4-6

11 years agoMerge "Finalized and extended Szilard's openMP cleanup of gmx_hbond.c:" into release-4-6
Christoph Junghans [Thu, 5 Jul 2012 19:26:41 +0000 (21:26 +0200)]
Merge "Finalized and extended Szilard's openMP cleanup of gmx_hbond.c:" into release-4-6

11 years agoDon't rerun checks and be quiet 2nd time cmake is run
Roland Schulz [Tue, 26 Jun 2012 19:23:38 +0000 (15:23 -0400)]
Don't rerun checks and be quiet 2nd time cmake is run

Change-Id: I86f8cb4dfb73898e74d320ae8ef3676e62ebde51

11 years agoFinalized and extended Szilard's openMP cleanup of gmx_hbond.c:
Erik Marklund [Thu, 28 Jun 2012 19:02:00 +0000 (21:02 +0200)]
Finalized and extended Szilard's openMP cleanup of gmx_hbond.c:

* Changed HAVE_OPENMP into GMX_OPENMP
* Fixed incorrect use of OpenMP API functions
* Made variables shared by default in parallel sections
  This also avoids problems with stderr being a macro in certain
  implementations, which caused compilation errors on some systems
  when stderr occurs explicitly in pragmas.
* Protected a block where reallocation of hbdata occurs with a critical section
* Cleaned out some output that was commented out anyway.
* Removed redundant preprocessor directives

Change-Id: I452ab2e873434086e6bc616d9d24a8d890147220

11 years agoMerge "Add FindGROMACS.cmake to template's CMakeLists.txt" into release-4-6
Roland Schulz [Wed, 4 Jul 2012 05:18:46 +0000 (07:18 +0200)]
Merge "Add FindGROMACS.cmake to template's CMakeLists.txt" into release-4-6

11 years agoMerge "Fixed bug in free energy calculation for Morse potentials" into release-4-6
Roland Schulz [Wed, 4 Jul 2012 05:16:56 +0000 (07:16 +0200)]
Merge "Fixed bug in free energy calculation for Morse potentials" into release-4-6

11 years agoRemove unused FFT functions
Roland Schulz [Tue, 5 Jun 2012 03:36:01 +0000 (23:36 -0400)]
Remove unused FFT functions

Change-Id: Ic3fd21579f6dcf7e57084c5a9beed4637a8cae6a

11 years agoFix most doxygen warnings.
Teemu Murtola [Fri, 29 Jun 2012 12:07:49 +0000 (15:07 +0300)]
Fix most doxygen warnings.

This makes it much more convenient to work locally with Doxygen.  Even
though Jenkins ignored these warnings, if you ran Doxygen locally, it
produced a long list of warnings in the log file, making it difficult to
spot if new warnings had appeared.

Also improved the Doxygen configuration files to have common settings in
a shared file that is then included from the actual configuration files.

Change-Id: Ic57576e2cb89f6d0e5929981553b48a61435c26c

11 years agoFixes for FFT libraries
Roland Schulz [Mon, 4 Jun 2012 15:56:42 +0000 (11:56 -0400)]
Fixes for FFT libraries

- Updated documentation
- Added gmx_fft_cleanup for any cleanup after using FFT
    (removing memory leak otherwise caused by FFTW)
- Replaced TMPI_THREAD_MUTEX_INITIALIZER with tMPI::mutex
    (otherwise tmpi leaks memory)

Change-Id: If3e9012da14ebf74d87d4d4647c2f17bd8380fc1

11 years agoset default for rcoulomb, rvdw and rlist to -1
Berk Hess [Mon, 2 Jul 2012 17:08:41 +0000 (19:08 +0200)]
set default for rcoulomb, rvdw and rlist to -1

To avoid users using the default values and to force them to think
about the cut-offs, all default values are now -1.
This also avoids grompp notes with the new Verlet scheme,
where the rlist value can be generated automatically.

Change-Id: I99bc7eee76953d06767f9c9916d1c9289badf74f

11 years agoImprove ProgramInfo and use it everywhere.
Teemu Murtola [Mon, 4 Jun 2012 09:03:50 +0000 (12:03 +0300)]
Improve ProgramInfo and use it everywhere.

- The ProgramInfo class now stores the full command line.
  Moved functionality to add quotes to arguments with spaces from
  gmx::test::CommandLine to ProgramInfo.
- ProgramInfo initialization is now protected by a mutex for
  completeness.
- oenv.c and statutil.c now use ProgramInfo internally to store/return
  the binary name and command line.  Removes duplicate implementations
  of this functionality.  Required changing the return values of
  ProgramInfo methods from std::string values to const references.
- Removed many unnecessary #include directives from these two files.
- Fixed warnings that were produced from these files when switching them
  to C++ compilation (one cppcheck warning suppressed for now).
- Add a temporary hack for Windows to try to make get_libdir() work for
  tests that are run through CTest.

Helps with #950.

Change-Id: I1bfd4231b8b7055d0a014b41be67a7c1c99e36b0

11 years agoError/exception handling improvements.
Teemu Murtola [Mon, 4 Jun 2012 05:10:09 +0000 (08:10 +0300)]
Error/exception handling improvements.

- Change formatErrorMessage() to printFatalErrorMessage() that directly
  prints the error message for an exception into a FILE (typically
  stderr) instead of creating a std::string.  This makes it possible to
  handle out-of-memory errors internally within the function.
  The function is much easier to use if we can guarantee that it never
  throws.
- Add basic handling of std::bad_alloc into the above function.
- Resolve clang warnings in the function.
- Add a macro for conveniently catching all exceptions at C++ - C
  boundary and reporting them as fatal errors.
- Initialize ProgramInfo in all C++ binaries.

Related to #838.

Change-Id: I77c355480485f563c57b6c6ea9b07a8ce7f433a8

11 years agoAlways build thread_mpi threading into libgromacs.
Teemu Murtola [Mon, 4 Jun 2012 10:18:04 +0000 (13:18 +0300)]
Always build thread_mpi threading into libgromacs.

This allows using basic thread synchronization primitives without
conditional compilation.
Adjusted the build system to build only the basic thread synchronization
files instead of full thread_mpi if GMX_THREAD_MPI is off.
This required splitting tMPI_Malloc and friends from tmpi_init.c into a
separate file (since tmpi_init.c depends on most other files), and also
moving TMPI_COMM_WORLD to the new file.
Also removed a few unused variables from atomic.h to avoid cppcheck
warnings.

Part of #948.

Change-Id: I3c6bd2cf084acd4a4e881b99a07bc3a4c878727e

11 years agoFixed L-BFGS trajectory output.
Elton Carvalho [Thu, 28 Jun 2012 15:13:03 +0000 (17:13 +0200)]
Fixed L-BFGS trajectory output.

This bug made mdrun ignore nstxout and nstfout when running l_bfgs.
When calling write_traj, MDOF_X|MDOF_F was given as mdof_flags to write
the trajetory, thus ignoring do_x and do_f evaluated on the previous
lines.

Fixes #905.

Change-Id: Id3ff7b090efd23fd28d8c27ea99992d1647f1ed6

11 years agoMerge "Minor formatting and consistency changes to txtdump.c" into release-4-6
Szilárd Páll [Tue, 3 Jul 2012 09:35:35 +0000 (11:35 +0200)]
Merge "Minor formatting and consistency changes to txtdump.c" into release-4-6

11 years agoDo not print disabled pressures and virials
Christoph Junghans [Mon, 2 Jul 2012 20:20:10 +0000 (14:20 -0600)]
Do not print disabled pressures and virials

* For some methods pressure and virial calculation is disabled
* md.bVir and md.bPress was added in
d870cd31bee97e277f48ba982da85303bce98611
* At this point only AdResS has md.bVir=md.bPress=FALSE

Change-Id: I6abe24a5c286d20dcf554831ade9540674df9d77

11 years agoFixed bug in free energy calculation for Morse potentials
David van der Spoel [Sat, 30 Jun 2012 13:18:31 +0000 (15:18 +0200)]
Fixed bug in free energy calculation for Morse potentials

Introduced recently when FEP was added to the Morse potential.

Change-Id: I90edfd13835637c872af31f2c7abf900ce8a8e5f

11 years agoAdd FindGROMACS.cmake to template's CMakeLists.txt
Christoph Junghans [Fri, 29 Jun 2012 20:18:17 +0000 (14:18 -0600)]
Add FindGROMACS.cmake to template's CMakeLists.txt

Change-Id: Id5adec8aa057f1d56021b06aaedd35dab108ead7

11 years agoMinor formatting and consistency changes to txtdump.c
Michael Shirts [Fri, 29 Jun 2012 17:35:59 +0000 (11:35 -0600)]
Minor formatting and consistency changes to txtdump.c

Change-Id: I2992a927ccf49b407fa985eb2283c37818bbd2a5

11 years agoCorrected checkpoint version issues with free energy changes.
Michael Shirts [Fri, 29 Jun 2012 17:28:37 +0000 (11:28 -0600)]
Corrected checkpoint version issues with free energy changes.

Change-Id: If9494aa0bdbd6f83cc2a8a57a5c7e399aaa787f4

11 years agoMerge "Fixed adress kernel for double precision" into release-4-6
Sebastian Fritsch [Fri, 29 Jun 2012 10:05:18 +0000 (12:05 +0200)]
Merge "Fixed adress kernel for double precision" into release-4-6