Clean up gmx_header_config
authorTeemu Murtola <teemu.murtola@gmail.com>
Wed, 9 Jul 2014 05:09:26 +0000 (08:09 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Wed, 9 Jul 2014 05:09:26 +0000 (08:09 +0300)
- Remove some probably unnecessary uses for GMX_CYGWIN.
- Move GMX_CYGWIN to config.h as it is not used in installed headers
  (maybe it would be better to get rid of even the remaining uses in
  favor of some other mechanism).
- Remove gmx_header_config_gen.h and all complexity that supports it as
  there is nothing generated there any longer.
- GMX_NATIVE_WINDOWS could possibly be moved somewhere else, but
  currently it is only used in two headers, so possibly even better
  would be to just get rid of those two.

Closes #1454

Change-Id: Id27370a007eda30b7c803a3c14aa687d43555db8

CMakeLists.txt
doxygen/suppressions.txt
src/config.h.cmakein
src/gromacs/linearalgebra/gmx_blas.h
src/gromacs/linearalgebra/gmx_lapack.h
src/gromacs/utility/.gitignore
src/gromacs/utility/CMakeLists.txt
src/gromacs/utility/gmx_header_config.h
src/gromacs/utility/gmx_header_config_gen.h.cmakein [deleted file]

index ca7094d156fa2e63b53170e0e133cf676b740782..a876dca72e64b809b45c99d16bbdd8aea5286cfd 100644 (file)
@@ -592,8 +592,6 @@ include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src)
 include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/external/thread_mpi/include)
 # Required for config.h, maybe should only be set in src/CMakeLists.txt
 include_directories(BEFORE ${CMAKE_BINARY_DIR}/src)
-# Required for gmx_header_config_gen.h to be found before installation
-include_directories(BEFORE ${CMAKE_BINARY_DIR}/src/gromacs/utility)
 # Required for now to make old code compile
 include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/gromacs/legacyheaders)
 
index 592505a9621365d18c49fe914f035d8ae78291a4..0fe2a7d0cb2dc0ceac28392cb8acfe494b7cbf74 100644 (file)
@@ -16,6 +16,3 @@ src/gromacs/gmxlib/nonbonded/nb_kernel_*/*: warning: included file "gromacs/simd
 # These are specific to Folding@Home, and easiest to suppress here
 *: warning: includes non-local file as "corewrap.h"
 src/config.h.cmakein: warning: includes non-local file as "swindirect.h"
-
-# These are limitations in the current script
-src/gromacs/utility/gmx_header_config.h: warning: includes non-local file as "gmx_header_config_gen.h"
index b1397b5c595d713f640dc6fdd6b2e56df19aefc5..2e208b36cdbef9f0046beb3a95ade0abdf641c28 100644 (file)
@@ -93,6 +93,9 @@
 /* Target platform is BlueGene/Q */
 #cmakedefine GMX_TARGET_BGQ
 
+/** Define if we are building for Cygwin */
+#cmakedefine GMX_CYGWIN
+
 /** Define if we have sufficient C++11 support */
 #cmakedefine GMX_CXX11
 
index cd327cbf7a1883e80914e6f464800de12f741da0..991cf8b2e6b1ce8baaaf64f6c487a34afb9dcb6b 100644 (file)
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-/* Suppress Cygwin compiler warnings from using newlib version of
- * ctype.h */
-#ifdef GMX_CYGWIN
-#undef toupper
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index 98761cdbd87ad47c682aea9e5640f99d28c7e842..b29535a6e5194b2251fefaf483ac071ef69ad76f 100644 (file)
 #include "gromacs/utility/basedefinitions.h"
 #include "gromacs/utility/real.h"
 
-/* Suppress Cygwin compiler warnings from using newlib version of
- * ctype.h */
-#ifdef GMX_CYGWIN
-#undef toupper
-#endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
index bd574593cdb1731bdfafc49e788c146e2312e92c..c9b05c53b1e0109d4aa6d742de60eca2c89f0bd2 100644 (file)
@@ -1,2 +1 @@
 baseversion-gen.c
-gmx_header_config_gen.h
index 84b48dbb6c7aac3d0a6a7a213f59f6b6c59e95a6..3a386173f916a1c7f5f6d74687795971fd6a2a27 100644 (file)
 file(GLOB UTILITY_SOURCES *.c *.cpp)
 set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${UTILITY_SOURCES} PARENT_SCOPE)
 
-set(GENERATED_HEADER_CONFIG ${CMAKE_CURRENT_BINARY_DIR}/gmx_header_config_gen.h)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gmx_header_config_gen.h.cmakein
-               ${GENERATED_HEADER_CONFIG})
-
 set(UTILITY_PUBLIC_HEADERS
     arrayref.h
     basedefinitions.h
@@ -57,9 +53,8 @@ set(UTILITY_PUBLIC_HEADERS
     real.h
     smalloc.h
     stringutil.h
-    )
+    uniqueptr.h)
 gmx_install_headers(utility ${UTILITY_PUBLIC_HEADERS})
-gmx_install_headers(utility ${GENERATED_HEADER_CONFIG})
 
 if (BUILD_TESTING)
     add_subdirectory(tests)
index d70c1efd672e75731eea3794a322785d0d04ee3e..54a873e9feb098e56fcabe8ece1c869aead8eb67 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, 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.
  * \brief
  * Include file for configuration macros that affect installed headers.
  *
- * This include file (or rather, one that it includes) will configured by CMake
- * and installed with GROMACS header files so that they can refer to a central
- * location for \#defines that will be available for builds of projects that
- * depend on GROMACS.
- *
- * The actual defines are in gmx_header_config_gen.h to allow usage of relative
- * include paths before installation.
+ * This include file will be installed with GROMACS header files so that they
+ * can refer to a central location for \#defines that will be available for
+ * builds of projects that depend on GROMACS.
  *
  * \todo
- * It would be better to have the defines here such that they are not generated
- * from CMake, but instead detected using \#ifdefs (possible for some of the
- * macros currently used).
- * Even better would be to not have these defines at all.
+ * It would be better to not have these defines at all in installed headers.
  *
  * \inlibraryapi
  * \ingroup module_utility
  */
-#include "gmx_header_config_gen.h"
+
+/* We currently don't support MingW. And ICC also defines it */
+#ifdef _MSC_VER
+#define GMX_NATIVE_WINDOWS
+#endif
diff --git a/src/gromacs/utility/gmx_header_config_gen.h.cmakein b/src/gromacs/utility/gmx_header_config_gen.h.cmakein
deleted file mode 100644 (file)
index 61b550a..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the GROMACS molecular simulation package.
- *
- * Copyright (c) 2012,2014, 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.
- *
- * GROMACS is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * as published by the Free Software Foundation; either version 2.1
- * of the License, or (at your option) any later version.
- *
- * GROMACS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with GROMACS; if not, see
- * http://www.gnu.org/licenses, or write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
- *
- * If you want to redistribute modifications to GROMACS, please
- * consider that scientific software is very special. Version
- * control is crucial - bugs must be traceable. We will be happy to
- * consider code for inclusion in the official distribution, but
- * derived work must not be called official GROMACS. Details are found
- * in the README & COPYING files - if they are missing, get the
- * official version at http://www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the research papers on the package. Check out http://www.gromacs.org.
- */
-/*! \file
- * \brief
- * Generated include file for configuration macros that affect installed
- * headers.
- *
- * This include file will configured by CMake and installed with GROMACS
- * header files so that they can refer to a central location for \#defines that
- * will be available for builds of projects that depend on GROMACS.
- *
- * gmx_header_config.h should be included instead of this file to allow usage
- * of relative install paths.
- *
- * \inlibraryapi
- * \ingroup module_utility
- */
-
-#ifdef __CYGWIN__
-#define GMX_CYGWIN
-#endif
-
-/* We currently don't support MingW. And ICC also defines it */
-#ifdef _MSC_VER
-#define GMX_NATIVE_WINDOWS
-#endif