Fix build without TNG
authorMark Abraham <mark.j.abraham@gmail.com>
Fri, 24 Aug 2018 08:58:25 +0000 (10:58 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Fri, 24 Aug 2018 10:26:10 +0000 (12:26 +0200)
Also resolve the TODO about testing for this case.

Change-Id: I7e4b65f82a83c84234a01220954931e8ecd28c9e

admin/builds/gromacs.py
admin/builds/post-submit-matrix.txt
src/gromacs/fileio/tngio.cpp
src/gromacs/tools/dump.cpp
src/gromacs/utility/binaryinformation.cpp
src/programs/mdrun/tests/trajectory_writing.cpp

index 06640c16f1f552c8ddd87aaa6514b4b12d111fc7..d437dfe3c6d4b9eb5823449097f83225c8f87372 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2015,2016,2017, by the GROMACS development team, led by
+# Copyright (c) 2015,2016,2017,2018, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
@@ -44,6 +44,7 @@ extra_options = {
     'release-with-assert': Option.simple,
     'release-with-debug-info': Option.simple,
     'asan': Option.simple,
+    'tng' : Option.bool,
     'mkl': Option.simple,
     'fftpack': Option.simple,
     'double': Option.simple,
@@ -112,6 +113,8 @@ def do_build(context):
         cmake_opts['GMX_MPI'] = 'ON'
     if context.opts.openmp is False:
         cmake_opts['GMX_OPENMP'] = 'OFF'
+    if context.opts.tng is False:
+        cmake_opts['GMX_USE_TNG'] = 'OFF'
 
     if context.opts.mkl:
         cmake_opts['GMX_FFT_LIBRARY'] = 'mkl'
index 72445c022555832d58d2a641abfea4cfc430c1ee..00de439f9a3b508e1237eb77d781bf13f4d63ab7 100644 (file)
@@ -29,7 +29,8 @@ gcc-7 mpi no-openmp fftpack mdrun-only
 icc-18 npme=1 nranks=2 no-openmp  double fftpack release simd=none
 
 # Test CUDA build on a slave with no CUDA devices
-gcc-4.9 gpu cuda-7.0 openmp release-with-assert
+# Test without TNG support
+gcc-4.9 gpu cuda-7.0 openmp no-tng release-with-assert
 
 # Test non-default GMX_PREFER_STATIC_LIBS behavior
 # TODO enable this
@@ -65,7 +66,6 @@ icc-16 msvc-2015 fftpack simd=avx2_256 release
 # Add SIMD + OpenMP + CUDA asan build
 # Add OpenMP + CUDA + device sharing TSAN build
 # Re-enable Phi build (FIXME: do we still care?)
-# Test without TNG support
 # Test without hwloc support
 # Test with NVML support
 # Test statically linked hwloc support (if/when it can work well)
index 67c0225eae4974566add19d463fcd47c53456b3e..b8ac1aee26909e23832a2b95e9de108ca34dcd76 100644 (file)
 #include "gromacs/utility/sysinfo.h"
 #include "gromacs/utility/unique_cptr.h"
 
+#if !GMX_USE_TNG
+using tng_trajectory_t = void *;
+#endif
+
 /*! \brief Gromacs Wrapper around tng datatype
  *
  * This could in principle hold any GROMACS-specific requirements not yet
@@ -90,6 +94,7 @@ struct gmx_tng_trajectory
     bool             timePerFrameIsSet;   //!< True if we have set the time per frame
 };
 
+#if GMX_USE_TNG
 static const char *modeToVerb(char mode)
 {
     const char *p;
@@ -111,6 +116,7 @@ static const char *modeToVerb(char mode)
     }
     return p;
 }
+#endif
 
 void gmx_tng_open(const char           *filename,
                   char                  mode,
index 77ade935314be6a5929e3a53e3ab2e0e9130b857..82cd78a7834bb11a6d33e4617e5a5191a5b3ac52 100644 (file)
@@ -315,6 +315,8 @@ static void list_xtc(const char *fn)
     close_xtc(xd);
 }
 
+#if GMX_USE_TNG
+
 /*! \brief Callback used by list_tng_for_gmx_dump. */
 static void list_tng_inner(const char *fn,
                            gmx_bool    bFirstFrame,
@@ -347,9 +349,11 @@ static void list_tng_inner(const char *fn,
     pr_reals_of_dim(stdout, indent, block_name, values, n_atoms, n_values_per_frame);
 }
 
+#endif
+
 static void list_tng(const char gmx_unused *fn)
 {
-#ifdef GMX_USE_TNG
+#if GMX_USE_TNG
     gmx_tng_trajectory_t tng;
     gmx_int64_t          nframe = 0;
     gmx_int64_t          i, *block_ids = nullptr, step, ndatablocks;
index c27e28ad37aa09a0fc803521ea04bd9f4d88c3ba..ddae19a9da086d3e40df8909b0e18618104c4722 100644 (file)
@@ -257,7 +257,7 @@ void gmx_print_version_info(gmx::TextWriter *writer)
     writer->writeLine(formatString("SIMD instructions:  %s", GMX_SIMD_STRING));
     writer->writeLine(formatString("FFT library:        %s", getFftDescriptionString()));
     writer->writeLine(formatString("RDTSCP usage:       %s", HAVE_RDTSCP ? "enabled" : "disabled"));
-#ifdef GMX_USE_TNG
+#if GMX_USE_TNG
     writer->writeLine("TNG support:        enabled");
 #else
     writer->writeLine("TNG support:        disabled");
index 09666e4d7eba3a4e74d802daa492bfa7ac5650c4..9ca0526a6edba6b26277563c63fdcf3de2781bf2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2013,2014,2015,2016, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015,2016,2018, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
@@ -55,7 +55,7 @@ namespace
 {
 
 // TODO configure these tests so they test all formats for mdrun trajectory writing
-#ifdef GMX_USE_TNG
+#if GMX_USE_TNG
 
 //! Test fixture for mdrun trajectory writing
 class TrajectoryWritingTest :