From 5ce5d9f459e29c8fe4ffa0f60e7cdf022bcb7142 Mon Sep 17 00:00:00 2001 From: Rossen Apostolov Date: Fri, 7 Mar 2014 19:14:03 +0100 Subject: [PATCH] Cleaned up endif/else-s in CMakeLists.txt and *.cmake files Removed FindBLAS/LAPACK.cmake files which come anyway with CMake > 2.8.8. Included properly the licenses in some of the BlueGene*.cmake files. Change-Id: I69d68566865facf0af759526a579f32c5c444464 --- CMakeLists.txt | 38 +- CTestConfig.cmake | 6 +- admin/includedeps.cmake | 12 +- cmake/FindBLAS.cmake | 610 ------------------ cmake/FindFFTW.cmake | 16 +- cmake/FindLAPACK.cmake | 336 ---------- cmake/Platform/BlueGeneQ-base.cmake | 76 ++- cmake/Platform/BlueGeneQ-static-XL-C.cmake | 73 ++- cmake/Platform/BlueGeneQ-static-XL-CXX.cmake | 73 ++- cmake/Platform/BlueGeneQ-static.cmake | 39 +- cmake/ThreadMPI.cmake | 39 +- cmake/gmxCFlags.cmake | 8 +- cmake/gmxDetectSimd.cmake | 4 +- cmake/gmxFindFlagsForSource.cmake | 20 +- cmake/gmxManageFFTLibraries.cmake | 4 +- cmake/gmxManageGPU.cmake | 8 +- cmake/gmxManageLinearAlgebraLibraries.cmake | 2 +- cmake/gmxManageMPI.cmake | 10 +- cmake/gmxManageOpenMP.cmake | 6 +- cmake/gmxManageSuffixes.cmake | 4 +- cmake/gmxOptionUtilities.cmake | 4 +- cmake/gmxSetBuildInformation.cmake | 15 +- cmake/gmxTestAVXMaskload.cmake | 6 +- cmake/gmxTestFloatFormat.cmake | 22 +- cmake/gmxTestInline.cmake | 16 +- cmake/gmxTestInlineASM.cmake | 8 +- cmake/gmxTestIsfinite.cmake | 29 +- cmake/gmxTestLargeFiles.cmake | 34 +- cmake/gmxTestMPI_IN_PLACE.cmake | 8 +- cmake/gmxTestPipes.cmake | 11 +- cmake/gmxTestRestrict.cmake | 16 +- cmake/gmxTestSignal.cmake | 18 +- cmake/gmxTestXDR.cmake | 14 +- doxygen/CMakeLists.txt | 8 +- src/CMakeLists.txt | 2 +- src/external/gmock-1.7.0/CMakeLists.txt | 4 +- src/gromacs/CMakeLists.txt | 6 +- src/gromacs/analysisdata/CMakeLists.txt | 4 +- src/gromacs/commandline/tests/CMakeLists.txt | 4 +- src/gromacs/essentialdynamics/CMakeLists.txt | 2 +- src/gromacs/fft/CMakeLists.txt | 4 +- src/gromacs/fileio/CMakeLists.txt | 2 +- src/gromacs/gmxana/CMakeLists.txt | 2 +- src/gromacs/gmxlib/CMakeLists.txt | 4 +- src/gromacs/gmxlib/thread_mpi/CMakeLists.txt | 8 +- src/gromacs/gmxpreprocess/CMakeLists.txt | 2 +- src/gromacs/math/CMakeLists.txt | 2 +- src/gromacs/onlinehelp/CMakeLists.txt | 4 +- src/gromacs/options/CMakeLists.txt | 4 +- src/gromacs/pulling/CMakeLists.txt | 2 +- src/gromacs/selection/CMakeLists.txt | 4 +- src/gromacs/simd/CMakeLists.txt | 2 +- src/gromacs/timing/CMakeLists.txt | 4 +- src/gromacs/tools/CMakeLists.txt | 2 +- src/gromacs/trajectoryanalysis/CMakeLists.txt | 2 +- src/gromacs/utility/CMakeLists.txt | 2 +- src/programs/CMakeLists.txt | 4 +- src/testutils/TestMacros.cmake | 8 +- 58 files changed, 458 insertions(+), 1219 deletions(-) delete mode 100644 cmake/FindBLAS.cmake delete mode 100644 cmake/FindLAPACK.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c04820946..8fcbfac813 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ set(CUSTOM_VERSION_STRING "" mark_as_advanced(CUSTOM_VERSION_STRING) if (CUSTOM_VERSION_STRING) set(PROJECT_VERSION ${CUSTOM_VERSION_STRING}) -endif (CUSTOM_VERSION_STRING) +endif() set(LIBRARY_SOVERSION 0) set(LIBRARY_VERSION ${LIBRARY_SOVERSION}.0.0) # It is a bit irritating, but this has to be set separately for now! @@ -208,7 +208,7 @@ gmx_detect_target_architecture() if(GMX_CPU_ACCELERATION) # Stay compatible with old Jenkins command line options for specific SIMD acceleration set(GMX_SIMD "${GMX_CPU_ACCELERATION}" CACHE STRING "SIMD instruction set level and compiler optimization" FORCE) -endif(GMX_CPU_ACCELERATION) +endif() if(NOT GMX_TARGET_MIC) include(gmxDetectSimd) @@ -321,10 +321,10 @@ set(PKG_CFLAGS "") if(GMX_DOUBLE) add_definitions(-DGMX_DOUBLE) set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_DOUBLE") -endif(GMX_DOUBLE) +endif() if(GMX_SOFTWARE_INVSQRT) set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_SOFTWARE_INVSQRT") -endif(GMX_SOFTWARE_INVSQRT) +endif() @@ -415,7 +415,7 @@ mark_as_advanced(GMX_XML) # include_directories(${LIBXML2_INCLUDE_DIR}) # set(PKG_XML libxml-2.0) # set(XML_LIBRARIES ${LIBXML2_LIBRARIES}) -#endif(GMX_XML) +#endif() option(GMX_GSL "Add support for gsl" OFF) if (GMX_GSL) @@ -425,8 +425,8 @@ if (GMX_GSL) include_directories(${GSL_INCLUDE_DIR}) set(PKG_GSL gsl) set(HAVE_LIBGSL 1) - endif(GSL_FOUND) -endif (GMX_GSL) + endif() +endif() option(GMX_X11 "Use X window system" OFF) if (GMX_X11) @@ -439,7 +439,7 @@ if (GMX_X11) "gmx view will not be available.") endif() include_directories(${X11_INCLUDE_DIR}) -endif(GMX_X11) +endif() include(ThreadMPI) set(THREAD_MPI_LIB thread_mpi) @@ -453,7 +453,7 @@ if(GMX_THREAD_MPI) set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_THREAD_MPI") set(GMX_MPI 1) set(MPI_IN_PLACE_EXISTS 1) -endif(GMX_THREAD_MPI) +endif() tmpi_get_source_list(THREAD_MPI_SRC) # If atomics are manually disabled a define is needed because atomics.h doesn't depend on config.h if (TMPI_ATOMICS_DISABLED) @@ -463,11 +463,11 @@ endif() if(GMX_GPU) # now that we have detected the dependencies, do the second configure pass gmx_gpu_setup() -endif(GMX_GPU) +endif() if(CYGWIN) set(GMX_CYGWIN 1) -endif(CYGWIN) +endif() if(WIN32 AND NOT CYGWIN) set(GMX_NATIVE_WINDOWS 1) @@ -482,7 +482,7 @@ if(GMX_GIT_VERSION_INFO) message(FATAL_ERROR "Cannot generate git version information from source tree not under git. " "Set GMX_GIT_VERSION_INFO=OFF to proceed.") - endif () + endif() # We need at least git v1.5.3 be able to parse git's date output. If not # found or the version is too small, we can't generate version information. find_package(Git) @@ -614,7 +614,7 @@ include(gmxTestXDR) gmx_test_xdr(GMX_SYSTEM_XDR) if(NOT GMX_SYSTEM_XDR) set(GMX_INTERNAL_XDR 1) -endif(NOT GMX_SYSTEM_XDR) +endif() ################################################## @@ -679,7 +679,7 @@ if(GMX_LOAD_PLUGINS) else() set(PKG_DL_LIBS) endif() -endif(GMX_LOAD_PLUGINS) +endif() set(VMD_QUIETLY TRUE CACHE INTERNAL "") # Link real-time library for POSIX timers. The check for clock_gettime @@ -691,7 +691,7 @@ endif() # Math and thread libraries must often come after all others when linking... if(HAVE_LIBM) list(APPEND GMX_EXTRA_LIBRARIES m) -endif(HAVE_LIBM) +endif() option(GMX_NACL "Configure for Native Client builds" OFF) if (GMX_NACL) @@ -706,7 +706,7 @@ if(GMX_FAHCORE) set(COREWRAP_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/../corewrap" CACHE STRING "Path to swindirect.h") include_directories(${COREWRAP_INCLUDE_DIR}) -endif(GMX_FAHCORE) +endif() option(GMX_BUILD_HELP "Build man pages, HTML help, and completions automatically (requires that compiled binaries can be executed on the build host)" OFF) mark_as_advanced(GMX_BUILD_HELP) @@ -807,7 +807,7 @@ else() install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/external/boost/boost DESTINATION ${INCL_INSTALL_DIR}/gromacs/external/boost COMPONENT development) - endif () + endif() endif() if(GMX_USE_TNG) @@ -837,7 +837,7 @@ if (GMX_BUILD_FOR_COVERAGE) # be triggered by using an API against its specification isn't usually # worth the effort. add_definitions(-DNDEBUG -DBOOST_DISABLE_ASSERTS -DGMX_DISABLE_ASSERTS) -endif () +endif() if (BUILD_TESTING) # "tests" target builds all the separate test binaries. @@ -858,7 +858,7 @@ if (NOT GMX_BUILD_MDRUN_ONLY) add_subdirectory(doxygen) add_subdirectory(share) add_subdirectory(scripts) -endif () +endif() add_subdirectory(src) if (BUILD_TESTING) diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 9a7b6346e2..d33a736546 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2011, by the GROMACS development team, led by +# Copyright (c) 2011,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. @@ -37,11 +37,11 @@ SET(CTEST_NIGHTLY_START_TIME "00:00:00 EST") IF(NOT DEFINED CTEST_DROP_METHOD) SET(CTEST_DROP_METHOD "http") -ENDIF(NOT DEFINED CTEST_DROP_METHOD) +ENDIF() IF(CTEST_DROP_METHOD STREQUAL "http") SET(CTEST_DROP_SITE "cdash.gromacs.org") SET(CTEST_DROP_LOCATION "/submit.php?project=Gromacs") SET(CTEST_DROP_SITE_CDASH TRUE) -ENDIF(CTEST_DROP_METHOD STREQUAL "http") +ENDIF() diff --git a/admin/includedeps.cmake b/admin/includedeps.cmake index 97a71290da..e7a98a7071 100644 --- a/admin/includedeps.cmake +++ b/admin/includedeps.cmake @@ -64,15 +64,15 @@ endfunction () if (NOT DEFINED SRCDIR OR NOT DEFINED BUILDDIR OR NOT DEFINED OUTDIR) message(FATAL_ERROR "Required input variable (SRCDIR, BUILDDIR, OUTDIR) not set") -endif () +endif() if (NOT DEFINED PYTHON_EXECUTABLE) set(PYTHON_EXECUTABLE python) -endif () +endif() if (NOT DEFINED MODE) set(MODE "CHECK") -endif () +endif() if (MODE STREQUAL "CHECK") set(GRAPHOPTIONS --check) @@ -83,9 +83,9 @@ elseif (MODE STREQUAL "GRAPHS") set(GRAPHOPTIONS --module-graph module-deps.dot --module-file-graphs -o ${OUTDIR}) -else () +else() message(FATAL_ERROR "Unknown mode ${MODE}") -endif () +endif() file(MAKE_DIRECTORY ${OUTDIR}) generate_module_file_list(${SRCDIR} ${OUTDIR}/module-files.txt ${MODE}) @@ -101,4 +101,4 @@ execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SRCDIR}/admin/includedeps.py if (MODE STREQUAL "GRAPHS" AND DOT_EXECUTABLE) file(GLOB DOT_INPUT_FILES ${OUTDIR}/*.dot) execute_process(COMMAND ${DOT_EXECUTABLE} -Tpng -O ${DOT_INPUT_FILES}) -endif () +endif() diff --git a/cmake/FindBLAS.cmake b/cmake/FindBLAS.cmake deleted file mode 100644 index bb79ca2891..0000000000 --- a/cmake/FindBLAS.cmake +++ /dev/null @@ -1,610 +0,0 @@ -# - Find BLAS library -# This module finds an installed fortran library that implements the BLAS -# linear-algebra interface (see http://www.netlib.org/blas/). -# The list of libraries searched for is taken -# from the autoconf macro file, acx_blas.m4 (distributed at -# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html). -# -# This module sets the following variables: -# BLAS_FOUND - set to true if a library implementing the BLAS interface -# is found -# BLAS_LINKER_FLAGS - uncached list of required linker flags (excluding -l -# and -L). -# BLAS_LIBRARIES - uncached list of libraries (using full path name) to -# link against to use BLAS -# BLAS95_LIBRARIES - uncached list of libraries (using full path name) -# to link against to use BLAS95 interface -# BLAS95_FOUND - set to true if a library implementing the BLAS f95 interface -# is found -# BLA_STATIC if set on this determines what kind of linkage we do (static) -# BLA_VENDOR if set checks only the specified vendor, if not set checks -# all the possibilities -# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK -########## -### List of vendors (BLA_VENDOR) valid in this module -## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), -## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model), -## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic -# C/CXX should be enabled to use Intel mkl - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -include(CheckFunctionExists) -include(CheckFortranFunctionExists) -include(CheckTypeSize) - -set(_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - -# Check the language being used -get_property( _LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES ) -if( _LANGUAGES_ MATCHES Fortran ) - set( _CHECK_FORTRAN TRUE ) -elseif( (_LANGUAGES_ MATCHES C) OR (_LANGUAGES_ MATCHES CXX) ) - set( _CHECK_FORTRAN FALSE ) -else() - if(BLAS_FIND_REQUIRED) - message(FATAL_ERROR "FindBLAS requires Fortran, C, or C++ to be enabled.") - else(BLAS_FIND_REQUIRED) - message(STATUS "Looking for BLAS... - NOT found (Unsupported languages)") - return() - endif(BLAS_FIND_REQUIRED) -endif( ) - -macro(Check_Fortran_Libraries LIBRARIES _prefix _name _flags _list _thread) -# This macro checks for the existence of the combination of fortran libraries -# given by _list. If the combination is found, this macro checks (using the -# Check_Fortran_Function_Exists macro) whether can link against that library -# combination using the name of a routine given by _name using the linker -# flags given by _flags. If the combination of libraries is found and passes -# the link test, LIBRARIES is set to the list of complete library paths that -# have been found. Otherwise, LIBRARIES is set to FALSE. - -# N.B. _prefix is the prefix applied to the names of all cached variables that -# are generated internally and marked advanced by this macro. - -set(_libdir ${ARGN}) - -set(_libraries_work TRUE) -set(${LIBRARIES}) -set(_combined_name) -if (NOT _libdir) - if (WIN32) - set(_libdir ENV LIB) - elseif (APPLE) - set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH) - else () - set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH) - endif () -endif () - -foreach(_library ${_list}) - set(_combined_name ${_combined_name}_${_library}) - - if(_libraries_work) - if (BLA_STATIC) - if (WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif ( WIN32 ) - if (APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else (APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif (APPLE) - else (BLA_STATIC) - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - # for ubuntu's libblas3gf and liblapack3gf packages - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) - endif () - endif (BLA_STATIC) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ${_libdir} - ) - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_work) -endforeach(_library ${_list}) -if(_libraries_work) - # Test this combination of libraries. - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread}) -# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - if (_CHECK_FORTRAN) - check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) - else() - check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) - endif() - set(CMAKE_REQUIRED_LIBRARIES) - mark_as_advanced(${_prefix}${_combined_name}_WORKS) - set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) -endif(_libraries_work) -if(NOT _libraries_work) - set(${LIBRARIES} FALSE) -endif(NOT _libraries_work) -#message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro(Check_Fortran_Libraries) - -set(BLAS_LINKER_FLAGS) -set(BLAS_LIBRARIES) -set(BLAS95_LIBRARIES) -if ($ENV{BLA_VENDOR} MATCHES ".+") - set(BLA_VENDOR $ENV{BLA_VENDOR}) -else ($ENV{BLA_VENDOR} MATCHES ".+") - if(NOT BLA_VENDOR) - set(BLA_VENDOR "All") - endif(NOT BLA_VENDOR) -endif ($ENV{BLA_VENDOR} MATCHES ".+") - -if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # gotoblas (http://www.tacc.utexas.edu/tacc-projects/gotoblas2) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "goto2" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - -if (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - dgemm - "" - "f77blas;atlas" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "ATLAS" OR BLA_VENDOR STREQUAL "All") - -# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "sgemm;dgemm;blas" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "PhiPACK" OR BLA_VENDOR STREQUAL "All") - -# BLAS in Alpha CXML library? -if (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "cxml" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "CXML" OR BLA_VENDOR STREQUAL "All") - -# BLAS in Alpha DXML library? (now called CXML, see above) -if (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "dxml" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "DXML" OR BLA_VENDOR STREQUAL "All") - -# BLAS in Sun Performance library? -if (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "-xlic_lib=sunperf" - "sunperf;sunmath" - "" - ) - if(BLAS_LIBRARIES) - set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf") - endif(BLAS_LIBRARIES) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "SunPerf" OR BLA_VENDOR STREQUAL "All") - -# BLAS in SCSL library? (SGI/Cray Scientific Library) -if (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "scsl" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "SCSL" OR BLA_VENDOR STREQUAL "All") - -# BLAS in SGIMATH library? -if (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "complib.sgimath" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "SGIMATH" OR BLA_VENDOR STREQUAL "All") - -# BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "essl;blas" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "IBMESSL" OR BLA_VENDOR STREQUAL "All") - -#BLAS in acml library? -if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") - if( ((BLA_VENDOR STREQUAL "ACML") AND (NOT BLAS_ACML_LIB_DIRS)) OR - ((BLA_VENDOR STREQUAL "ACML_MP") AND (NOT BLAS_ACML_MP_LIB_DIRS)) OR - ((BLA_VENDOR STREQUAL "ACML_GPU") AND (NOT BLAS_ACML_GPU_LIB_DIRS)) - ) - # try to find acml in "standard" paths - if( WIN32 ) - file( GLOB _ACML_ROOT "C:/AMD/acml*/ACML-EULA.txt" ) - else() - file( GLOB _ACML_ROOT "/opt/acml*/ACML-EULA.txt" ) - endif() - if( WIN32 ) - file( GLOB _ACML_GPU_ROOT "C:/AMD/acml*/GPGPUexamples" ) - else() - file( GLOB _ACML_GPU_ROOT "/opt/acml*/GPGPUexamples" ) - endif() - list(GET _ACML_ROOT 0 _ACML_ROOT) - list(GET _ACML_GPU_ROOT 0 _ACML_GPU_ROOT) - if( _ACML_ROOT ) - get_filename_component( _ACML_ROOT ${_ACML_ROOT} PATH ) - check_type_size("int" SIZEOF_INTEGER) - if( SIZEOF_INTEGER EQUAL 8 ) - set( _ACML_PATH_SUFFIX "_int64" ) - else() - set( _ACML_PATH_SUFFIX "" ) - endif() - if( CMAKE_Fortran_COMPILER_ID STREQUAL "Intel" ) - set( _ACML_COMPILER32 "ifort32" ) - set( _ACML_COMPILER64 "ifort64" ) - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "SunPro" ) - set( _ACML_COMPILER32 "sun32" ) - set( _ACML_COMPILER64 "sun64" ) - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "PGI" ) - set( _ACML_COMPILER32 "pgi32" ) - if( WIN32 ) - set( _ACML_COMPILER64 "win64" ) - else() - set( _ACML_COMPILER64 "pgi64" ) - endif() - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "Open64" ) - # 32 bit builds not supported on Open64 but for code simplicity - # We'll just use the same directory twice - set( _ACML_COMPILER32 "open64_64" ) - set( _ACML_COMPILER64 "open64_64" ) - elseif( CMAKE_Fortran_COMPILER_ID STREQUAL "NAG" ) - set( _ACML_COMPILER32 "nag32" ) - set( _ACML_COMPILER64 "nag64" ) - else() #if( CMAKE_Fortran_COMPILER_ID STREQUAL "GNU" ) - set( _ACML_COMPILER32 "gfortran32" ) - set( _ACML_COMPILER64 "gfortran64" ) - endif() - - if( BLA_VENDOR STREQUAL "ACML_MP" ) - set(_ACML_MP_LIB_DIRS - "${_ACML_ROOT}/${_ACML_COMPILER32}_mp${_ACML_PATH_SUFFIX}/lib" - "${_ACML_ROOT}/${_ACML_COMPILER64}_mp${_ACML_PATH_SUFFIX}/lib" ) - else() #if( _BLAS_VENDOR STREQUAL "ACML" ) - set(_ACML_LIB_DIRS - "${_ACML_ROOT}/${_ACML_COMPILER32}${_ACML_PATH_SUFFIX}/lib" - "${_ACML_ROOT}/${_ACML_COMPILER64}${_ACML_PATH_SUFFIX}/lib" ) - endif() - endif() - elseif(BLAS_${BLA_VENDOR}_LIB_DIRS) - set(_${BLA_VENDOR}_LIB_DIRS ${BLAS_${BLA_VENDOR}_LIB_DIRS}) - endif() - - if( BLA_VENDOR STREQUAL "ACML_MP" ) - foreach( BLAS_ACML_MP_LIB_DIRS ${_ACML_MP_LIB_DIRS}) - check_fortran_libraries ( - BLAS_LIBRARIES - BLAS - sgemm - "" "acml_mp;acml_mv" "" ${BLAS_ACML_MP_LIB_DIRS} - ) - if( BLAS_LIBRARIES ) - break() - endif() - endforeach() - elseif( BLA_VENDOR STREQUAL "ACML_GPU" ) - foreach( BLAS_ACML_GPU_LIB_DIRS ${_ACML_GPU_LIB_DIRS}) - check_fortran_libraries ( - BLAS_LIBRARIES - BLAS - sgemm - "" "acml;acml_mv;CALBLAS" "" ${BLAS_ACML_GPU_LIB_DIRS} - ) - if( BLAS_LIBRARIES ) - break() - endif() - endforeach() - else() #if( _BLAS_VENDOR STREQUAL "ACML" ) - foreach( BLAS_ACML_LIB_DIRS ${_ACML_LIB_DIRS} ) - check_fortran_libraries ( - BLAS_LIBRARIES - BLAS - sgemm - "" "acml;acml_mv" "" ${BLAS_ACML_LIB_DIRS} - ) - if( BLAS_LIBRARIES ) - break() - endif() - endforeach() - endif() - - # Either acml or acml_mp should be in LD_LIBRARY_PATH but not both - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml;acml_mv" - "" - ) - endif(NOT BLAS_LIBRARIES) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml_mp;acml_mv" - "" - ) - endif(NOT BLAS_LIBRARIES) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml;acml_mv;CALBLAS" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif () # ACML - -# Apple BLAS library? -if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") -if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - dgemm - "" - "Accelerate" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") - -if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") - if ( NOT BLAS_LIBRARIES ) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - dgemm - "" - "vecLib" - "" - ) - endif ( NOT BLAS_LIBRARIES ) -endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") -# Generic BLAS library? -if (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_LIBRARIES - BLAS - sgemm - "" - "blas" - "" - ) - endif(NOT BLAS_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Generic" OR BLA_VENDOR STREQUAL "All") - -#BLAS in intel mkl 10 library? (em64t 64bit) -if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") - if (NOT WIN32) - set(LM "-lm") - endif () - if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) - if(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) - find_package(Threads) - else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) - find_package(Threads REQUIRED) - endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) - - set(BLAS_SEARCH_LIBS "") - - if(BLA_F95) - set(BLAS_mkl_SEARCH_SYMBOL SGEMM) - set(_LIBRARIES BLAS95_LIBRARIES) - if (WIN32) - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40") - else (WIN32) - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide") - endif () - if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") - # old version - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide") - - # mkl >= 10.3 - if (CMAKE_C_COMPILER MATCHES ".+gcc.*") - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core") - set(LM "${LM};-lgomp") - else () - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5") - endif () - endif () - endif (WIN32) - if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core") - endif () - else (BLA_F95) - set(BLAS_mkl_SEARCH_SYMBOL sgemm) - set(_LIBRARIES BLAS_LIBRARIES) - if (WIN32) - list(APPEND BLAS_SEARCH_LIBS - "mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40") - else (WIN32) - if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel mkl_intel_thread mkl_core guide") - endif () - if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All") - - # old version - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_lp64 mkl_intel_thread mkl_core guide") - - # mkl >= 10.3 - if (CMAKE_C_COMPILER MATCHES ".+gcc.*") - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_lp64 mkl_gnu_thread mkl_core") - set(LM "${LM};-lgomp") - else () - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_lp64 mkl_intel_thread mkl_core iomp5") - endif () - endif () - - #older vesions of intel mkl libs - if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl") - list(APPEND BLAS_SEARCH_LIBS - "mkl_ia32") - list(APPEND BLAS_SEARCH_LIBS - "mkl_em64t") - endif () - endif (WIN32) - if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All") - list(APPEND BLAS_SEARCH_LIBS - "mkl_intel_lp64 mkl_sequential mkl_core") - endif () - endif (BLA_F95) - - foreach (IT ${BLAS_SEARCH_LIBS}) - string(REPLACE " " ";" SEARCH_LIBS ${IT}) - if (${_LIBRARIES}) - else () - check_fortran_libraries( - ${_LIBRARIES} - BLAS - ${BLAS_mkl_SEARCH_SYMBOL} - "" - "${SEARCH_LIBS}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif () - endforeach () - - endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) -endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") - - -if(BLA_F95) - if(BLAS95_LIBRARIES) - set(BLAS95_FOUND TRUE) - else(BLAS95_LIBRARIES) - set(BLAS95_FOUND FALSE) - endif(BLAS95_LIBRARIES) - - if(NOT BLAS_FIND_QUIETLY) - if(BLAS95_FOUND) - message(STATUS "A library with BLAS95 API found.") - else(BLAS95_FOUND) - if(BLAS_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with BLAS95 API not found. Please specify library location.") - else(BLAS_FIND_REQUIRED) - message(STATUS - "A library with BLAS95 API not found. Please specify library location.") - endif(BLAS_FIND_REQUIRED) - endif(BLAS95_FOUND) - endif(NOT BLAS_FIND_QUIETLY) - set(BLAS_FOUND TRUE) - set(BLAS_LIBRARIES "${BLAS95_LIBRARIES}") -else(BLA_F95) - if(BLAS_LIBRARIES) - set(BLAS_FOUND TRUE) - else(BLAS_LIBRARIES) - set(BLAS_FOUND FALSE) - endif(BLAS_LIBRARIES) - - if(NOT BLAS_FIND_QUIETLY) - if(BLAS_FOUND) - message(STATUS "A library with BLAS API found.") - else(BLAS_FOUND) - if(BLAS_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with BLAS API not found. Please specify library location." - ) - else(BLAS_FIND_REQUIRED) - message(STATUS - "A library with BLAS API not found. Please specify library location." - ) - endif(BLAS_FIND_REQUIRED) - endif(BLAS_FOUND) - endif(NOT BLAS_FIND_QUIETLY) -endif(BLA_F95) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_blas_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/cmake/FindFFTW.cmake b/cmake/FindFFTW.cmake index e44ffe5640..e7af8a22c5 100644 --- a/cmake/FindFFTW.cmake +++ b/cmake/FindFFTW.cmake @@ -66,7 +66,7 @@ if(NOT __pkg_config_checked_PC_${FFTW} OR NOT ${FFTW}_LIBRARY) if(NOT PC_${FFTW}_FOUND) message(STATUS "pkg-config could not detect ${${FFTW}_PKG}, trying generic detection") endif() -endif(NOT __pkg_config_checked_PC_${FFTW} OR NOT ${FFTW}_LIBRARY) +endif() find_path(${FFTW}_INCLUDE_DIR "fftw3.h" HINTS ${PC_${FFTW}_INCLUDE_DIRS}) find_library(${FFTW}_LIBRARY NAMES "${${FFTW}_PKG}" HINTS ${PC_${FFTW}_LIBRARY_DIRS}) @@ -90,7 +90,7 @@ if (${FFTW}_FOUND) if (HAVE_LIBM) #adding MATH_LIBRARIES here to allow static libs, this does not harm us as we are anyway using it set(CMAKE_REQUIRED_LIBRARIES m) - endif (HAVE_LIBM) + endif () gmx_check_if_changed(FFTW_LIBRARY_CHANGED ${FFTW}_LIBRARIES) if (FFTW_LIBRARY_CHANGED) unset(FOUND_${FFTW}_PLAN CACHE) @@ -98,7 +98,7 @@ if (${FFTW}_FOUND) check_library_exists("${${FFTW}_LIBRARIES}" "${${FFTW}_FUNCTION_PREFIX}_plan_r2r_1d" "" FOUND_${FFTW}_PLAN) if(NOT FOUND_${FFTW}_PLAN) message(FATAL_ERROR "Could not find ${${FFTW}_FUNCTION_PREFIX}_plan_r2r_1d in ${${FFTW}_LIBRARY}, take a look at the error message in ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log to find out what went wrong. If you are using a static lib (.a) make sure you have specified all dependencies of ${${FFTW}_PKG} in ${FFTW}_LIBRARY by hand (e.g. -D${FFTW}_LIBRARY='/path/to/lib${${FFTW}_PKG}.so;/path/to/libm.so') !") - endif(NOT FOUND_${FFTW}_PLAN) + endif() # Check for FFTW3 compiled with --enable-avx, which is slower for GROMACS than --enable-sse or --enable-sse2 foreach(AVX_FUNCTION ${${FFTW}_FUNCTION_PREFIX}_have_simd_avx) @@ -109,7 +109,7 @@ if (${FFTW}_FOUND) if(${FFTW}_HAVE_${AVX_FUNCTION}) set(${FFTW}_HAVE_AVX TRUE) break() - endif(${FFTW}_HAVE_${AVX_FUNCTION}) + endif() endforeach() #in 3.3 sse function name has changed @@ -121,7 +121,7 @@ if (${FFTW}_FOUND) if(${FFTW}_HAVE_${SIMD_FCT}) set(${FFTW}_HAVE_SIMD TRUE) break() - endif(${FFTW}_HAVE_${SIMD_FCT}) + endif() endforeach() #Verify FFTW is compiled with fPIC (necessary for shared libraries) if (CMAKE_OBJDUMP AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND BUILD_SHARED_LIBS) @@ -129,9 +129,9 @@ if (${FFTW}_FOUND) if (${${FFTW}_OBJDUMP} MATCHES "R_X86_64" #Should always be true for static libraries. Checks that objdump works properly and that the library isn't dynamic AND NOT ${${FFTW}_OBJDUMP} MATCHES "R_X86_64_PLT32") message(FATAL_ERROR "The FFTW library ${${FFTW}_LIBRARY} cannot be used with shared libraries. Provide a different FFTW library by setting ${FFTW}_LIBRARY. If you don't have a different one, recompile FFTW with \"--enable-shared\" or \"--with-pic\". Or disable shared libraries for Gromacs by setting BUILD_SHARED_LIBS to \"no\". Note: Disabling shared libraries requires up to 10x as much disk space.") - endif () - endif () + endif() + endif() set(CMAKE_REQUIRED_LIBRARIES) -endif (${FFTW}_FOUND) +endif () mark_as_advanced(${FFTW}_INCLUDE_DIR ${FFTW}_LIBRARY) diff --git a/cmake/FindLAPACK.cmake b/cmake/FindLAPACK.cmake deleted file mode 100644 index 0ae98dfa7b..0000000000 --- a/cmake/FindLAPACK.cmake +++ /dev/null @@ -1,336 +0,0 @@ -# - Find LAPACK library -# This module finds an installed fortran library that implements the LAPACK -# linear-algebra interface (see http://www.netlib.org/lapack/). -# -# The approach follows that taken for the autoconf macro file, acx_lapack.m4 -# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html). -# -# This module sets the following variables: -# LAPACK_FOUND - set to true if a library implementing the LAPACK interface -# is found -# LAPACK_LINKER_FLAGS - uncached list of required linker flags (excluding -l -# and -L). -# LAPACK_LIBRARIES - uncached list of libraries (using full path name) to -# link against to use LAPACK -# LAPACK95_LIBRARIES - uncached list of libraries (using full path name) to -# link against to use LAPACK95 -# LAPACK95_FOUND - set to true if a library implementing the LAPACK f95 -# interface is found -# BLA_STATIC if set on this determines what kind of linkage we do (static) -# BLA_VENDOR if set checks only the specified vendor, if not set checks -# all the possibilities -# BLA_F95 if set on tries to find the f95 interfaces for BLAS/LAPACK -### List of vendors (BLA_VENDOR) valid in this module -## Intel(mkl), ACML,Apple, NAS, Generic - -#============================================================================= -# Copyright 2007-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -set(_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - -get_property(_LANGUAGES_ GLOBAL PROPERTY ENABLED_LANGUAGES) -if (NOT _LANGUAGES_ MATCHES Fortran) -include(CheckFunctionExists) -else (NOT _LANGUAGES_ MATCHES Fortran) -include(CheckFortranFunctionExists) -endif (NOT _LANGUAGES_ MATCHES Fortran) - -set(LAPACK_FOUND FALSE) -set(LAPACK95_FOUND FALSE) - -# TODO: move this stuff to separate module - -macro(Check_Lapack_Libraries LIBRARIES _prefix _name _flags _list _blas _threads) -# This macro checks for the existence of the combination of fortran libraries -# given by _list. If the combination is found, this macro checks (using the -# Check_Fortran_Function_Exists macro) whether can link against that library -# combination using the name of a routine given by _name using the linker -# flags given by _flags. If the combination of libraries is found and passes -# the link test, LIBRARIES is set to the list of complete library paths that -# have been found. Otherwise, LIBRARIES is set to FALSE. - -# N.B. _prefix is the prefix applied to the names of all cached variables that -# are generated internally and marked advanced by this macro. - -set(_libraries_work TRUE) -set(${LIBRARIES}) -set(_combined_name) -if (NOT _libdir) - if (WIN32) - set(_libdir ENV LIB) - elseif (APPLE) - set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH) - else () - set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH) - endif () -endif () -foreach(_library ${_list}) - set(_combined_name ${_combined_name}_${_library}) - - if(_libraries_work) - if (BLA_STATIC) - if (WIN32) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif ( WIN32 ) - if (APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES .lib ${CMAKE_FIND_LIBRARY_SUFFIXES}) - else (APPLE) - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - endif (APPLE) - else (BLA_STATIC) - if (CMAKE_SYSTEM_NAME STREQUAL "Linux") - # for ubuntu's libblas3gf and liblapack3gf packages - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES} .so.3gf) - endif () - endif (BLA_STATIC) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ${_libdir} - ) - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_work ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_work) -endforeach(_library ${_list}) - -if(_libraries_work) - # Test this combination of libraries. - if(UNIX AND BLA_STATIC) - set(CMAKE_REQUIRED_LIBRARIES ${_flags} "-Wl,--start-group" ${${LIBRARIES}} ${_blas} "-Wl,--end-group" ${_threads}) - else(UNIX AND BLA_STATIC) - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas} ${_threads}) - endif(UNIX AND BLA_STATIC) -# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - if (NOT _LANGUAGES_ MATCHES Fortran) - check_function_exists("${_name}_" ${_prefix}${_combined_name}_WORKS) - else (NOT _LANGUAGES_ MATCHES Fortran) - check_fortran_function_exists(${_name} ${_prefix}${_combined_name}_WORKS) - endif (NOT _LANGUAGES_ MATCHES Fortran) - set(CMAKE_REQUIRED_LIBRARIES) - mark_as_advanced(${_prefix}${_combined_name}_WORKS) - set(_libraries_work ${${_prefix}${_combined_name}_WORKS}) - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endif(_libraries_work) - - if(_libraries_work) - set(${LIBRARIES} ${${LIBRARIES}} ${_blas} ${_threads}) - else(_libraries_work) - set(${LIBRARIES} FALSE) - endif(_libraries_work) - -endmacro(Check_Lapack_Libraries) - - -set(LAPACK_LINKER_FLAGS) -set(LAPACK_LIBRARIES) -set(LAPACK95_LIBRARIES) - - -if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(BLAS) -else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(BLAS REQUIRED) -endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - - -if(BLAS_FOUND) - set(LAPACK_LINKER_FLAGS ${BLAS_LINKER_FLAGS}) - if ($ENV{BLA_VENDOR} MATCHES ".+") - set(BLA_VENDOR $ENV{BLA_VENDOR}) - else ($ENV{BLA_VENDOR} MATCHES ".+") - if(NOT BLA_VENDOR) - set(BLA_VENDOR "All") - endif(NOT BLA_VENDOR) - endif ($ENV{BLA_VENDOR} MATCHES ".+") - -if (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "goto2" - "${BLAS_LIBRARIES}" - "" - ) - endif(NOT LAPACK_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Goto" OR BLA_VENDOR STREQUAL "All") - - -#acml lapack - if (BLA_VENDOR MATCHES "ACML.*" OR BLA_VENDOR STREQUAL "All") - if (BLAS_LIBRARIES MATCHES ".+acml.+") - set (LAPACK_LIBRARIES ${BLAS_LIBRARIES}) - endif () - endif () - -# Apple LAPACK library? -if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "Accelerate" - "${BLAS_LIBRARIES}" - "" - ) - endif(NOT LAPACK_LIBRARIES) -endif (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") -if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "vecLib" - "${BLAS_LIBRARIES}" - "" - ) - endif ( NOT LAPACK_LIBRARIES ) -endif (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") -# Generic LAPACK library? -if (BLA_VENDOR STREQUAL "Generic" OR - BLA_VENDOR STREQUAL "ATLAS" OR - BLA_VENDOR STREQUAL "All") - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack" - "${BLAS_LIBRARIES}" - "" - ) - endif ( NOT LAPACK_LIBRARIES ) -endif () -#intel lapack -if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") - if (NOT WIN32) - set(LM "-lm") - endif () - if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) - if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_PACKAGE(Threads) - else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(Threads REQUIRED) - endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - if (BLA_F95) - if(NOT LAPACK95_LIBRARIES) - # old - check_lapack_libraries( - LAPACK95_LIBRARIES - LAPACK - cheev - "" - "mkl_lapack95" - "${BLAS95_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT LAPACK95_LIBRARIES) - if(NOT LAPACK95_LIBRARIES) - # new >= 10.3 - check_lapack_libraries( - LAPACK95_LIBRARIES - LAPACK - CHEEV - "" - "mkl_intel_lp64" - "${BLAS95_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT LAPACK95_LIBRARIES) - else(BLA_F95) - if(NOT LAPACK_LIBRARIES) - # old - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_lapack" - "${BLAS_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT LAPACK_LIBRARIES) - if(NOT LAPACK_LIBRARIES) - # new >= 10.3 - check_lapack_libraries( - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_gf_lp64" - "${BLAS_LIBRARIES}" - "${CMAKE_THREAD_LIBS_INIT};${LM}" - ) - endif(NOT LAPACK_LIBRARIES) - endif(BLA_F95) - endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) -endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") -else(BLAS_FOUND) - message(STATUS "LAPACK requires BLAS") -endif(BLAS_FOUND) - -if(BLA_F95) - if(LAPACK95_LIBRARIES) - set(LAPACK95_FOUND TRUE) - else(LAPACK95_LIBRARIES) - set(LAPACK95_FOUND FALSE) - endif(LAPACK95_LIBRARIES) - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK95_FOUND) - message(STATUS "A library with LAPACK95 API found.") - else(LAPACK95_FOUND) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with LAPACK95 API not found. Please specify library location." - ) - else(LAPACK_FIND_REQUIRED) - message(STATUS - "A library with LAPACK95 API not found. Please specify library location." - ) - endif(LAPACK_FIND_REQUIRED) - endif(LAPACK95_FOUND) - endif(NOT LAPACK_FIND_QUIETLY) - set(LAPACK_FOUND "${LAPACK95_FOUND}") - set(LAPACK_LIBRARIES "${LAPACK95_LIBRARIES}") -else(BLA_F95) - if(LAPACK_LIBRARIES) - set(LAPACK_FOUND TRUE) - else(LAPACK_LIBRARIES) - set(LAPACK_FOUND FALSE) - endif(LAPACK_LIBRARIES) - - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK_FOUND) - message(STATUS "A library with LAPACK API found.") - else(LAPACK_FOUND) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR - "A required library with LAPACK API not found. Please specify library location." - ) - else(LAPACK_FIND_REQUIRED) - message(STATUS - "A library with LAPACK API not found. Please specify library location." - ) - endif(LAPACK_FIND_REQUIRED) - endif(LAPACK_FOUND) - endif(NOT LAPACK_FIND_QUIETLY) -endif(BLA_F95) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${_lapack_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) diff --git a/cmake/Platform/BlueGeneQ-base.cmake b/cmake/Platform/BlueGeneQ-base.cmake index 94a4b01373..5edacb98f1 100644 --- a/cmake/Platform/BlueGeneQ-base.cmake +++ b/cmake/Platform/BlueGeneQ-base.cmake @@ -1,18 +1,72 @@ - +# +# This file is part of the GROMACS molecular simulation package. +# +# Copyright (c) 2013,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. +# #============================================================================= -# Copyright 2010 Kitware, Inc. +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # Copyright 2010 Todd Gamblin # Copyright 2012 Julien Bigot -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) # # BlueGeneQ base platform file. diff --git a/cmake/Platform/BlueGeneQ-static-XL-C.cmake b/cmake/Platform/BlueGeneQ-static-XL-C.cmake index f602d6d70d..a814ac765f 100644 --- a/cmake/Platform/BlueGeneQ-static-XL-C.cmake +++ b/cmake/Platform/BlueGeneQ-static-XL-C.cmake @@ -1,18 +1,73 @@ - +# +# This file is part of the GROMACS molecular simulation package. +# +# Copyright (c) 2013,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. +# #============================================================================= -# Copyright 2010 Kitware, Inc. +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # Copyright 2010 Todd Gamblin # Copyright 2012 Julien Bigot +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. # -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. #============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) include(BlueGeneQ-static) __BlueGeneQ_set_static_flags(XL C) diff --git a/cmake/Platform/BlueGeneQ-static-XL-CXX.cmake b/cmake/Platform/BlueGeneQ-static-XL-CXX.cmake index f602d6d70d..a814ac765f 100644 --- a/cmake/Platform/BlueGeneQ-static-XL-CXX.cmake +++ b/cmake/Platform/BlueGeneQ-static-XL-CXX.cmake @@ -1,18 +1,73 @@ - +# +# This file is part of the GROMACS molecular simulation package. +# +# Copyright (c) 2013,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. +# #============================================================================= -# Copyright 2010 Kitware, Inc. +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # Copyright 2010 Todd Gamblin # Copyright 2012 Julien Bigot +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. # -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. #============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) include(BlueGeneQ-static) __BlueGeneQ_set_static_flags(XL C) diff --git a/cmake/Platform/BlueGeneQ-static.cmake b/cmake/Platform/BlueGeneQ-static.cmake index f5bd5b4dd7..de1c3a4605 100644 --- a/cmake/Platform/BlueGeneQ-static.cmake +++ b/cmake/Platform/BlueGeneQ-static.cmake @@ -1,18 +1,39 @@ - #============================================================================= -# Copyright 2010 Kitware, Inc. +# CMake - Cross Platform Makefile Generator +# Copyright 2000-2011 Kitware, Inc., Insight Software Consortium # Copyright 2010 Todd Gamblin # Copyright 2012 Julien Bigot +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# * Neither the names of Kitware, Inc., the Insight Software Consortium, +# nor the names of their contributors may be used to endorse or promote +# products derived from this software without specific prior written +# permission. # -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. #============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) include(BlueGeneQ-base) set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) diff --git a/cmake/ThreadMPI.cmake b/cmake/ThreadMPI.cmake index 244c5ac871..7eabdd450f 100644 --- a/cmake/ThreadMPI.cmake +++ b/cmake/ThreadMPI.cmake @@ -41,6 +41,7 @@ include(CheckCSourceCompiles) # Options: # include directory for thread_mpi/atomic.h MACRO(TMPI_TEST_ATOMICS INCDIR) + if (NOT DEFINED TMPI_ATOMICS) try_compile(TEST_ATOMICS "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestAtomics.c" @@ -53,11 +54,12 @@ MACRO(TMPI_TEST_ATOMICS INCDIR) # positive results. set(TMPI_ATOMICS ${TEST_ATOMICS} CACHE INTERNAL "Whether atomic operations are found") set(TMPI_ATOMICS_INCDIR ${INCDIR} CACHE INTERNAL "Atomic operations check include dir") - else (TEST_ATOMICS) + else () message(STATUS "Atomic operations not found") unset(TEST_ATOMICS) - endif(TEST_ATOMICS) - endif(NOT DEFINED TMPI_ATOMICS) + endif() + endif() + ENDMACRO(TMPI_TEST_ATOMICS VARIABLE) @@ -69,9 +71,9 @@ if (CMAKE_USE_PTHREADS_INIT) elseif (CMAKE_USE_WIN32_THREADS_INIT) set(THREAD_WINDOWS 1) set(THREAD_LIB) -else () +else() message(FATAL_ERROR "Thread support required") -endif (CMAKE_USE_PTHREADS_INIT) +endif () # Turns on thread_mpi core threading functions. MACRO(TMPI_ENABLE_CORE INCDIR) @@ -98,9 +100,9 @@ MACRO(TMPI_ENABLE_CORE INCDIR) ) if (PTHREAD_SETAFFINITY) set(HAVE_PTHREAD_SETAFFINITY 1) - endif (PTHREAD_SETAFFINITY) + endif () set(CMAKE_REQUIRED_LIBRARIES) - endif (THREAD_PTHREADS) + endif () # this runs on POSIX systems @@ -131,36 +133,36 @@ MACRO(TMPI_ENABLE) mark_as_advanced(THREAD_MPI_WAIT_FOR_NO_ONE) if (THREAD_MPI_WAIT_FOR_NO_ONE) set(TMPI_WAIT_FOR_NO_ONE 1) - else (THREAD_MPI_WAIT_FOR_NO_ONE) + else () set(TMPI_WAIT_FOR_NO_ONE 0) - endif (THREAD_MPI_WAIT_FOR_NO_ONE) + endif () # the copy buffer option option(THREAD_MPI_COPY_BUFFER "Use an intermediate copy buffer for small message sizes, to allow blocking sends to return quickly. Only useful in programs with relatively uncoupled threads (infrequent MPI communication)" OFF) mark_as_advanced(THREAD_MPI_COPY_BUFFER) if (THREAD_MPI_COPY_BUFFER) set(TMPI_COPY_BUFFER 1) - else (THREAD_MPI_COPY_BUFFER) + else () set(TMPI_COPY_BUFFER 0) - endif (THREAD_MPI_COPY_BUFFER) + endif () # the profiling option option(THREAD_MPI_PROFILING "Turn on simple MPI profiling." OFF) mark_as_advanced(THREAD_MPI_PROFILING) if (THREAD_MPI_PROFILING) set(TMPI_PROFILE 1) - else (THREAD_MPI_PROFILING) + else () set(TMPI_PROFILE 0) - endif (THREAD_MPI_PROFILING) + endif () # tmpi warnings for testing option(THREAD_MPI_WARNINGS "Turn thread_mpi warnings for testing." OFF) mark_as_advanced(THREAD_MPI_WARNINGS) if (THREAD_MPI_WARNINGS) set(TMPI_WARNINGS 1) - else (THREAD_MPI_WARNINGS) + else () set(TMPI_WARNINGS 0) - endif (THREAD_MPI_WARNINGS) + endif () include(CheckCSourceCompiles) ENDMACRO(TMPI_ENABLE) @@ -172,14 +174,17 @@ MACRO(TMPI_GET_SOURCE_LIST SRC_VARIABLE) thread_mpi/tmpi_malloc.c thread_mpi/atomic.c thread_mpi/lock.c) + if (THREAD_PTHREADS) list(APPEND ${SRC_VARIABLE} thread_mpi/pthreads.c) elseif (THREAD_WINDOWS) list(APPEND ${SRC_VARIABLE} thread_mpi/winthreads.c) - endif (THREAD_PTHREADS) + endif () + if (TMPI_CXX_LIB) list(APPEND ${SRC_VARIABLE} thread_mpi/system_error.cpp) - endif (TMPI_CXX_LIB) + endif () + if (TMPI_ENABLED) list(APPEND ${SRC_VARIABLE} thread_mpi/alltoall.c thread_mpi/p2p_protocol.c diff --git a/cmake/gmxCFlags.cmake b/cmake/gmxCFlags.cmake index 1f373d6437..955811745d 100644 --- a/cmake/gmxCFlags.cmake +++ b/cmake/gmxCFlags.cmake @@ -37,10 +37,10 @@ MACRO(GMX_TEST_CFLAG VARIABLE FLAGS CFLAGSVAR) IF(NOT DEFINED ${VARIABLE}) CHECK_C_COMPILER_FLAG("${FLAGS}" ${VARIABLE}) - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() IF (${VARIABLE}) SET (${CFLAGSVAR} "${FLAGS} ${${CFLAGSVAR}}") - ENDIF (${VARIABLE}) + ENDIF () ENDMACRO(GMX_TEST_CFLAG VARIABLE FLAGS CFLAGSVAR) # Test C++ flags FLAGS, and set VARIABLE to true if the work. Also add the @@ -48,10 +48,10 @@ ENDMACRO(GMX_TEST_CFLAG VARIABLE FLAGS CFLAGSVAR) MACRO(GMX_TEST_CXXFLAG VARIABLE FLAGS CXXFLAGSVAR) IF(NOT DEFINED ${VARIABLE}) CHECK_CXX_COMPILER_FLAG("${FLAGS}" ${VARIABLE}) - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() IF (${VARIABLE}) SET (${CXXFLAGSVAR} "${FLAGS} ${${CXXFLAGSVAR}}") - ENDIF (${VARIABLE}) + ENDIF () ENDMACRO(GMX_TEST_CXXFLAG VARIABLE FLAGS CXXFLAGSVAR) # Set the real CMake variables for compiler flags. This should be a function diff --git a/cmake/gmxDetectSimd.cmake b/cmake/gmxDetectSimd.cmake index 550a9ac161..447ce66782 100644 --- a/cmake/gmxDetectSimd.cmake +++ b/cmake/gmxDetectSimd.cmake @@ -55,9 +55,9 @@ function(gmx_suggest_x86_simd _suggested_simd) if(GMX_X86_GCC_INLINE_ASM) set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM") - else(GMX_X86_GCC_INLINE_ASM) + else() set(GCC_INLINE_ASM_DEFINE "") - endif(GMX_X86_GCC_INLINE_ASM) + endif() message(STATUS "Detecting best SIMD instructions for this CPU") diff --git a/cmake/gmxFindFlagsForSource.cmake b/cmake/gmxFindFlagsForSource.cmake index 6a569b22b7..e5db8d1cef 100644 --- a/cmake/gmxFindFlagsForSource.cmake +++ b/cmake/gmxFindFlagsForSource.cmake @@ -54,14 +54,15 @@ FUNCTION(GMX_FIND_CFLAG_FOR_SOURCE VARIABLE DESCRIPTION SOURCE CFLAGSVAR) set(${VARIABLE}_FLAG "${_testflag}" CACHE INTERNAL "${DESCRIPTION}") set(${VARIABLE} 1 CACHE INTERNAL "Result of test for ${DESCRIPTION}" FORCE) break() - else(${${COMPILE_VARIABLE}}) + else() set(${VARIABLE} 0 CACHE INTERNAL "Result of test for ${DESCRIPTION}" FORCE) - endif(${${COMPILE_VARIABLE}}) + endif() endforeach() - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() + IF (${VARIABLE}) SET (${CFLAGSVAR} "${${CFLAGSVAR}} ${${VARIABLE}_FLAG}" PARENT_SCOPE) - ENDIF (${VARIABLE}) + ENDIF () ENDFUNCTION(GMX_FIND_CFLAG_FOR_SOURCE VARIABLE DESCRIPTION SOURCE CFLAGSVAR) @@ -73,6 +74,7 @@ ENDFUNCTION(GMX_FIND_CFLAG_FOR_SOURCE VARIABLE DESCRIPTION SOURCE CFLAGSVAR) # FLAGSVAR Variable (string) to which we should add the correct flag # Args 5 through N Multiple strings with optimization flags to test FUNCTION(GMX_FIND_CXXFLAG_FOR_SOURCE VARIABLE DESCRIPTION SOURCE CXXFLAGSVAR) + IF(NOT DEFINED ${VARIABLE}) # Insert a blank element last in the list (try without any flags too) # This must come last, since some compilers (Intel) might try to @@ -87,13 +89,15 @@ FUNCTION(GMX_FIND_CXXFLAG_FOR_SOURCE VARIABLE DESCRIPTION SOURCE CXXFLAGSVAR) set(${VARIABLE}_FLAG "${_testflag}" CACHE INTERNAL "${DESCRIPTION}") set(${VARIABLE} 1 CACHE INTERNAL "Result of test for ${DESCRIPTION}" FORCE) break() - else(${${COMPILE_VARIABLE}}) + else() set(${VARIABLE} 0 CACHE INTERNAL "Result of test for ${DESCRIPTION}" FORCE) - endif(${${COMPILE_VARIABLE}}) + endif() endforeach() - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() + IF (${VARIABLE}) SET (${CXXFLAGSVAR} "${${CXXFLAGSVAR}} ${${VARIABLE}_FLAG}" PARENT_SCOPE) - ENDIF (${VARIABLE}) + ENDIF () + ENDFUNCTION(GMX_FIND_CXXFLAG_FOR_SOURCE VARIABLE DESCRIPTION SOURCE CXXFLAGSVAR) diff --git a/cmake/gmxManageFFTLibraries.cmake b/cmake/gmxManageFFTLibraries.cmake index 3edd654a0e..78a67531dc 100644 --- a/cmake/gmxManageFFTLibraries.cmake +++ b/cmake/gmxManageFFTLibraries.cmake @@ -147,9 +147,9 @@ elseif(${GMX_FFT_LIBRARY} STREQUAL "MKL") elseif(${GMX_FFT_LIBRARY} STREQUAL "FFTPACK") set(GMX_FFT_FFTPACK 1) set(FFT_STATUS_MESSAGE "Using internal FFT library - fftpack") -else(${GMX_FFT_LIBRARY} STREQUAL "FFTW3") +else() gmx_invalid_option_value(GMX_FFT_LIBRARY) -endif(${GMX_FFT_LIBRARY} STREQUAL "FFTW3") +endif() gmx_check_if_changed(FFT_CHANGED GMX_FFT_LIBRARY) if (FFT_CHANGED) message(STATUS "${FFT_STATUS_MESSAGE}") diff --git a/cmake/gmxManageGPU.cmake b/cmake/gmxManageGPU.cmake index 892f6a4292..569f028de4 100644 --- a/cmake/gmxManageGPU.cmake +++ b/cmake/gmxManageGPU.cmake @@ -118,7 +118,7 @@ ${_msg}") message(STATUS "No compatible CUDA toolkit found (v4.0+), disabling native GPU acceleration") set_property(CACHE GMX_GPU PROPERTY VALUE OFF) set(CUDA_NOTFOUND_AUTO ON) - else () + else() # the user requested CUDA, but it wasn't found message(FATAL_ERROR "${CUDA_NOTFOUND_MESSAGE}") endif() @@ -168,11 +168,11 @@ macro(get_cuda_compiler_info COMPILER_INFO COMPILER_FLAGS) string(REGEX REPLACE "[ ]+" ";" _cxx_flags_nospace "${BUILD_CXXFLAGS}") endif() SET(${COMPILER_FLAGS} "${CUDA_NVCC_FLAGS}${CUDA_NVCC_FLAGS_${_build_type}}; ${_cxx_flags_nospace}") - else () + else() SET(${COMPILER_INFO} "N/A") SET(${COMPILER_FLAGS} "N/A") - endif () - endif () + endif() + endif() endmacro () macro(gmx_gpu_setup) diff --git a/cmake/gmxManageLinearAlgebraLibraries.cmake b/cmake/gmxManageLinearAlgebraLibraries.cmake index fb723187da..aa1df74a5d 100644 --- a/cmake/gmxManageLinearAlgebraLibraries.cmake +++ b/cmake/gmxManageLinearAlgebraLibraries.cmake @@ -140,7 +140,7 @@ macro(manage_linear_algebra_library name function_in_library) if(GMX_EXTERNAL_${name}) if (NOT _library_was_found) message(FATAL_ERROR "You have set GMX_EXTERNAL_${name}=ON to instruct GROMACS to use an external ${name} library, but no external library could be detected.") - endif () + endif() # Actually trigger linking. list(APPEND LINEAR_ALGEBRA_LIBRARIES ${_libraries_to_link}) else() diff --git a/cmake/gmxManageMPI.cmake b/cmake/gmxManageMPI.cmake index 735ebf352b..5adc2627cd 100644 --- a/cmake/gmxManageMPI.cmake +++ b/cmake/gmxManageMPI.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2013, by the GROMACS development team, led by +# Copyright (c) 2012,2013,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. @@ -39,7 +39,7 @@ if(GMX_MPI) message(STATUS "MPI is not compatible with thread-MPI. Disabling thread-MPI.") set(GMX_THREAD_MPI OFF CACHE BOOL "Build a thread-MPI-based multithreaded version of GROMACS (not compatible with MPI)" FORCE) - endif(GMX_THREAD_MPI) + endif() # Test the CMAKE_C_COMPILER for being an MPI (wrapper) compiler TRY_COMPILE(MPI_FOUND ${CMAKE_BINARY_DIR} @@ -146,12 +146,12 @@ if(GMX_MPI) mark_as_advanced(file_cmd) endif() - else(MPI_FOUND) + else() message(FATAL_ERROR "MPI support requested, but no MPI compiler found. Either set the " "C-compiler (CMAKE_C_COMPILER) to the MPI compiler (often called mpicc), " "or set the variables reported missing for MPI_C above.") - endif(MPI_FOUND) + endif() include(gmxTestCatamount) gmx_test_catamount(GMX_CRAY_CATAMOUNT) @@ -163,4 +163,4 @@ if(GMX_MPI) set(GMX_LIB_MPI 1) set(PKG_CFLAGS "${PKG_CFLAGS} -DGMX_LIB_MPI") -endif(GMX_MPI) +endif() diff --git a/cmake/gmxManageOpenMP.cmake b/cmake/gmxManageOpenMP.cmake index d7b558974b..9993497ebf 100644 --- a/cmake/gmxManageOpenMP.cmake +++ b/cmake/gmxManageOpenMP.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2013, by the GROMACS development team, led by +# Copyright (c) 2012,2013,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. @@ -66,10 +66,10 @@ if(GMX_OPENMP) endif() endif() endif() - else(OPENMP_FOUND) + else() message(WARNING "The compiler you are using does not support OpenMP parallelism. This might hurt your performance a lot, in particular with GPUs. Try using a more recent version, or a different compiler. For now, we are proceeding by turning off OpenMP.") set(GMX_OPENMP OFF CACHE STRING "Whether GROMACS will use OpenMP parallelism." FORCE) - endif(OPENMP_FOUND) + endif() endif() endif() diff --git a/cmake/gmxManageSuffixes.cmake b/cmake/gmxManageSuffixes.cmake index 7e404f0967..6d4eb672e0 100644 --- a/cmake/gmxManageSuffixes.cmake +++ b/cmake/gmxManageSuffixes.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013, by the GROMACS development team, led by +# Copyright (c) 2013,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. @@ -79,4 +79,4 @@ unset(SUFFIXES_CHANGED) if (GMX_BUILD_MDRUN_ONLY) set(GMX_LIBS_SUFFIX "_mdrun${GMX_LIBS_SUFFIX}") -endif () +endif() diff --git a/cmake/gmxOptionUtilities.cmake b/cmake/gmxOptionUtilities.cmake index 1cbf7c89aa..7da67d4403 100644 --- a/cmake/gmxOptionUtilities.cmake +++ b/cmake/gmxOptionUtilities.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013, by the GROMACS development team, led by +# Copyright (c) 2013,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. @@ -78,7 +78,7 @@ function(GMX_OPTION_MULTICHOICE NAME DESCRIPTION DEFAULT) if (_found_index EQUAL -1) message(FATAL_ERROR "Invalid value for ${NAME}: ${_org_value}. " "Pick one of: ${_allowed_comma_separated}") - endif () + endif() # Always provide the upper-case value to the caller set(${NAME} "${${NAME}}" PARENT_SCOPE) endfunction() diff --git a/cmake/gmxSetBuildInformation.cmake b/cmake/gmxSetBuildInformation.cmake index 42a65bf977..277ed54c7d 100644 --- a/cmake/gmxSetBuildInformation.cmake +++ b/cmake/gmxSetBuildInformation.cmake @@ -60,9 +60,9 @@ macro(gmx_set_build_information) if(GMX_X86_GCC_INLINE_ASM) set(GCC_INLINE_ASM_DEFINE "-DGMX_X86_GCC_INLINE_ASM") - else(GMX_X86_GCC_INLINE_ASM) + else() set(GCC_INLINE_ASM_DEFINE "") - endif(GMX_X86_GCC_INLINE_ASM) + endif() message(STATUS "Setting build user/date/host/cpu information") if(CMAKE_HOST_UNIX) @@ -74,12 +74,12 @@ macro(gmx_set_build_information) execute_process( COMMAND uname -srm OUTPUT_VARIABLE TMP_HOST OUTPUT_STRIP_TRAILING_WHITESPACE) set(BUILD_HOST "@TMP_HOST@" CACHE INTERNAL "Build host & architecture") message(STATUS "Setting build user & time - OK") - else(CMAKE_HOST_UNIX) + else() set(BUILD_USER "Anonymous@unknown [CMAKE]" CACHE INTERNAL "Build user") set(BUILD_TIME "Unknown date" CACHE INTERNAL "Build date & time") set(BUILD_HOST "@CMAKE_HOST_SYSTEM@ @CMAKE_HOST_SYSTEM_PROCESSOR@" CACHE INTERNAL "Build host & architecture") message(STATUS "Setting build user & time - not on Unix, using anonymous") - endif(CMAKE_HOST_UNIX) + endif() if(NOT CMAKE_CROSSCOMPILING) # Get CPU information, e.g. for deciding what SIMD support exists @@ -157,8 +157,8 @@ macro(gmx_set_build_information) set(BUILD_CPU_FEATURES "" CACHE INTERNAL "Build CPU features") endif() - else(NOT CMAKE_CROSSCOMPILING) - + else() + set(BUILD_CPU_VENDOR "Unknown, cross-compiled" CACHE INTERNAL "Build CPU vendor") set(BUILD_CPU_BRAND "Unknown, cross-compiled" CACHE INTERNAL "Build CPU brand") set(BUILD_CPU_FAMILY "0" CACHE INTERNAL "Build CPU family") @@ -166,8 +166,7 @@ macro(gmx_set_build_information) set(BUILD_CPU_STEPPING "0" CACHE INTERNAL "Build CPU stepping") set(BUILD_CPU_FEATURES "" CACHE INTERNAL "Build CPU features") - endif(NOT CMAKE_CROSSCOMPILING) + endif() ENDIF(NOT DEFINED BUILD_USER) endmacro(gmx_set_build_information) - diff --git a/cmake/gmxTestAVXMaskload.cmake b/cmake/gmxTestAVXMaskload.cmake index 40d76c78ac..028bb49ad9 100644 --- a/cmake/gmxTestAVXMaskload.cmake +++ b/cmake/gmxTestAVXMaskload.cmake @@ -64,9 +64,5 @@ MACRO(GMX_TEST_AVX_GCC_MASKLOAD_BUG VARIABLE AVX_CFLAGS) MESSAGE(STATUS "Checking for gcc AVX maskload bug - not present") ENDIF() ENDIF() - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() ENDMACRO() - - - - diff --git a/cmake/gmxTestFloatFormat.cmake b/cmake/gmxTestFloatFormat.cmake index d3034a0b2f..00671573fc 100644 --- a/cmake/gmxTestFloatFormat.cmake +++ b/cmake/gmxTestFloatFormat.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009, by the GROMACS development team, led by +# Copyright (c) 2009,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. @@ -72,26 +72,26 @@ MACRO(GMX_TEST_FLOAT_FORMAT FP_IEEE754 FP_BIG_ENDIAN_BYTE FP_BIG_ENDIAN_WORD) IF(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc) SET(GMX_IEEE754_BB_BW TRUE) SET(GMX_IEEE754_LB_LW FALSE) - ELSE(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc) + ELSE() SET(GMX_IEEE754_BB_BW FALSE) SET(GMX_IEEE754_LB_LW TRUE) - ENDIF(CMAKE_SYSTEM_PROCESSOR MATCHES powerpc) + ENDIF() MESSAGE(STATUS "GMX_TEST_IEEE754_FORMAT found different results, consider setting CMAKE_OSX_ARCHITECTURES or CMAKE_TRY_COMPILE_OSX_ARCHITECTURES to one or no architecture !") - ENDIF(GMX_IEEE754_BB_BW AND GMX_IEEE754_LB_LW) + ENDIF() IF(GMX_IEEE754) SET(${FP_IEEE754} 1 CACHE INTERNAL "Result of test for IEEE754 FP format" FORCE) - ENDIF(GMX_IEEE754) + ENDIF() IF(GMX_IEEE754_BB_BW OR GMX_IEEE754_BB_LW) SET(${FP_BIG_ENDIAN_BYTE} 1 CACHE INTERNAL "Result of test for big endian FP byte order" FORCE) - ENDIF(GMX_IEEE754_BB_BW OR GMX_IEEE754_BB_LW) + ENDIF() IF(GMX_IEEE754_BB_BW OR GMX_IEEE754_LB_BW) SET(${FP_BIG_ENDIAN_WORD} 1 CACHE INTERNAL "Result of test for big endian FP word order" FORCE) - ENDIF(GMX_IEEE754_BB_BW OR GMX_IEEE754_LB_BW) + ENDIF() - endif(HAVE_${FP_IEEE754}) + endif() # just some informational output for the user if(GMX_IEEE754_BB_BW) @@ -102,10 +102,10 @@ MACRO(GMX_TEST_FLOAT_FORMAT FP_IEEE754 FP_BIG_ENDIAN_BYTE FP_BIG_ENDIAN_WORD) MESSAGE(STATUS "Checking floating point format - IEEE754 (LE byte, BE word)") elseif(GMX_IEEE754_LB_LW) MESSAGE(STATUS "Checking floating point format - IEEE754 (LE byte, LE word)") - else(GMX_IEEE754_LB_LW) + else() MESSAGE(STATUS "Checking floating point format - unknown") - endif(GMX_IEEE754_BB_BW) - ENDIF(NOT DEFINED HAVE_${FP_IEEE754}) + endif() + ENDIF() ENDMACRO(GMX_TEST_FLOAT_FORMAT FP_IEEE754 FP_BIG_ENDIAN_BYTE FP_BIG_ENDIAN_WORD) diff --git a/cmake/gmxTestInline.cmake b/cmake/gmxTestInline.cmake index 335f19b559..c9e8125981 100644 --- a/cmake/gmxTestInline.cmake +++ b/cmake/gmxTestInline.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009,2012, by the GROMACS development team, led by +# Copyright (c) 2009,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. @@ -47,24 +47,20 @@ MACRO(GMX_TEST_INLINE VARIABLE) FOREACH(KEYWORD "__inline__" "__inline" "inline") IF(NOT TEST_${VARIABLE}) - TRY_COMPILE(TEST_${VARIABLE} "${CMAKE_BINARY_DIR}" + TRY_COMPILE(TEST_${VARIABLE} "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestInline.c" COMPILE_DEFINITIONS "-DTESTINLINEDEF=${KEYWORD}" ) SET(LAST_INLINE_KEYWORD ${KEYWORD}) - ENDIF(NOT TEST_${VARIABLE}) + ENDIF() ENDFOREACH(KEYWORD) IF(TEST_${VARIABLE}) SET(${VARIABLE} ${LAST_INLINE_KEYWORD} CACHE INTERNAL "Inline keyword" FORCE) MESSAGE(STATUS "Checking for inline keyword - ${LAST_INLINE_KEYWORD}") - ELSE(TEST_${VARIABLE}) + ELSE() SET(${VARIABLE} " " CACHE INTERNAL "Inline keyword" FORCE) MESSAGE(STATUS "Checking for inline keyword - not found") - ENDIF(TEST_${VARIABLE}) + ENDIF() - ENDIF(NOT DEFINED TEST_${VARIABLE}) + ENDIF() ENDMACRO(GMX_TEST_INLINE VARIABLE) - - - - diff --git a/cmake/gmxTestInlineASM.cmake b/cmake/gmxTestInlineASM.cmake index 1d38f481dd..3ed3400d80 100644 --- a/cmake/gmxTestInlineASM.cmake +++ b/cmake/gmxTestInlineASM.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009,2010,2012,2013, by the GROMACS development team, led by +# Copyright (c) 2009,2010,2012,2013,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. @@ -50,12 +50,12 @@ MACRO(GMX_TEST_INLINE_ASM_GCC_X86 VARIABLE) if(${VARIABLE}) MESSAGE(STATUS "Checking for GCC x86 inline asm - supported") set(${VARIABLE} 1 CACHE INTERNAL "Result of test for GCC x86 inline asm" FORCE) - else(${VARIABLE}) + else() MESSAGE(STATUS "Checking for GCC x86 inline asm - not supported") set(${VARIABLE} 0 CACHE INTERNAL "Result of test for GCC x86 inline asm" FORCE) - endif(${VARIABLE}) + endif() - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() ENDMACRO(GMX_TEST_INLINE_ASM_GCC_X86 VARIABLE) diff --git a/cmake/gmxTestIsfinite.cmake b/cmake/gmxTestIsfinite.cmake index ca0f7d65ab..0a4a8077b3 100644 --- a/cmake/gmxTestIsfinite.cmake +++ b/cmake/gmxTestIsfinite.cmake @@ -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. @@ -48,6 +48,7 @@ # MACRO(gmx_test_isfinite VARIABLE) + if(NOT DEFINED isfinite_compile_ok) MESSAGE(STATUS "Checking for isfinite") @@ -64,20 +65,23 @@ int main(void) { if(isfinite_compile_ok) MESSAGE(STATUS "Checking for isfinite - yes") - else(isfinite_compile_ok) + else() MESSAGE(STATUS "Checking for isfinite - no") - endif(isfinite_compile_ok) + endif() set(isfinite_compile_ok "${isfinite_compile_ok}" CACHE INTERNAL "Result of isfinite check") set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) - endif(NOT DEFINED isfinite_compile_ok) + endif() + if(isfinite_compile_ok) set(${VARIABLE} ${isfinite_compile_ok} "Result of test for isfinite") endif() + ENDMACRO(gmx_test_isfinite VARIABLE) MACRO(gmx_test__isfinite VARIABLE) + if(NOT DEFINED _isfinite_compile_ok) MESSAGE(STATUS "Checking for _isfinite") @@ -94,21 +98,24 @@ int main(void) { if(_isfinite_compile_ok) MESSAGE(STATUS "Checking for _isfinite - yes") - else(_isfinite_compile_ok) + else() MESSAGE(STATUS "Checking for _isfinite - no") - endif(_isfinite_compile_ok) + endif() set(_isfinite_compile_ok "${_isfinite_compile_ok}" CACHE INTERNAL "Result of _isfinite check") set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) - endif(NOT DEFINED _isfinite_compile_ok) + endif() + if(_isfinite_compile_ok) set(${VARIABLE} ${_isfinite_compile_ok} "Result of test for _isfinite") endif() + ENDMACRO(gmx_test__isfinite VARIABLE) # Necessary for MSVC MACRO(gmx_test__finite VARIABLE) + if(NOT DEFINED _finite_compile_ok) MESSAGE(STATUS "Checking for _finite") @@ -122,14 +129,16 @@ int main(void) { if(_finite_compile_ok) MESSAGE(STATUS "Checking for _finite - yes") - else(_finite_compile_ok) + else() MESSAGE(STATUS "Checking for _finite - no") - endif(_finite_compile_ok) + endif() set(_finite_compile_ok "${_finite_compile_ok}" CACHE INTERNAL "Result of _finite check") set(CMAKE_REQUIRED_INCLUDES) - endif(NOT DEFINED _finite_compile_ok) + endif() + if(_finite_compile_ok) set(${VARIABLE} ${_finite_compile_ok} "Result of test for _finite") endif() + ENDMACRO(gmx_test__finite VARIABLE) diff --git a/cmake/gmxTestLargeFiles.cmake b/cmake/gmxTestLargeFiles.cmake index 4570b4297e..6753022e28 100644 --- a/cmake/gmxTestLargeFiles.cmake +++ b/cmake/gmxTestLargeFiles.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009,2010,2012, by the GROMACS development team, led by +# Copyright (c) 2009,2010,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. @@ -61,7 +61,7 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) "${CMAKE_SOURCE_DIR}/cmake/TestFileOffsetBits.c") if(FILE64_OK) MESSAGE(STATUS "Checking for 64-bit off_t - present") - endif(FILE64_OK) + endif() if(NOT FILE64_OK) # Test with _FILE_OFFSET_BITS=64 @@ -71,8 +71,8 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) if(FILE64_OK) MESSAGE(STATUS "Checking for 64-bit off_t - present with _FILE_OFFSET_BITS=64") set(_FILE_OFFSET_BITS 64 CACHE INTERNAL "64-bit off_t requires _FILE_OFFSET_BITS=64") - endif(FILE64_OK) - endif(NOT FILE64_OK) + endif() + endif() if(NOT FILE64_OK) # Test with _LARGE_FILES @@ -82,8 +82,8 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) if(FILE64_OK) MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGE_FILES") set(_LARGE_FILES 1 CACHE INTERNAL "64-bit off_t requires _LARGE_FILES") - endif(FILE64_OK) - endif(NOT FILE64_OK) + endif() + endif() if(NOT FILE64_OK) # Test with _LARGEFILE_SOURCE @@ -93,12 +93,12 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) if(FILE64_OK) MESSAGE(STATUS "Checking for 64-bit off_t - present with _LARGEFILE_SOURCE") set(_LARGEFILE_SOURCE 1 CACHE INTERNAL "64-bit off_t requires _LARGEFILE_SOURCE") - endif(FILE64_OK) - endif(NOT FILE64_OK) + endif() + endif() if(NOT FILE64_OK) MESSAGE(STATUS "Checking for 64-bit off_t - not present") - else(NOT FILE64_OK) + else() # 64-bit off_t found. Now check that ftello/fseeko is available. # Set the flags we might have determined to be required above @@ -111,7 +111,7 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/TestLargeFiles.c") if(FSEEKO_COMPILE_OK) MESSAGE(STATUS "Checking for fseeko/ftello - present") - endif(FSEEKO_COMPILE_OK) + endif() if(NOT FSEEKO_COMPILE_OK) # glibc 2.2 neds _LARGEFILE_SOURCE for fseeko (but not 64-bit off_t...) @@ -121,12 +121,12 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) if(FSEEKO_COMPILE_OK) MESSAGE(STATUS "Checking for fseeko/ftello - present with _LARGEFILE_SOURCE") set(_LARGEFILE_SOURCE 1 CACHE INTERNAL "64-bit fseeko requires _LARGEFILE_SOURCE") - else(FSEEKO_COMPILE_OK) + else() set(FILE64_OK 0) message(STATUS "64-bit off_t present but fseeko/ftello not found!") - endif(FSEEKO_COMPILE_OK) - endif(NOT FSEEKO_COMPILE_OK) - endif(NOT FILE64_OK) + endif() + endif() + endif() if(NOT FILE64_OK) # now check for Windows stuff @@ -135,8 +135,8 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) if(FILE64_OK) MESSAGE(STATUS "Checking for 64-bit off_t - present with _fseeki64") set(HAVE__FSEEKI64 1 CACHE INTERNAL "64-bit off_t requires _fseeki64") - endif(FILE64_OK) - endif(NOT FILE64_OK) + endif() + endif() if(FSEEKO_COMPILE_OK) SET(${VARIABLE} 1 CACHE INTERNAL "Result of test for large file support" FORCE) @@ -154,7 +154,7 @@ MACRO(GMX_TEST_LARGE_FILES VARIABLE) endif() endif() - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() ENDMACRO(GMX_TEST_LARGE_FILES VARIABLE) diff --git a/cmake/gmxTestMPI_IN_PLACE.cmake b/cmake/gmxTestMPI_IN_PLACE.cmake index f1f115274a..3ed73251a9 100644 --- a/cmake/gmxTestMPI_IN_PLACE.cmake +++ b/cmake/gmxTestMPI_IN_PLACE.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009,2011,2012, by the GROMACS development team, led by +# Copyright (c) 2009,2011,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. @@ -56,16 +56,16 @@ int main(void) { if(MPI_IN_PLACE_COMPILE_OK) MESSAGE(STATUS "Checking for MPI_IN_PLACE - yes") - else(MPI_IN_PLACE_COMPILE_OK) + else() MESSAGE(STATUS "Checking for MPI_IN_PLACE - no") - endif(MPI_IN_PLACE_COMPILE_OK) + endif() set(MPI_IN_PLACE_COMPILE_OK "${MPI_IN_PLACE_COMPILE_OK}" CACHE INTERNAL "Result of mpi_in_place check") set(CMAKE_REQUIRED_DEFINITIONS) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) endif() if (MPI_IN_PLACE_COMPILE_OK) - set(${VARIABLE} ${MPI_IN_PLACE_COMPILE_OK} + set(${VARIABLE} ${MPI_IN_PLACE_COMPILE_OK} "Result of test for MPI_IN_PLACE") endif() ENDMACRO(GMX_TEST_MPI_IN_PLACE VARIABLE) diff --git a/cmake/gmxTestPipes.cmake b/cmake/gmxTestPipes.cmake index 55461b4f7f..5ac14cda52 100644 --- a/cmake/gmxTestPipes.cmake +++ b/cmake/gmxTestPipes.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009, by the GROMACS development team, led by +# Copyright (c) 2009,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. @@ -42,15 +42,12 @@ MACRO(GMX_TEST_PIPES VARIABLE) IF(NOT DEFINED ${VARIABLE}) - + MESSAGE(STATUS "Checking for pipe support") - TRY_COMPILE(HAVE_PIPES "${CMAKE_BINARY_DIR}" + TRY_COMPILE(HAVE_PIPES "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestPipes.c") - ENDIF(NOT DEFINED ${VARIABLE}) + ENDIF() ENDMACRO(GMX_TEST_PIPES VARIABLE) - - - diff --git a/cmake/gmxTestRestrict.cmake b/cmake/gmxTestRestrict.cmake index f496ec97c7..391e8e4882 100644 --- a/cmake/gmxTestRestrict.cmake +++ b/cmake/gmxTestRestrict.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2010,2012, by the GROMACS development team, led by +# Copyright (c) 2010,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. @@ -48,24 +48,20 @@ MACRO(GMX_TEST_RESTRICT VARIABLE) # Start with __restrict__, since that is the C++ default keyword. FOREACH(KEYWORD "__restrict__" "__restrict" "restrict") IF(NOT TEST_${VARIABLE}) - TRY_COMPILE(TEST_${VARIABLE} "${CMAKE_BINARY_DIR}" + TRY_COMPILE(TEST_${VARIABLE} "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestRestrict.c" COMPILE_DEFINITIONS "-DTESTRESTRICTDEF=${KEYWORD}" ) SET(LAST_RESTRICT_KEYWORD ${KEYWORD}) - ENDIF(NOT TEST_${VARIABLE}) + ENDIF() ENDFOREACH(KEYWORD) IF(TEST_${VARIABLE}) SET(${VARIABLE} ${LAST_RESTRICT_KEYWORD} CACHE INTERNAL "Restrict keyword" FORCE) MESSAGE(STATUS "Checking for restrict keyword - ${LAST_RESTRICT_KEYWORD}") - ELSE(TEST_${VARIABLE}) + ELSE() SET(${VARIABLE} " " CACHE INTERNAL "Restrict keyword" FORCE) MESSAGE(STATUS "Checking for restrict keyword - not found") - ENDIF(TEST_${VARIABLE}) + ENDIF() - ENDIF(NOT DEFINED TEST_${VARIABLE}) + ENDIF() ENDMACRO(GMX_TEST_RESTRICT VARIABLE) - - - - diff --git a/cmake/gmxTestSignal.cmake b/cmake/gmxTestSignal.cmake index b37c6dc458..5756729234 100644 --- a/cmake/gmxTestSignal.cmake +++ b/cmake/gmxTestSignal.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009,2011, by the GROMACS development team, led by +# Copyright (c) 2009,2011,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. @@ -41,21 +41,19 @@ MACRO(GMX_TEST_SIGUSR1 VARIABLE) IF(NOT DEFINED HAVE_${VARIABLE}) - + MESSAGE(STATUS "Checking for SIGUSR1") - TRY_COMPILE(HAVE_${VARIABLE} "${CMAKE_BINARY_DIR}" + TRY_COMPILE(HAVE_${VARIABLE} "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestSIGUSR1.c") - IF(HAVE_${VARIABLE}) + IF(HAVE_${VARIABLE}) MESSAGE(STATUS "Checking for SIGUSR1 - found") set(${VARIABLE} 1 CACHE INTERNAL "Result of test for SIGUSR1" FORCE) - ELSE(HAVE_${VARIABLE}) + ELSE() MESSAGE(STATUS "Checking for SIGUSR1 - not found") set(${VARIABLE} 0 CACHE INTERNAL "Result of test for SIGUSR1" FORCE) - ENDIF(HAVE_${VARIABLE}) - - ENDIF(NOT DEFINED HAVE_${VARIABLE}) -ENDMACRO(GMX_TEST_SIGUSR1 VARIABLE) - + ENDIF() + ENDIF() +ENDMACRO(GMX_TEST_SIGUSR1 VARIABLE) diff --git a/cmake/gmxTestXDR.cmake b/cmake/gmxTestXDR.cmake index 68d292588f..d06385294d 100644 --- a/cmake/gmxTestXDR.cmake +++ b/cmake/gmxTestXDR.cmake @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2009, by the GROMACS development team, led by +# Copyright (c) 2009,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. @@ -46,18 +46,18 @@ MACRO(GMX_TEST_XDR VARIABLE) MESSAGE(STATUS "Checking for system XDR support") # First check without any special flags - TRY_COMPILE(XDR_COMPILE_OK "${CMAKE_BINARY_DIR}" + TRY_COMPILE(XDR_COMPILE_OK "${CMAKE_BINARY_DIR}" "${CMAKE_SOURCE_DIR}/cmake/TestXDR.c") if(XDR_COMPILE_OK) - MESSAGE(STATUS "Checking for system XDR support - present") - else(XDR_COMPILE_OK) + MESSAGE(STATUS "Checking for system XDR support - present") + else() MESSAGE(STATUS "Checking for system XDR support - not present") - endif(XDR_COMPILE_OK) + endif() set(${VARIABLE} ${XDR_COMPILE_OK} CACHE INTERNAL "Result of test for system XDR support" FORCE) - - ENDIF(NOT DEFINED ${VARIABLE}) + + ENDIF() ENDMACRO(GMX_TEST_XDR VARIABLE) diff --git a/doxygen/CMakeLists.txt b/doxygen/CMakeLists.txt index cfa72f7410..632f64bbb6 100644 --- a/doxygen/CMakeLists.txt +++ b/doxygen/CMakeLists.txt @@ -44,9 +44,9 @@ if (DOXYGEN_FOUND) if (DOXYGEN_MSCGEN_EXECUTABLE) set(DOXYGEN_MSCGEN_FOUND TRUE) get_filename_component(DOXYGEN_MSCGEN_PATH "${DOXYGEN_MSCGEN_EXECUTABLE}" PATH) - endif (DOXYGEN_MSCGEN_EXECUTABLE) + endif() mark_as_advanced(DOXYGEN_MSCGEN_EXECUTABLE) -endif (DOXYGEN_FOUND) +endif() gmx_dependent_option( GMX_COMPACT_DOXYGEN @@ -115,7 +115,7 @@ if (DOXYGEN_FOUND) set(GMX_PROJECT_VERSION_STR ${PROJECT_VERSION}) configure_file(Doxyfile-version.cmakein Doxyfile-version) endif() -endif (DOXYGEN_FOUND) +endif() find_package(PythonInterp) @@ -158,4 +158,4 @@ if (PYTHONINTERP_FOUND AND NOT PYTHON_VERSION_STRING VERSION_LESS "2.6") -DMODE=CHECKDOC -P ${CMAKE_SOURCE_DIR}/admin/includedeps.cmake COMMENT "Checking some aspects of Doxygen documentation" VERBATIM) -endif () +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index caa02b92b5..8c0db4ed84 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -40,7 +40,7 @@ get_compiler_info(C BUILD_C_COMPILER BUILD_CFLAGS) get_compiler_info(CXX BUILD_CXX_COMPILER BUILD_CXXFLAGS) if(GMX_GPU) get_cuda_compiler_info(CUDA_NVCC_COMPILER_INFO CUDA_NVCC_COMPILER_FLAGS) -endif(GMX_GPU) +endif() configure_file(config.h.cmakein config.h) configure_file(buildinfo.h.cmakein buildinfo.h ESCAPE_QUOTES) diff --git a/src/external/gmock-1.7.0/CMakeLists.txt b/src/external/gmock-1.7.0/CMakeLists.txt index c3a985e2f3..99b6f7da69 100644 --- a/src/external/gmock-1.7.0/CMakeLists.txt +++ b/src/external/gmock-1.7.0/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2011,2012,2013, by the GROMACS development team, led by +# Copyright (c) 2011,2012,2013,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. @@ -41,7 +41,7 @@ find_package(Threads) set(PTHREADS_LIBRARIES) if (CMAKE_USE_PTHREADS_INIT) set(PTHREADS_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) -endif () +endif() set(GMOCK_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(GTEST_DIR ${GMOCK_DIR}/gtest) diff --git a/src/gromacs/CMakeLists.txt b/src/gromacs/CMakeLists.txt index 24ab5bb761..d72b95a26f 100644 --- a/src/gromacs/CMakeLists.txt +++ b/src/gromacs/CMakeLists.txt @@ -70,7 +70,7 @@ if (NOT GMX_BUILD_MDRUN_ONLY) add_subdirectory(selection) add_subdirectory(trajectoryanalysis) add_subdirectory(tools) -endif () +endif() list(APPEND LIBGROMACS_SOURCES ${GMXLIB_SOURCES} ${MDLIB_SOURCES}) @@ -112,7 +112,7 @@ endif() add_library(libgromacs ${LIBGROMACS_SOURCES}) if (GMX_GIT_VERSION_INFO) add_dependencies(libgromacs gmx-version) -endif () +endif() # Recent versions of gcc and clang give warnings on scanner.cpp, which # is a generated source file. These are awkward to suppress inline, so @@ -177,4 +177,4 @@ if (INSTALL_CUDART_LIB) #can be set manual by user else() message(WARNING "INSTALL_CUDART_LIB only makes sense with GMX_GPU") endif() -endif () +endif() diff --git a/src/gromacs/analysisdata/CMakeLists.txt b/src/gromacs/analysisdata/CMakeLists.txt index b2d0e2f9ea..dabcba9a84 100644 --- a/src/gromacs/analysisdata/CMakeLists.txt +++ b/src/gromacs/analysisdata/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2010,2011,2012,2013, by the GROMACS development team, led by +# Copyright (c) 2010,2011,2012,2013,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. @@ -47,4 +47,4 @@ add_subdirectory(modules) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/commandline/tests/CMakeLists.txt b/src/gromacs/commandline/tests/CMakeLists.txt index eef49c5760..62e09d9c01 100644 --- a/src/gromacs/commandline/tests/CMakeLists.txt +++ b/src/gromacs/commandline/tests/CMakeLists.txt @@ -35,7 +35,7 @@ set(EXECUTABLE_EXTENSION "") if (GMX_NATIVE_WINDOWS OR GMX_CYGWIN) set(EXECUTABLE_EXTENSION ".exe") -endif () +endif() set(PATH_SEARCH_TEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/test-bin) file(MAKE_DIRECTORY ${PATH_SEARCH_TEST_DIR}/bin) file(WRITE ${PATH_SEARCH_TEST_DIR}/bin/test-exe${EXECUTABLE_EXTENSION} @@ -49,7 +49,7 @@ if (UNIX) COMMAND ${CMAKE_COMMAND} -E create_symlink ${PATH_SEARCH_TEST_DIR}/bin/test-exe ${PATH_SEARCH_TEST_DIR}/bin/test-abs-link) -endif () +endif() gmx_add_unit_test(CommandLineUnitTests commandline-test cmdlinehelpwriter.cpp diff --git a/src/gromacs/essentialdynamics/CMakeLists.txt b/src/gromacs/essentialdynamics/CMakeLists.txt index 3e8b453f94..0b5ec4bc26 100644 --- a/src/gromacs/essentialdynamics/CMakeLists.txt +++ b/src/gromacs/essentialdynamics/CMakeLists.txt @@ -37,4 +37,4 @@ set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${ESSENTIALDYNAMICS_SOURCES} PARENT if (BUILD_TESTING) # add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/fft/CMakeLists.txt b/src/gromacs/fft/CMakeLists.txt index efa779df40..cb5a51f736 100644 --- a/src/gromacs/fft/CMakeLists.txt +++ b/src/gromacs/fft/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013, by the GROMACS development team, led by +# Copyright (c) 2013,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. @@ -57,4 +57,4 @@ gmx_install_headers(fft ${FFT_PUBLIC_HEADERS}) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/fileio/CMakeLists.txt b/src/gromacs/fileio/CMakeLists.txt index 56cbbef52c..18078dee81 100644 --- a/src/gromacs/fileio/CMakeLists.txt +++ b/src/gromacs/fileio/CMakeLists.txt @@ -72,4 +72,4 @@ endif() if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/gmxana/CMakeLists.txt b/src/gromacs/gmxana/CMakeLists.txt index 45206c3e2e..7c3b7da4a0 100644 --- a/src/gromacs/gmxana/CMakeLists.txt +++ b/src/gromacs/gmxana/CMakeLists.txt @@ -43,4 +43,4 @@ set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXANA_SOURCES} PARENT_SCOPE) if(BUILD_TESTING) add_subdirectory(legacytests) -endif(BUILD_TESTING) +endif() diff --git a/src/gromacs/gmxlib/CMakeLists.txt b/src/gromacs/gmxlib/CMakeLists.txt index ff5a9f4760..ca1b51e731 100644 --- a/src/gromacs/gmxlib/CMakeLists.txt +++ b/src/gromacs/gmxlib/CMakeLists.txt @@ -44,13 +44,13 @@ file(GLOB GMXLIB_SOURCES *.c *.cpp) # to link the functions directly #if(GMX_THREAD_MPI) # add_subdirectory(thread_mpi) -#endif(GMX_THREAD_MPI) +#endif() #target_link_libraries(gmx ${GMX_EXTRA_LIBRARIES} ${THREAD_MPI_LIB}) # Files called xxx_test.c are test drivers with a main() function for module xxx.c, # so they should not be included in the library file(GLOB_RECURSE NOT_GMXLIB_SOURCES *_test.c *\#*) -list(REMOVE_ITEM GMXLIB_SOURCES ${NOT_GMXLIB_SOURCES}) +list(REMOVE_ITEM GMXLIB_SOURCES ${NOT_GMXLIB_SOURCES}) # gpu utils + cuda tools module if(GMX_GPU) diff --git a/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt b/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt index 6aa852f00e..62f082e779 100644 --- a/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt +++ b/src/gromacs/gmxlib/thread_mpi/CMakeLists.txt @@ -18,8 +18,8 @@ if (THREAD_PTHREADS) else (THREAD_PTHREADS) if (THREAD_WINDOWS) set(THREAD_MPI_LIB_SOURCE winthreads.c ${THREAD_MPI_LIB_SOURCE}) - endif (THREAD_WINDOWS) -endif(THREAD_PTHREADS) + endif() +endif() add_library(thread_mpi STATIC ${THREAD_MPI_LIB_SOURCE}) @@ -28,11 +28,11 @@ add_library(thread_mpi STATIC ${THREAD_MPI_LIB_SOURCE}) target_link_libraries(thread_mpi ${THREAD_LIB}) if (TMPI_CXX_LIB) - set(THREAD_MPI_CXX_LIB_SOURCE + set(THREAD_MPI_CXX_LIB_SOURCE system_error.cpp ) add_library(thread_mpi_cxx STATIC ${THREAD_MPI_CXX_LIB_SOURCE}) target_link_libraries(thread_mpi_cxx thread_mpi) -endif (TMPI_CXX_LIB) +endif() #configure_file(tmpi_config.h.cmakein tmpi_config.h) #add_definitions(-DHAVE_TMPI_CONFIG_H) diff --git a/src/gromacs/gmxpreprocess/CMakeLists.txt b/src/gromacs/gmxpreprocess/CMakeLists.txt index dc51659f4d..63a81b53fc 100644 --- a/src/gromacs/gmxpreprocess/CMakeLists.txt +++ b/src/gromacs/gmxpreprocess/CMakeLists.txt @@ -38,4 +38,4 @@ set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${GMXPREPROCESS_SOURCES} PARENT_SCO if(BUILD_TESTING) add_subdirectory(tests) -endif(BUILD_TESTING) +endif() diff --git a/src/gromacs/math/CMakeLists.txt b/src/gromacs/math/CMakeLists.txt index d81cacf64b..06d2f09f10 100644 --- a/src/gromacs/math/CMakeLists.txt +++ b/src/gromacs/math/CMakeLists.txt @@ -44,4 +44,4 @@ gmx_install_headers(maths ${MATH_PUBLIC_HEADERS}) if (BUILD_TESTING) # add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/onlinehelp/CMakeLists.txt b/src/gromacs/onlinehelp/CMakeLists.txt index 0e8248ad84..a6448783a8 100644 --- a/src/gromacs/onlinehelp/CMakeLists.txt +++ b/src/gromacs/onlinehelp/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2012,2013, by the GROMACS development team, led by +# Copyright (c) 2012,2013,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. @@ -41,4 +41,4 @@ gmx_install_headers(onlinehelp ${ONLINEHELP_PUBLIC_HEADERS}) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/options/CMakeLists.txt b/src/gromacs/options/CMakeLists.txt index a34d845e75..cfb6a36b5b 100644 --- a/src/gromacs/options/CMakeLists.txt +++ b/src/gromacs/options/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2010,2012,2013, by the GROMACS development team, led by +# Copyright (c) 2010,2012,2013,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. @@ -47,4 +47,4 @@ gmx_install_headers(options ${OPTIONS_PUBLIC_HEADERS}) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/pulling/CMakeLists.txt b/src/gromacs/pulling/CMakeLists.txt index 1938731e02..9c9f21883d 100644 --- a/src/gromacs/pulling/CMakeLists.txt +++ b/src/gromacs/pulling/CMakeLists.txt @@ -37,4 +37,4 @@ set(LIBGROMACS_SOURCES ${LIBGROMACS_SOURCES} ${PULLING_SOURCES} PARENT_SCOPE) if (BUILD_TESTING) # add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/selection/CMakeLists.txt b/src/gromacs/selection/CMakeLists.txt index 9ed59ec147..4788a17578 100644 --- a/src/gromacs/selection/CMakeLists.txt +++ b/src/gromacs/selection/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2010,2012,2013, by the GROMACS development team, led by +# Copyright (c) 2010,2012,2013,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. @@ -48,4 +48,4 @@ gmx_install_headers(selection ${SELECTION_PUBLIC_HEADERS}) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/simd/CMakeLists.txt b/src/gromacs/simd/CMakeLists.txt index 7c532ca9a8..34e800a6bc 100644 --- a/src/gromacs/simd/CMakeLists.txt +++ b/src/gromacs/simd/CMakeLists.txt @@ -34,4 +34,4 @@ if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/timing/CMakeLists.txt b/src/gromacs/timing/CMakeLists.txt index 34e002a9ab..e73a1115a9 100644 --- a/src/gromacs/timing/CMakeLists.txt +++ b/src/gromacs/timing/CMakeLists.txt @@ -1,7 +1,7 @@ # # This file is part of the GROMACS molecular simulation package. # -# Copyright (c) 2013, by the GROMACS development team, led by +# Copyright (c) 2013,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. @@ -41,4 +41,4 @@ gmx_install_headers(timing ${TIMING_PUBLIC_HEADERS}) if (BUILD_TESTING) # add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/tools/CMakeLists.txt b/src/gromacs/tools/CMakeLists.txt index 80ee76b6e7..ac60f30f0f 100644 --- a/src/gromacs/tools/CMakeLists.txt +++ b/src/gromacs/tools/CMakeLists.txt @@ -41,4 +41,4 @@ gmx_install_headers(tools ${TOOLS_PUBLIC_HEADERS}) if (BUILD_TESTING) # add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/trajectoryanalysis/CMakeLists.txt b/src/gromacs/trajectoryanalysis/CMakeLists.txt index 0bbbe0fb93..a27ab151e1 100644 --- a/src/gromacs/trajectoryanalysis/CMakeLists.txt +++ b/src/gromacs/trajectoryanalysis/CMakeLists.txt @@ -43,4 +43,4 @@ gmx_install_headers(trajectoryanalysis ${TRAJECTORYANALYSIS_PUBLIC_HEADERS}) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/gromacs/utility/CMakeLists.txt b/src/gromacs/utility/CMakeLists.txt index f7750d5ec1..4432ea6aef 100644 --- a/src/gromacs/utility/CMakeLists.txt +++ b/src/gromacs/utility/CMakeLists.txt @@ -58,4 +58,4 @@ gmx_install_headers(utility ${GENERATED_HEADER_CONFIG}) if (BUILD_TESTING) add_subdirectory(tests) -endif (BUILD_TESTING) +endif() diff --git a/src/programs/CMakeLists.txt b/src/programs/CMakeLists.txt index 783db71209..91e97d372e 100644 --- a/src/programs/CMakeLists.txt +++ b/src/programs/CMakeLists.txt @@ -118,9 +118,9 @@ else() configure_file(CreateLinks.cmake.cmakein CreateLinks.cmake @ONLY) set(CREATE_LINKS_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/CreateLinks.cmake) install(SCRIPT ${CREATE_LINKS_SCRIPT} COMPONENT links) - endif () + endif() if(BUILD_TESTING) add_subdirectory(mdrun/tests) - endif(BUILD_TESTING) + endif() endif() diff --git a/src/testutils/TestMacros.cmake b/src/testutils/TestMacros.cmake index 17934162cd..daf252cb28 100644 --- a/src/testutils/TestMacros.cmake +++ b/src/testutils/TestMacros.cmake @@ -36,7 +36,7 @@ function (gmx_add_unit_test_object_library NAME) if (GMX_BUILD_UNITTESTS AND BUILD_TESTING) include_directories(${GMOCK_INCLUDE_DIRS}) add_library(${NAME} OBJECT ${ARGN}) - endif () + endif() endfunction () function (gmx_build_unit_test NAME EXENAME) @@ -53,7 +53,7 @@ function (gmx_build_unit_test NAME EXENAME) set(EXTRA_COMPILE_DEFINITIONS TEST_DATA_PATH="${CMAKE_CURRENT_SOURCE_DIR}" TEST_TEMP_PATH="${_temporary_files_path}") set_property(TARGET ${EXENAME} APPEND PROPERTY COMPILE_DEFINITIONS "${EXTRA_COMPILE_DEFINITIONS}") - endif () + endif() endfunction () function (gmx_register_unit_test NAME EXENAME) @@ -62,7 +62,7 @@ function (gmx_register_unit_test NAME EXENAME) COMMAND ${EXENAME} --gtest_output=xml:${CMAKE_BINARY_DIR}/Testing/Temporary/${NAME}.xml) set_tests_properties(${NAME} PROPERTIES LABELS "GTest;UnitTest") add_dependencies(tests ${EXENAME}) - endif () + endif() endfunction () function (gmx_register_integration_test NAME EXENAME) @@ -76,7 +76,7 @@ function (gmx_register_integration_test NAME EXENAME) # GMX_EXTRA_LIBRARIES might be needed for mdrun integration tests at # some point. # target_link_libraries(${EXENAME} ${GMX_EXTRA_LIBRARIES}) - endif () + endif() endfunction () function (gmx_add_unit_test NAME EXENAME) -- 2.22.0