add_definitions(-DNOMINMAX)
endif()
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") #Work-around for cmake bug #10837
+ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Intel" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
+ endif()
+ if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Intel" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+ set(CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
+ endif()
+endif()
+
# Detect boost unless GMX_EXTERNAL_BOOST is explicitly OFF
# Used for default if GMX_EXTERNAL_BOOST is not defined (first CMake pass)
if(NOT DEFINED GMX_EXTERNAL_BOOST OR GMX_EXTERNAL_BOOST)
install(FILES COPYING DESTINATION ${DATA_INSTALL_DIR} COMPONENT data)
if(GMX_EXTERNAL_BOOST)
- include_directories(${Boost_INCLUDE_DIRS})
+ include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${Boost_INCLUDE_DIRS})
else()
- include_directories(BEFORE ${CMAKE_SOURCE_DIR}/src/external/boost)
+ include_directories(BEFORE SYSTEM ${CMAKE_SOURCE_DIR}/src/external/boost)
list(APPEND INSTALLED_HEADER_INCLUDE_DIRS ${INCL_INSTALL_DIR}/gromacs/external/boost)
list(APPEND INSTALLED_HEADED_DEFINITIONS "-DBOOST_NO_TYPEID")
# typeid not supported for minimal internal version
endif()
GMX_TEST_CFLAG(CFLAGS_WARN "-Wall -Wno-unused -Wunused-value -Wunused-parameter" GMXC_CFLAGS)
GMX_TEST_CFLAG(CFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wno-sign-compare -Wpointer-arith" GMXC_CFLAGS)
+ if(NOT GMX_GPU) #TODO: Fix that CUDA code has warnings
+ GMX_TEST_CFLAG(CFLAGS_WARN_UNDEF "-Wundef" GMXC_CFLAGS)
+ endif()
# Since 4.8 on by default. For previous version disabling is a no-op. Only disabling for Release because with assert
# the warnings are OK.
GMX_TEST_CFLAG(CFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CFLAGS_RELEASE_ONLY)
# Problematic with CUDA
# GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EFFCXX "-Wnon-virtual-dtor" GMXC_CXXFLAGS)
GMX_TEST_CXXFLAG(CXXFLAGS_WARN_EXTRA "-Wextra -Wno-missing-field-initializers -Wpointer-arith" GMXC_CXXFLAGS)
+ if(NOT GMX_GPU)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN_UNDEF "-Wundef" GMXC_CXXFLAGS)
+ endif()
GMX_TEST_CFLAG(CXXFLAGS_WARN_REL "-Wno-array-bounds" GMXC_CXXFLAGS_RELEASE_ONLY)
# new in gcc 4.5
GMX_TEST_CXXFLAG(CXXFLAGS_EXCESS_PREC "-fexcess-precision=fast" GMXC_CXXFLAGS_RELEASE)
GMX_TEST_CFLAG(CFLAGS_PRAGMA "-wd161" GMXC_CFLAGS)
endif()
endif()
-# 177: function/variable ".." was declared but never referenced
+ if(CMAKE_C_COMPILER_VERSION VERSION_LESS 15.00.00)
# 193: zero used for undefined preprocessing identifier ".."
+ GMX_TEST_CFLAG(CFLAGS_WARN_OLD -wd193 GMXC_CFLAGS)
+ endif()
+# 177: function/variable ".." was declared but never referenced
# 271: trailing comma is nonstandard
# 304: access control not specified ("public" by default)
# 383: value copied to temporary, reference to temporary used
#3346: dynamic exception specifications are deprecated
#11074: Inlining inhibited by limit max-size(/max-total-size)
#11076: To get full report use -opt-report=3 -opt-report-phase ipo (shown for previous remark)
- GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd177 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076" GMXC_CFLAGS)
+ GMX_TEST_CFLAG(CFLAGS_WARN "-w3 -wd177 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076" GMXC_CFLAGS)
GMX_TEST_CFLAG(CFLAGS_STDGNU "-std=gnu99" GMXC_CFLAGS)
GMX_TEST_CFLAG(CFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CFLAGS_RELEASE)
GMX_TEST_CFLAG(CFLAGS_DEBUG "-O0" GMXC_CFLAGS_DEBUG) #icc defaults to -O2 even with -g
GMX_TEST_CFLAG(CFLAGS_PRAGMA "/wd161" GMXC_CFLAGS)
endif()
endif()
- GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346" GMXC_CFLAGS)
+ if(CMAKE_C_COMPILER_VERSION VERSION_LESS 15.00.00)
+ GMX_TEST_CFLAG(CFLAGS_WARN_OLD /wd193 GMXC_CFLAGS)
+ endif()
+ GMX_TEST_CFLAG(CFLAGS_WARN "/W3 /wd177 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346" GMXC_CFLAGS)
GMX_TEST_CFLAG(CFLAGS_OPT "/Qip" GMXC_CFLAGS_RELEASE)
endif()
endif()
GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "-wd161" GMXC_CXXFLAGS)
endif()
endif()
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.00.00)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN_OLD -wd193 GMXC_CXXFLAGS)
+ endif()
#All but the following warnings are identical for the C-compiler (see above)
#1782: #pragma once is obsolete
#2282: unrecognized GCC pragma
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd177 -wd193 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076 -wd1782 -wd2282" GMXC_CXXFLAGS)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN "-w3 -wd177 -wd271 -wd304 -wd383 -wd424 -wd444 -wd522 -wd593 -wd869 -wd981 -wd1418 -wd1419 -wd1572 -wd1599 -wd2259 -wd2415 -wd2547 -wd2557 -wd3280 -wd3346 -wd11074 -wd11076 -wd1782 -wd2282" GMXC_CXXFLAGS)
GMX_TEST_CXXFLAG(CXXFLAGS_OPT "-ip -funroll-all-loops -alias-const -ansi-alias" GMXC_CXXFLAGS_RELEASE)
GMX_TEST_CXXFLAG(CXXFLAGS_DEBUG "-O0" GMXC_CXXFLAGS_DEBUG)
GMX_TEST_CXXFLAG(CXXFLAGS_FP_RELASSERT "-fp-model except -fp-model precise" GMXC_CXXFLAGS_RELWITHASSERT)
GMX_TEST_CXXFLAG(CXXFLAGS_PRAGMA "/wd161" GMXC_CXXFLAGS)
endif()
endif()
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd177 /wd193 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
+ if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 15.00.00)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN_OLD /wd193 GMXC_CXXFLAGS)
+ endif()
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/W3 /wd177 /wd271 /wd304 /wd383 /wd424 /wd444 /wd522 /wd593 /wd869 /wd981 /wd1418 /wd1419 /wd1572 /wd1599 /wd2259 /wd2415 /wd2547 /wd2557 /wd3280 /wd3346 /wd1782 /wd2282" GMXC_CXXFLAGS)
GMX_TEST_CXXFLAG(CXXFLAGS_OPT "/Qip" GMXC_CXXFLAGS_RELEASE)
endif()
endif()
set(GTEST_INCLUDE_DIRS ${GTEST_DIR}/include)
set(GMOCK_INCLUDE_DIRS ${GMOCK_DIR}/include ${GTEST_INCLUDE_DIRS})
-include_directories(BEFORE ${GTEST_INCLUDE_DIRS})
-include_directories(BEFORE ${GTEST_DIR})
-include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
-include_directories(BEFORE ${GMOCK_DIR})
+include_directories(BEFORE SYSTEM ${GTEST_INCLUDE_DIRS})
+include_directories(BEFORE SYSTEM ${GTEST_DIR})
+include_directories(BEFORE SYSTEM ${GMOCK_INCLUDE_DIRS})
+include_directories(BEFORE SYSTEM ${GMOCK_DIR})
if (HAS_NO_UNUSED_VARIABLE)
set_source_files_properties(${GTEST_SOURCES} PROPERTIES COMPILE_FLAGS "-Wno-unused-variable")
/* Copy pointer */
rbuf = b->rbuf+b->nreal;
-#if (__ICC >= 1500 || __ICL >= 1500) && defined __MIC__
+#if (defined __ICC && __ICC >= 1500 || defined __ICL && __ICL >= 1500) && defined __MIC__
#pragma novector /* Work-around for incorrect vectorization */
#endif
for (i = 0; (i < nr); i++)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, 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.
void _inc_nrnb(t_nrnb *nrnb, int enr, int inc, char *file, int line);
-#if DEBUG_NRNB
+#ifdef DEBUG_NRNB
#define inc_nrnb(nrnb, enr, inc) _inc_nrnb(nrnb, enr, inc, __FILE__, __LINE__)
#else
#define inc_nrnb(nrnb, enr, inc) (nrnb)->n[enr] += inc
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2013,2014,2015, 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.
return _mm256_insertf128_ps(_mm256_castps128_ps256(in0), in1, 1);
}
-#if UNROLLJ == 8
+#if defined(UNROLLJ) && UNROLLJ == 8
static gmx_inline void
load_lj_pair_params(const real *nbfp, const int *type, int aj,
__m256 *c6_S, __m256 *c12_S)
}
#endif
-#if UNROLLJ == 4
+#if defined(UNROLLJ) && UNROLLJ == 4
static gmx_inline void
load_lj_pair_params2(const real *nbfp0, const real *nbfp1,
const int *type, int aj,
}
#endif
-
/* The load_table functions below are performance critical.
* The routines issue UNROLLI*UNROLLJ _mm_load_ps calls.
* As these all have latencies, scheduling is crucial.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015, 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.
*/
ndx = 0;
ndx_excl = 0;
-#if __ICC == 1400 || __ICL == 1400
+#if defined _ICC && __ICC == 1400 || defined __ICL && __ICL == 1400
#pragma novector /* Work-around for incorrect vectorization */
#endif
for (mb = 0; mb < mtop->nmolblock; mb++)
#line 2 "scanner.cpp"
#line 50 "scanner.l"
-#if !_gmx_sel_yyIN_HEADER
+#if !defined _gmx_sel_yyIN_HEADER
#include "gmxpre.h"
#endif
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2009,2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2009,2010,2011,2012,2013,2014,2015, 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.
* \ingroup module_selection
*/
%top{
-#if !_gmx_sel_yyIN_HEADER
+#if !defined _gmx_sel_yyIN_HEADER
#include "gmxpre.h"
#endif
#line 6 "scanner_flex.h"
#line 50 "scanner.l"
-#if !_gmx_sel_yyIN_HEADER
+#if !defined _gmx_sel_yyIN_HEADER
#include "gmxpre.h"
#endif
#endif
gmx_simd_cvt_f2dd(luf, &lu0, &lu1);
/* Last iteration(s) performed in double - if we had 22 bits, this gets us to 44 (~1e-15) */
-#if (GMX_SIMD_MATH_TARGET_SINGLE_BITS < GMX_SIMD_ACCURACY_BITS_DOUBLE)
+#if (GMX_SIMD_ACCURACY_BITS_SINGLE < GMX_SIMD_ACCURACY_BITS_DOUBLE)
lu0 = gmx_simd_rsqrt_iter_d(lu0, x0);
lu1 = gmx_simd_rsqrt_iter_d(lu1, x1);
#endif
-#if (GMX_SIMD_MATH_TARGET_SINGLE_BITS*2 < GMX_SIMD_ACCURACY_BITS_DOUBLE)
+#if (GMX_SIMD_ACCURACY_BITS_SINGLE*2 < GMX_SIMD_ACCURACY_BITS_DOUBLE)
lu0 = gmx_simd_rsqrt_iter_d(lu0, x0);
lu1 = gmx_simd_rsqrt_iter_d(lu1, x1);
#endif
* to indicate a function is inlined.
* C++ code should use plain `inline`, as that is already in C++98.
*/
-#if !defined __cplusplus && _MSC_VER
+#if !defined __cplusplus && defined _MSC_VER
#define gmx_inline __inline
#else
/* C++ or C99 */
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2011,2012,2013,2014,2015, 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.
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
+include_directories(BEFORE SYSTEM ${GMOCK_INCLUDE_DIRS})
include_directories(${LIBXML2_INCLUDE_DIR})
file(GLOB TESTUTILS_SOURCES *.cpp)
function (gmx_add_unit_test_object_library NAME)
if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
- include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
+ include_directories(BEFORE SYSTEM ${GMOCK_INCLUDE_DIRS})
add_library(${NAME} OBJECT ${UNITTEST_TARGET_OPTIONS} ${ARGN})
set_property(TARGET ${NAME} APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS}")
set_property(TARGET ${NAME} APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")
function (gmx_build_unit_test NAME EXENAME)
if (GMX_BUILD_UNITTESTS AND BUILD_TESTING)
- include_directories(BEFORE ${GMOCK_INCLUDE_DIRS})
+ include_directories(BEFORE SYSTEM ${GMOCK_INCLUDE_DIRS})
add_executable(${EXENAME} ${UNITTEST_TARGET_OPTIONS} ${ARGN} ${TESTUTILS_DIR}/unittest_main.cpp)
set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_DEFINITIONS "${GMOCK_COMPILE_DEFINITIONS}")
set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_FLAGS "${GMOCK_COMPILE_FLAGS}")