From 22d744325d1266b09afd746d2abe50f8094c745e Mon Sep 17 00:00:00 2001 From: Teemu Murtola Date: Wed, 9 Jul 2014 08:09:26 +0300 Subject: [PATCH] Clean up gmx_header_config - 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 | 2 - doxygen/suppressions.txt | 3 - src/config.h.cmakein | 3 + src/gromacs/linearalgebra/gmx_blas.h | 6 -- src/gromacs/linearalgebra/gmx_lapack.h | 6 -- src/gromacs/utility/.gitignore | 1 - src/gromacs/utility/CMakeLists.txt | 7 +-- src/gromacs/utility/gmx_header_config.h | 23 ++++---- .../utility/gmx_header_config_gen.h.cmakein | 58 ------------------- 9 files changed, 14 insertions(+), 95 deletions(-) delete mode 100644 src/gromacs/utility/gmx_header_config_gen.h.cmakein diff --git a/CMakeLists.txt b/CMakeLists.txt index ca7094d156..a876dca72e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/doxygen/suppressions.txt b/doxygen/suppressions.txt index 592505a962..0fe2a7d0cb 100644 --- a/doxygen/suppressions.txt +++ b/doxygen/suppressions.txt @@ -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" diff --git a/src/config.h.cmakein b/src/config.h.cmakein index b1397b5c59..2e208b36cd 100644 --- a/src/config.h.cmakein +++ b/src/config.h.cmakein @@ -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 diff --git a/src/gromacs/linearalgebra/gmx_blas.h b/src/gromacs/linearalgebra/gmx_blas.h index cd327cbf7a..991cf8b2e6 100644 --- a/src/gromacs/linearalgebra/gmx_blas.h +++ b/src/gromacs/linearalgebra/gmx_blas.h @@ -66,12 +66,6 @@ #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 diff --git a/src/gromacs/linearalgebra/gmx_lapack.h b/src/gromacs/linearalgebra/gmx_lapack.h index 98761cdbd8..b29535a6e5 100644 --- a/src/gromacs/linearalgebra/gmx_lapack.h +++ b/src/gromacs/linearalgebra/gmx_lapack.h @@ -72,12 +72,6 @@ #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 diff --git a/src/gromacs/utility/.gitignore b/src/gromacs/utility/.gitignore index bd574593cd..c9b05c53b1 100644 --- a/src/gromacs/utility/.gitignore +++ b/src/gromacs/utility/.gitignore @@ -1,2 +1 @@ baseversion-gen.c -gmx_header_config_gen.h diff --git a/src/gromacs/utility/CMakeLists.txt b/src/gromacs/utility/CMakeLists.txt index 84b48dbb6c..3a386173f9 100644 --- a/src/gromacs/utility/CMakeLists.txt +++ b/src/gromacs/utility/CMakeLists.txt @@ -35,10 +35,6 @@ 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) diff --git a/src/gromacs/utility/gmx_header_config.h b/src/gromacs/utility/gmx_header_config.h index d70c1efd67..54a873e9fe 100644 --- a/src/gromacs/utility/gmx_header_config.h +++ b/src/gromacs/utility/gmx_header_config.h @@ -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. @@ -36,21 +36,18 @@ * \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 index 61b550a2cc..0000000000 --- a/src/gromacs/utility/gmx_header_config_gen.h.cmakein +++ /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 -- 2.22.0