Merge "Removed unused code from src/kernel/."
authorDavid van der Spoel <davidvanderspoel@gmail.com>
Thu, 3 May 2012 11:51:50 +0000 (13:51 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 3 May 2012 11:51:50 +0000 (13:51 +0200)
20 files changed:
CMakeLists.txt
src/config.h.cmakein
src/gromacs/gmxlib/checkpoint.c
src/gromacs/gmxlib/futil.c
src/gromacs/gmxlib/gmx_random.c
src/gromacs/gmxlib/main.c
src/gromacs/gmxlib/rando.c
src/gromacs/gmxlib/string2.c
src/gromacs/gmxlib/vmdio.c
src/gromacs/gmxlib/wman.c
src/gromacs/legacyheaders/CMakeLists.txt
src/gromacs/legacyheaders/futil.h
src/gromacs/legacyheaders/string2.h
src/gromacs/legacyheaders/xdrf.h
src/gromacs/utility/.gitignore [new file with mode: 0644]
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/gmx_header_config.h.cmakein [moved from src/gromacs/legacyheaders/gmx_header_config.h.cmakein with 82% similarity]
src/gromacs/utility/path.cpp
src/gromacs/utility/uniqueptr.h
src/tools/gmx_trjconv.c

index 78531297fd27adff574b54ef91cb12fed70db55d..5d75e4893e18503e24b0632a9ca03b61f0331bc9 100644 (file)
@@ -536,7 +536,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src)
 # Required for config.h, maybe should only be set in src/CMakeLists.txt
 include_directories(${CMAKE_BINARY_DIR}/src)
 # Required for now to make old code compile
-include_directories(${CMAKE_BINARY_DIR}/src/gromacs/legacyheaders)
 include_directories(${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders)
 
 include(gmxCheckBuildUserTime)
@@ -573,7 +572,7 @@ gmx_test_inline_asm_gcc_x86(GMX_X86_GCC_INLINE_ASM)
 gmx_test_inline_asm_msvc_x86(GMX_X86_MSVC_INLINE_ASM)
 
 include(gmxTestCXX11)
-gmx_test_cxx11(HAVE_CXX11 CXX11_FLAG)
+gmx_test_cxx11(GMX_CXX11 CXX11_FLAG)
 set(GROMACS_CXX_FLAGS "${CXX11_FLAG} ${GROMACS_CXX_FLAGS}")
 
 # turn on SSE if supported with reasonable defaults.
index 7aaa8beae814461f5554ff28bd7ab589c0badcb6..88ea0967c88b347cdbbfcf85978a8b241f87981d 100644 (file)
 /* Define if we have pipes */
 #cmakedefine HAVE_PIPES
 
-/* Define if we have sufficient C++11 support */
-#cmakedefine HAVE_CXX11
-
 /* Catch stupid CMake problems on OS X */
 #ifdef __APPLE__
 #  if ((defined(__LP64__) && __LP64__ && defined(SIZEOF_VOIDP) && SIZEOF_VOIDP<8) || ( (!defined(__LP64__) || __LP64__==0) && (defined(SIZEOF_VOIDP) && SIZEOF_VOIDP>4)))
index 09b14677804a005f9b1e80a4fa340f4b9d82c9f0..ae1c1e4a6e8366d5b86dc4db9651ce52497c19b6 100644 (file)
@@ -23,7 +23,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include <string.h>
 #include <time.h>
index ea18883db312ac29ad1134c3633ea6c592d9a0d9..815ab675d6c89ec18e809527ab076e30c009ba57 100644 (file)
@@ -36,7 +36,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include <stdio.h>
 #include <stdlib.h>
index 0e560998068d674421acdbd7766c94068de416a1..76b26c3fd7a595070b66551fc2d84e8b5aba8b63 100644 (file)
@@ -35,7 +35,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include <gmx_random.h>
 
index 10ce861d78f656d9157f5ca71f28689522e1e7e5..80f81a5ac8376e982c9613f2cc5c01698a27dd4d 100644 (file)
@@ -36,7 +36,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include <stdio.h>
 #include <stdlib.h>
index e3c9e343070d1f49a52c7d7c035e50a2f4c22756..cf6e741ef51e5c2942d0a9eb7ace225b32f3cb5a 100644 (file)
@@ -35,7 +35,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include <time.h>
 #ifdef GMX_NATIVE_WINDOWS
index e9bb7b723920a4d092edbd95630ddbb69b81689d..9048a2a6737f2f167b97f0033896a86688d1a940 100644 (file)
@@ -36,7 +36,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #ifdef GMX_CRAY_XT3
 #undef HAVE_PWD_H
index 9dad9e0f5a7b20538a0c7debde08a3478ac81a72..23cbf6da5cf8297e377fce40d7948c9e737914aa 100644 (file)
@@ -18,7 +18,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 
 
index 9d9bd887eb2039c1e050ba39076a5d3db96c0205..db41951edf6bf8d20bc79ed3e1f4d51cf9187060 100644 (file)
@@ -35,7 +35,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include "string2.h"
 #include "smalloc.h"
index 397bff235ce6d0343c7d8b9415e7f495f502819a..b032b87a24993def0408f300d052f0220dafcd61 100644 (file)
@@ -1,10 +1,4 @@
-# includes: Nothing to build, just configuration and installation
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gmx_header_config.h.cmakein ${CMAKE_CURRENT_BINARY_DIR}/gmx_header_config.h)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gmx_header_config.h
-  DESTINATION ${INCL_INSTALL_DIR}/gromacs/legacyheaders
-  COMPONENT development
-)
-
+# includes: Nothing to build, just installation
 install(DIRECTORY . DESTINATION ${INCL_INSTALL_DIR}/gromacs/legacyheaders
   COMPONENT development
   PATTERN "Makefile*" EXCLUDE
index 507d0416889555c2c87eac4776c7de4660629fc1..62cfb52ac415414d696f0a7af4a94bde5a29193e 100644 (file)
@@ -51,7 +51,7 @@ extern "C" {
  * When reading the PATH environment variable, Unix separates entries
  * with colon, while windows uses semicolon.
  */
-#include "gmx_header_config.h"
+#include "../utility/gmx_header_config.h"
 #ifdef GMX_NATIVE_WINDOWS
 #define DIR_SEPARATOR '\\'
 #define PATH_SEPARATOR ";"
index d0daa32882da0e90fe7974e7aaa0cc78cb6dad4a..a422a5823c18dea2be1b86358a15dd37e20f66e6 100644 (file)
@@ -52,7 +52,7 @@
 #include <ctype.h>
 #include <time.h>
 #include <errno.h>
-#include "gmx_header_config.h"
+#include "../utility/gmx_header_config.h"
 
 /*#include "typedefs.h"*/
 #include "types/simple.h"
index ba3ac55893173afb52579db754a20de74e385f0c..fa874a634c93313c25f4f58d59ec5349b0df4b44 100644 (file)
@@ -44,7 +44,7 @@
 #define int64_t long long
 #endif
 
-#include "gmx_header_config.h"
+#include "../utility/gmx_header_config.h"
 #if (defined GMX_NATIVE_WINDOWS || defined GMX_CYGWIN || defined GMX_INTERNAL_XDR)
 #include "gmx_system_xdr.h"
 #else
diff --git a/src/gromacs/utility/.gitignore b/src/gromacs/utility/.gitignore
new file mode 100644 (file)
index 0000000..c1a7f0d
--- /dev/null
@@ -0,0 +1 @@
+gmx_header_config.h
index aae75dca8d72d5785edc11e2844f58a3471ea930..8dcbde67289773f2f01854d1d1edd93143e3cd53 100644 (file)
@@ -1,6 +1,11 @@
 file(GLOB UTILITY_SOURCES *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
 
+# Needs to be created in the source tree to allow relative paths in headers to
+# be resolved correctly before installation
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gmx_header_config.h.cmakein
+               ${CMAKE_CURRENT_SOURCE_DIR}/gmx_header_config.h)
+
 set(UTILITY_PUBLIC_HEADERS
     arrayref.h
     common.h
@@ -9,6 +14,7 @@ set(UTILITY_PUBLIC_HEADERS
     file.h
     flags.h
     format.h
+    gmx_header_config.h
     gmxassert.h
     uniqueptr.h)
 install(FILES ${UTILITY_PUBLIC_HEADERS}
similarity index 82%
rename from src/gromacs/legacyheaders/gmx_header_config.h.cmakein
rename to src/gromacs/utility/gmx_header_config.h.cmakein
index a2f98bf13ae657f443db07dc30427ab40dbcb91b..880c1081f4a4051218bce2c1a6eb6cd612d276e5 100644 (file)
@@ -9,3 +9,6 @@
 
 /* Detect native (i.e. non-Cygwin) Windows */
 #cmakedefine GMX_NATIVE_WINDOWS
+
+/* Define if we have sufficient C++11 support */
+#cmakedefine GMX_CXX11
index 4bf0e07afdf7057abcc5eb8550fe089aef6f9317..9f822cd7e86e3ae8b483f9879a3dc323404f6ad4 100644 (file)
  */
 #include "path.h"
 
+#include "gmx_header_config.h"
+
 #include <errno.h>
 #include <sys/stat.h>
 
-#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+#ifdef GMX_NATIVE_WINDOWS
 #include <direct.h>
 #endif
 
@@ -72,7 +74,7 @@ int Directory::create(const char *path)
     {
         return 0;
     }
-#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+#ifdef GMX_NATIVE_WINDOWS
     if (_mkdir(path))
 #else
     if (mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IWOTH) != 0)
@@ -102,7 +104,7 @@ bool Directory::exists(const char *path)
         }
         return false;
     }
-#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+#ifdef GMX_NATIVE_WINDOWS
     return ((_S_IFDIR & info.st_mode) != 0);
 #else
     return S_ISDIR(info.st_mode);
index 40eb4b9012da17cd670d4de65182e19d614700b3..a54c44973a4a655ca7f4989be29c2d7fd9ee6e37 100644 (file)
 #ifndef GMX_UTILITY_UNIQUEPTR_H
 #define GMX_UTILITY_UNIQUEPTR_H
 
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmx_header_config.h"
 
-#ifdef HAVE_CXX11 // C++11 Compiler
+#ifdef GMX_CXX11 // C++11 Compiler
 #include <memory>
 #include <utility>
 #else      // C++03 Compiler
@@ -71,20 +69,11 @@ typedef gmx_unique_ptr<ExampleClass>::type ExampleClassPointer;
  * \ingroup module_utility
  * \inlibraryapi
  */
-
 /*! \typedef gmx_unique_ptr::type
  * \brief The smart pointer type.
  * Work-around for the non-existence of template typedefs in C++03.
  */
-
-/*! \fn boost::shared_ptr<T> &move(boost::shared_ptr<T> &ptr)
- * \brief Moves gmx::gmx_unique_ptr type pointers
- * For C++11 gmx::move is the std::move, for non-C++11 compilers, the
- * move operation is a no-op.
- *
- * \inlibraryapi
- */
-#ifdef HAVE_CXX11 // C++11 Compiler
+#ifdef GMX_CXX11 // C++11 Compiler
 using std::move;
 template<typename T>
 struct gmx_unique_ptr
@@ -92,6 +81,15 @@ struct gmx_unique_ptr
     typedef std::unique_ptr<T> type;
 };
 #else // C++03 Compiler
+/*! \fn boost::shared_ptr<T> &move(boost::shared_ptr<T> &ptr)
+ * \brief
+ * Moves gmx::gmx_unique_ptr type pointers
+ *
+ * For C++11 gmx::move is the std::move, for non-C++11 compilers, the
+ * move operation is a no-op.
+ *
+ * \inlibraryapi
+ */
 template<typename T>
 boost::shared_ptr<T> &move(boost::shared_ptr<T> &ptr)
 {
index a71aa02e15ac29ddadc1a1d31e3e635123754580..37619c8cd4af8585ce277628f5aa868ffd56644c 100644 (file)
@@ -35,7 +35,7 @@
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include "gmx_header_config.h"
+#include "gromacs/utility/gmx_header_config.h"
 
 #include <string.h>
 #include <math.h>