diff --git a/.travis.yml b/.dont_use_travis.yml similarity index 100% rename from .travis.yml rename to .dont_use_travis.yml diff --git a/.gitignore b/.gitignore index 5c06d727e0..2b00f0f045 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,16 @@ -build/ -*.swp +# Emacs backup garbage +.backup/ + +# Other standard ignores +*~ *.pyc +\#*# +.#* +.*.swp +.DS_Store +*.bak + +# building/install not-entirely-out-of-source stuff +build*/ +install*/ + diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d66ef96d0..219abe707f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,794 +1,750 @@ +cmake_minimum_required(VERSION 3.21) +cmake_policy(VERSION 3.21) + +project(Hydrogen CXX) + +# Setup version information +find_program(__GIT_EXECUTABLE git) +mark_as_advanced(__GIT_EXECUTABLE) +if (__GIT_EXECUTABLE) + + execute_process( + COMMAND ${__GIT_EXECUTABLE} rev-parse --is-inside-work-tree + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE __BUILDING_FROM_GIT_SOURCES + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if (__BUILDING_FROM_GIT_SOURCES) + execute_process( + COMMAND ${__GIT_EXECUTABLE} rev-parse --show-toplevel + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE __GIT_TOPLEVEL_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${__GIT_EXECUTABLE} rev-parse --git-dir + WORKING_DIRECTORY "${__GIT_TOPLEVEL_DIR}" + OUTPUT_VARIABLE __GIT_GIT_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${__GIT_EXECUTABLE} --git-dir "${__GIT_GIT_DIR}" describe + --abbrev=7 --always --dirty --tags + WORKING_DIRECTORY "${__GIT_TOPLEVEL_DIR}" + OUTPUT_VARIABLE __GIT_DESCRIBE_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${__GIT_EXECUTABLE} rev-list HEAD --max-count=1 --date-order + WORKING_DIRECTORY "${__GIT_TOPLEVEL_DIR}" + OUTPUT_VARIABLE __GIT_LATEST_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${__GIT_EXECUTABLE} rev-list hydrogen --max-count=1 --date-order + WORKING_DIRECTORY "${__GIT_TOPLEVEL_DIR}" + OUTPUT_VARIABLE __GIT_LATEST_HYDROGEN_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE) + + set(HYDROGEN_GIT_VERSION "${__GIT_DESCRIBE_VERSION}") + set(HYDROGEN_LATEST_SHA "${__GIT_LATEST_COMMIT}") + set(HYDROGEN_LATEST_HYDROGEN_SHA "${__GIT_LATEST_HYDROGEN_COMMIT}") + endif (__BUILDING_FROM_GIT_SOURCES) +endif (__GIT_EXECUTABLE) + +# This must be set because version tags +set(HYDROGEN_VERSION_MAJOR 1) +set(HYDROGEN_VERSION_MINOR 5) +set(HYDROGEN_VERSION_PATCH 2) +set(HYDROGEN_VERSION_MAJOR_MINOR + "${HYDROGEN_VERSION_MAJOR}.${HYDROGEN_VERSION_MINOR}") +set(HYDROGEN_VERSION + "${HYDROGEN_VERSION_MAJOR_MINOR}.${HYDROGEN_VERSION_PATCH}") + +# Back-compatibility, until it's all sorted out +set(EL_VERSION_MAJOR ${HYDROGEN_VERSION_MAJOR}) +set(EL_VERSION_MINOR ${HYDROGEN_VERSION_MINOR}) +set(EL_VERSION_PATCH ${HYDROGEN_VERSION_PATCH}) + +string(TOUPPER "${PROJECT_NAME}" UPPER_PROJECT_NAME) + +if (NOT CMAKE_BUILD_TYPE MATCHES "Debug") + set(HYDROGEN_RELEASE_BUILD TRUE) +endif () + +# Prevent in-source builds +if (PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) + message(FATAL_ERROR + "In-source build attempted; please clean the CMake cache and then " + "switch to an out-of-source build, e.g.,\n" + "rm CMakeCache.txt && rm -Rf CMakeFiles/\nmkdir build/ && " + "cd build/ && cmake ..\n") +endif () + +# Set the module path +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules") + +# Add warning flags +include(CheckCompilerFlag) +set(__CXX_FLAGS "-Wno-unused-parameter") +set(__CXX_DEVELOPER_FLAGS "-Wall" "-Wextra" "-Wpedantic" "-pedantic") +set(__CUDA_FLAGS) +set(__CUDA_DEVELOPER_FLAGS) + +# Handle some CMake basics. # -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# Copyright 2012, Jed Brown -# All rights reserved. -# -# Copyright 2015, Jake Bolewski and Jiahao Chen -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause +# These are highlighted because they default to OFF, but we prefer +# that they default to ON. +if (NOT DEFINED CMAKE_EXPORT_NO_PACKAGE_REGISTRY) + set(CMAKE_EXPORT_NO_PACKAGE_REGISTRY ON) +endif () + +if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) +endif () + +# Feature-related options + +option(Hydrogen_ENABLE_ALUMINUM + "Enable the Aluminum package for improved device-side communication." + OFF) + +option(Hydrogen_ENABLE_CUDA + "Search for CUDA support and enable related features if found." + OFF) + +option(Hydrogen_ENABLE_ROCM + "Search for ROCm/HIP support and enable related features if found." + OFF) + +if (Hydrogen_ENABLE_ROCM AND Hydrogen_ENABLE_CUDA) + message(FATAL_ERROR + "ROCm and CUDA code paths are mutually exclusive. " + "Please enable the one that corresponds to your hardware. " + "If you have mixed hardware, please contact the Hydrogen developers " + "as this would be of great interest.") +endif () + +if (Hydrogen_ENABLE_CUDA OR Hydrogen_ENABLE_ROCM) + option(Hydrogen_ENABLE_CUB + "Search for CUB support and enable related features if found." + ON) + + option(Hydrogen_ENABLE_GPU_TENSOR_MATH + "Use the GPU tensor operations when available." + OFF) + + option(Hydrogen_ENABLE_GPU_FP16 + "Enable FP16 arithmetic in GPU code." + ON) +endif () + +option(Hydrogen_ENABLE_QUADMATH + "Search for quadmath library and enable related features if found." OFF) + +option(Hydrogen_ENABLE_QD + "Search for QD library and enable related features if found." OFF) + +option(Hydrogen_ENABLE_MPC + "Search for MPC(+MPFR+GMP) library and enable related features if found." + OFF) + # -if(APPLE) - # RPATH support for OS X was introduced in this version - cmake_minimum_required(VERSION 2.8.12) -else() - # It is likely/possible that this version could be decreased, but this version - # was chosen to support the default version of CMake in CentOS 7 - cmake_minimum_required(VERSION 2.8.11) -endif() - -project(Elemental C CXX) -set(EL_VERSION_MAJOR 0) -set(EL_VERSION_MINOR 88-dev) - -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") - -# Configuration options -# ===================== - -# Basic options -# ------------- - -# "CMAKE_BUILD_TYPE" -# Elemental requires it to be one of the following two choices: -# 1. Debug: Meant for development and debugging -# 2. Release: Meant for production runs -# If either MinSizeRel or RelWithDebInfo are specified, then Elemental falls -# back to Release mode. +# MEMORY-RELATED OPTIONS # -# If "CMAKE_BUILD_TYPE" is not defined, the default is Release mode. - -# "CXX_FLAGS" -# Optimization and debugging/symbol flags - -# "OpenMP_CXX_FLAGS" -# Overrides the default compile flags for adding OpenMP support to CXX code - -# TODO(poulson): Add list of MPI variables here, such as -# "MPI_CXX_COMPILE_FLAGS" - -# TODO(poulson): Add discussion of "MATH_LIBS" and "REFERENCE_ROOT" - -get_property(SUPPORTS_SHARED GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS) -if(SUPPORTS_SHARED) - option(BUILD_SHARED_LIBS "Build shared libraries?" ON) -else() - option(BUILD_SHARED_LIBS "Build shared libraries?" OFF) -endif() -if(BUILD_SHARED_LIBS AND NOT SUPPORTS_SHARED) - message("Elemental was configured to build shared libraries, but they are not supported on the target platform: BUILD_SHARED_LIBS will be manually set to OFF") - set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries?") -endif() - -# Useful to turn off for shipping in OS packages -option(BINARY_SUBDIRECTORIES "Install binaries into tree based on type" ON) - -include(GNUInstallDirs) -if(NOT CMAKE_INSTALL_INCLUDEDIR) - set(CMAKE_INSTALL_INCLUDEDIR "include") -endif() -if(CMAKE_INSTALL_LIBDIR) - if(IS_ABSOLUTE CMAKE_INSTALL_LIBDIR) - message(FATAL_ERROR "CMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR} was an absolute path but Elemental requires it to be relative to CMAKE_INSTALL_PREFIX") - endif() -else() - set(CMAKE_INSTALL_LIBDIR "lib") -endif() -if(NOT CMAKE_INSTALL_BINDIR) - set(CMAKE_INSTALL_BINDIR "bin/elemental") -endif() -if(NOT CMAKE_INSTALL_DATADIR) - set(CMAKE_INSTALL_DATADIR "share") -endif() -if(NOT CMAKE_INSTALL_DOCDIR) - set(CMAKE_INSTALL_DOCDIR "share/doc/elemental") -endif() -if(NOT CMAKE_INSTALL_SYSCONFDIR) - set(CMAKE_INSTALL_SYSCONFDIR "etc") -endif() -if(NOT INSTALL_CMAKE_DIR) - set( INSTALL_CMAKE_DIR "CMake") -endif() -# Whether or not to attempt to use OpenMP within hot-spots in Elemental -# (NOTE: This option is not actively maintained) -option(EL_HYBRID "Make use of OpenMP within MPI packing/unpacking" OFF) - -option(EL_C_INTERFACE "Build C interface" ON) - -if(BUILD_SHARED_LIBS AND EL_C_INTERFACE) - # Define PYTHON_SITE_PACKAGES if you want to install the python package - # somewhere other than the default system-wide location (e.g., within your - # home directory). Alternatively, if you do NOT define PYTHON_SITE_PACKAGES - # and instead define INSTALL_PYTHON_INTO_USER_SITE=ON, Elemental will - # install its Python interface into site.USER_SITE in your home directory. - option(INSTALL_PYTHON_PACKAGE "Install Python interface? (requires Python 2.x)" OFF) - - set(Python_ADDITIONAL_VERSIONS 2.7) - include(FindPythonInterp) #Check for Python version - - #Only Python 2.x supported - if (NOT PYTHON_VERSION_MAJOR EQUAL 2) - set(INSTALL_PYTHON_PACKAGE FALSE) - endif() -endif() - -# Whether or not to use Qt5 for visualization if it is found. -# Setting Qt5Widgets_DIR, Qt5_DIR, or Qt5_LIBDIR overrides this variable -# and is often necessary anyway. -option(EL_USE_QT5 "Attempt to use Qt5?" OFF) - -option(EL_EXAMPLES "Build simple examples?" OFF) -option(EL_TESTS "Build performance and correctness tests?" OFF) -option(EL_EXPERIMENTAL "Build experimental code" OFF) - -# Attempt to use 64-bit integers? -option(EL_USE_64BIT_INTS "Use 64-bit integers for El indexing" OFF) -option(EL_USE_64BIT_BLAS_INTS "Use 64-bit integers for BLAS/LAPACK" OFF) -if(EL_USE_64BIT_BLAS_INTS) + +option(Hydrogen_ENABLE_HALF + "Enable the use of \"half\" library." OFF) +# This refers to the half.sourceforge.net type "half" + +option(Hydrogen_ENABLE_BFLOAT16 + "Enable the use of Intel's bfloat16 type." OFF) +if (Hydrogen_ENABLE_BFLOAT16) + message(WARNING + "At time of writing, we are unaware of any implementation " + "of the \"bfloat16\". This is a placeholder option. If our " + "information is out of date, please open an issue and point " + "us to an implementation.") +endif () + +option(Hydrogen_USE_64BIT_INTS + "Use 64-bit integers for internal indexing" OFF) +option(Hydrogen_USE_64BIT_BLAS_INTS + "Use 64-bit integers for BLAS/LAPACK" OFF) +if (Hydrogen_USE_64BIT_BLAS_INTS) + set(EL_USE_64BIT_BLAS_INTS ON) + set(Hydrogen_USE_64BIT_INTS ON) +endif () + +if (Hydrogen_USE_64BIT_INTS) set(EL_USE_64BIT_INTS ON) -endif() - -option(EL_DISABLE_MKL "Do not use MKL even if installed?" OFF) -option(EL_DISABLE_MKL_CSRMV "Avoid MKL's CSR mat-vec?" ON) - -option(EL_DISABLE_BLIS_LAPACK "Avoid BLIS+LAPACK" OFF) -option(EL_PREFER_BLIS_LAPACK "Prefer BLIS+LAPACK over alternatives?" OFF) -option(EL_FORCE_BLIS_LAPACK_BUILD - "Avoid search for BLIS and instead buiild?" OFF) - -option(EL_DISABLE_OPENBLAS "Avoid OpenBLAS" OFF) -option(EL_PREFER_OPENBLAS "Prefer OpenBLAS over alternatives?" OFF) -option(EL_FORCE_OPENBLAS_BUILD - "Avoid search for OpenBLAS and instead build?" OFF) - -option(EL_DISABLE_SCALAPACK "Avoid ScaLAPACK" ON) -if(NOT EL_DISABLE_SCALAPACK AND EL_USE_64BIT_BLAS_INTS AND - (NOT CUSTOM_BLAS_SUFFIX OR NOT CUSTOM_LAPACK_SUFFIX)) - # Ugh. Elemental currently supports ScaLAPACK building its own custom - # BLAS and LAPACK if Elemental is using a custom symbol suffix for its own. - message(FATAL_ERROR "ScaLAPACK is not supported for 64-bit builds with manually specified BLAS/LAPACK libraries") -endif() -option(EL_FORCE_SCALAPACK_BUILD - "Avoid search for ScaLAPACK and instead build?" OFF) - -# By default, a search is performed for ParMETIS via find_package, and, if this -# search fails, ParMETIS is downloaded from the official location: -# http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-4.0.3.tar.gz -# If EL_FORCE_PARMETIS_BUILD is turned on, then no initial call to -# find_package is performed. -# -# Should you want to manually specify a ParMETIS installation, you can set the -# variables PARMETIS_INCLUDE_DIRS and PARMETIS_LIBRARIES -# -option(EL_FORCE_PARMETIS_BUILD "Force build of ParMETIS?" OFF) -# ParMETIS cannot be commercially used without a license and so users interested -# in using Elemental in commercial applications should disable ParMETIS -option(EL_DISABLE_PARMETIS "Disable ParMETIS?" OFF) - -# If ParMETIS is disabled, a search is performed for METIS via find_package, -# and, if this search fails, METIS is cloned from the git repo -# https://github.com/poulson/Metis.git. -# If EL_FORCE_METIS_BUILD is turned on, then no initial call to find_package is -# performed. -# -# Should you want to manually specify a METIS installation, you can set the -# variables METIS_INCLUDE_DIRS and METIS_LIBRARIES -option(EL_FORCE_METIS_BUILD "Force a build of METIS?" OFF) - -# Advanced options -# ---------------- - -if(APPLE) - option(HAVE_PACKAGEMAKER "Have Mac OS X PackageMaker?" OFF) - mark_as_advanced(HAVE_PACKAGEMAKER) -endif() - -# Whether or not to have the Memory class zero initialize what it allocates. -# If valgrind was detected and is running, this will be forced anyway. -option(EL_ZERO_INIT "Initialize buffers to zero by default?" OFF) -mark_as_advanced(EL_ZERO_INIT) - -option(EL_DISABLE_VALGRIND "Prevent Elemental from looking for valgrind?" OFF) -mark_as_advanced(EL_DISABLE_VALGRIND) - -option(EL_USE_CUSTOM_ALLTOALLV "Avoid MPI_Alltoallv for performance reasons" ON) -mark_as_advanced(EL_USE_CUSTOM_ALLTOALLV) - -# Since it is surprisingly common for MPI libraries to have bugs in their -# support for complex data, the following option forces Elemental to cast -# all possible MPI communications in terms of twice as many real units of data. -option(EL_AVOID_COMPLEX_MPI "Avoid potentially buggy complex MPI routines" ON) -mark_as_advanced(EL_AVOID_COMPLEX_MPI) - -# At one point, a bug was found in IBM's C++ compiler for Blue Gene/P, -# where OpenMP statements of the form a[i] += alpha b[i], with complex data, -# would segfault and/or return incorrect results -option(EL_AVOID_OMP_FMA "Avoid a bug in the IBM compilers." OFF) -mark_as_advanced(EL_AVOID_OMP_FMA) - -# Due to a subtle flaw in the Blue Gene/P extensions for MPICH2, treating -# floating-point data as a collection of byte-sized objects results in a -# better algorithm being chosen for MPI_Allgather. This should not effect -# performance on most machines. -option(EL_USE_BYTE_ALLGATHERS "Avoid BG/P allgather performance bug." ON) -mark_as_advanced(EL_USE_BYTE_ALLGATHERS) - -# If MPI_Reduce_scatter_block doesn't exist, perform it by composing -# MPI_Allreduce and std::memcpy rather than MPI_Reduce and MPI_Scatter -option(EL_REDUCE_SCATTER_BLOCK_VIA_ALLREDUCE - "AllReduce based block MPI_Reduce_scatter" OFF) -mark_as_advanced(EL_REDUCE_SCATTER_BLOCK_VIA_ALLREDUCE) - -# Print a warning any time a redistribution is performed which unpacks a -# large amount of data with a non-unit stride -option(EL_CACHE_WARNINGS "Warns when using cache-unfriendly routines" OFF) -mark_as_advanced(EL_CACHE_WARNINGS) - -# Print a warning when an improperly aligned redistribution is performed, -# i.e., if an unnecessary permutation communication stage must take place -option(EL_UNALIGNED_WARNINGS - "Warn when performing unaligned redistributions" OFF) -mark_as_advanced(EL_UNALIGNED_WARNINGS) - -# Print a warning if an opportunity was missed to implement a redistribution -# approach specifically for vectors (instead of matrices) -option(EL_VECTOR_WARNINGS - "Warn when vector redistribution chances are missed" OFF) -mark_as_advanced(EL_VECTOR_WARNINGS) - -# Build logic -# =========== - -# Add the header file include directories first (so they have priority) -# --------------------------------------------------------------------- -message(STATUS - "Appending ${PROJECT_SOURCE_DIR}/include for Elemental's source includes") -include_directories("${PROJECT_SOURCE_DIR}/include") -message(STATUS - "Appending ${PROJECT_BINARY_DIR}/include for Elemental's binary includes") -include_directories("${PROJECT_BINARY_DIR}/include") - -if(BUILD_SHARED_LIBS) - set(LIBRARY_TYPE SHARED) -else() - set(LIBRARY_TYPE STATIC) -endif() - -# Elemental must be built "out-of-source", so we start by ensuring that the -# source and build directories are different. -if(PROJECT_SOURCE_DIR STREQUAL PROJECT_BINARY_DIR) - message(FATAL_ERROR "In-source build attempted; please clean the CMake cache and then switch to an out-of-source build, e.g.,\nrm CMakeCache.txt && rm -Rf CMakeFiles/\nmkdir build/ && cd build/ && cmake ..") -endif() - -# Get the Git revision -include(GetGitRevisionDescription) -get_git_head_revision(GIT_REFSPEC GIT_SHA1) - -# Ensure that the build type is set to either Release or Debug -if(CMAKE_BUILD_TYPE STREQUAL "Release") - # This option is okay as-is - set(CMAKE_BUILD_TYPE Release) -elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") - # This option is okay as-is - set(CMAKE_BUILD_TYPE Debug) -elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo") - message(WARNING "RelWithDebInfo not supported; switching to Release") - set(CMAKE_BUILD_TYPE Release) -elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") - message(WARNING "MinSizeRel not supported; switching to Release") - set(CMAKE_BUILD_TYPE Release) -else() - message(WARNING "Build mode not specified, defaulting to Release build.") - set(CMAKE_BUILD_TYPE Release) -endif() - -if(CMAKE_BUILD_TYPE STREQUAL "Release") - set(EL_RELEASE TRUE) -else() - set(EL_RELEASE FALSE) -endif() -string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE) - -# Set the basic compile flags from the build type -# -# The -fcx-fortran-rules GCC option was added due to it leading to a factor of -# 10 performance difference in the complex Hessenberg QR sweeps. It seems that -# this option is enabled by default for Clang and Intel compilers (but this -# assumption is worth checking). -# -if(NOT WIN32) - set(LANGUAGES CXX C Fortran) - foreach(LANG ${LANGUAGES}) - if(NOT ${LANG}_FLAGS) - if(EL_RELEASE) - set(LANG_FLAGS_STRING - "${LANG} optimization flags for ${UPPER_BUILD_TYPE} mode") - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(${LANG}_FLAGS "-O3 -fcx-fortran-rules" - CACHE STRING ${LANG_FLAGS_STRING}) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(${LANG}_FLAGS "-O3 -Wno-tautological-compare" - CACHE STRING ${LANG_FLAGS_STRING}) - else() - set(${LANG}_FLAGS "-O3" CACHE STRING ${LANG_FLAGS_STRING}) - endif() - else() - set(LANG_FLAGS_STRING - "${LANG} optimization/debug flags for ${UPPER_BUILD_TYPE} mode") - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(${LANG}_FLAGS "-O2 -g -fcx-fortran-rules -Wall -Wunused-variable -Wunused-but-set-variable -Wunused-local-typedefs" - CACHE STRING ${LANG_FLAGS_STRING}) - elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(${LANG}_FLAGS "-O2 -g -Wno-tautological-compare" - CACHE STRING ${LANG_FLAGS_STRING}) - else() - set(${LANG}_FLAGS "-O2 -g" CACHE STRING ${LANG_FLAGS_STRING}) - endif() - endif() - endif() - endforeach() -endif() - -# Disable the requirement for safe exception handling in MSVC builds -# (otherwise there are conflicts with OpenBLAS) -if(MSVC) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") - set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") - set(CMAKE_EXE_LINKER_FLAGS_${UPPER_BUILD_TYPE} - "${CMAKE_EXE_LINKER_FLAGS_${UPPER_BUILD_TYPE}} /SAFESEH:NO") - set(CMAKE_SHARED_LINKER_FLAGS_${UPPER_BUILD_TYPE} - "${CMAKE_SHARED_LINKER_FLAGS_${UPPER_BUILD_TYPE}} /SAFESEH:NO") - set(CMAKE_MODULE_LINKER_FLAGS_${UPPER_BUILD_TYPE} - "${CMAKE_MODULE_LINKER_FLAGS_${UPPER_BUILD_TYPE}} /SAFESEH:NO") -endif() - -if(APPLE AND EL_RELEASE AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND - NOT EL_IGNORE_OSX_GCC_ALIGNMENT_PROBLEM) - # There seems to only be a problem for the 5.x and 6.x series, as 4.9 seems - # to be fine, even with -O3 optimization. - # - # Please see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=35271 for what - # appears to be a related (although, now quite dated) issue. - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0) - # This version of GCC might be fine; there are issues with GCC exception - # handling (at the very least, effecting Homebrew GCC 4.9 on Sierra). - message(WARNING "Please ensure that your version of GCC is functioning on this platform. Homebrew GCC 4.9 is known to cause segfaults when C++ exceptions are thrown on OS X Sierra.") - else() - message(FATAL_ERROR "Due to what appears to be a bug in GCC 5.x and 6.x (you appear to be using GCC ${CMAKE_CXX_COMPILER_VERSION}) enforcement of 16-byte stack alignments when using -O3 on OS X, Release builds with GCC on OS X are currently disabled by default. Please see the comments towards the bottom of https://github.com/elemental/Elemental/issues/181 for more details. If you know what you're doing, feel free to rebuild with -D EL_IGNORE_OSX_GCC_ALIGNMENT_PROBLEM=ON") - endif() -endif() - -# Handle RPATHs for Mac -# --------------------- -if(APPLE) - set(CMAKE_MACOSX_RPATH TRUE) - - # use, i.e. don't skip the full RPATH for the build tree - set(CMAKE_SKIP_BUILD_RPATH FALSE) - - # when building, don't use the install RPATH already - # (but later on when installing) - set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) - - # Add automatically determined parts of RPATH which point to directories - # outside the build tree to the install RPATH - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # RPATH to be used when installing, but only if it's not a system directory - list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES - "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir) - if("${isSystemDir}" STREQUAL "-1") - set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") - endif() -endif() - -# Detect Fortran -# -------------- -include(detect/Fortran) - -# Detect C++11 -# ------------ +endif () + +# Debugging and testing options + +option(Hydrogen_ENABLE_BOUNDS_CHECKING + "Do bounds checking in various routines regardless of DEBUG build." + OFF) +set(HYDROGEN_DO_BOUNDS_CHECKING ${Hydrogen_ENABLE_BOUNDS_CHECKING}) + +option(Hydrogen_ENABLE_TESTING + "Build the test suite in the tests directory." ON) + +option(Hydrogen_ENABLE_UNIT_TESTS + "Build the Catch2-based unit tests." OFF) + +option(Hydrogen_ZERO_INIT "Initialize buffers to zero by default?" OFF) +mark_as_advanced(Hydrogen_ZERO_INIT) +if (Hydrogen_ZERO_INIT) + set(EL_ZERO_INIT ${Hydrogen_ZERO_INIT}) +endif () + +option(Hydrogen_ENABLE_VALGRIND + "Search for valgrind and enable related features" OFF) +mark_as_advanced(Hydrogen_ENABLE_VALGRIND) +if (Hydrogen_ENABLE_VALGRIND) + set(EL_ENABLE_VALGRIND ${Hydrogen_ENABLE_VALGRIND}) +endif () + +# Profiling options + +option(Hydrogen_ENABLE_NVPROF + "Search for NVProf and enable related features" OFF) +option(Hydrogen_ENABLE_VTUNE + "Search for VTune and enable related features" OFF) +option(Hydrogen_ENABLE_SYNCHRONOUS_PROFILING + "Perform compute-stream synchronization before beginning profile regions" + OFF) +if (Hydrogen_ENABLE_SYNCHRONOUS_PROFILING) + set(HYDROGEN_DEFAULT_SYNC_PROFILING TRUE) +endif () + +# Thread/OpenMP parallelism options + +option(Hydrogen_ENABLE_OPENMP + "Enable OpenMP support in Hydrogen" OFF) + +if (Hydrogen_ENABLE_OPENMP) + option(Hydrogen_ENABLE_OMP_TASKLOOP + "Use taskloops instead of parallel for" OFF) +endif () + +# MPI-related options + +# CUDA-aware MPI can provide a benefit, if it works. However, it is +# often buggy. We can avoid it by setting this to ON. +option(Hydrogen_AVOID_CUDA_AWARE_MPI "Avoid CUDA-aware MPI" OFF) + +option(Hydrogen_USE_CUSTOM_ALLTOALLV + "Avoid MPI_Alltoallv for performance reasons" OFF) +mark_as_advanced(Hydrogen_USE_CUSTOM_ALLTOALLV) +if (Hydrogen_USE_CUSTOM_ALLTOALLV) + set(EL_USE_CUSTOM_ALLTOALLV ${Hydrogen_USE_CUSTOM_ALLTOALLV}) +endif () + +# Since it is surprisingly common for MPI libraries to have bugs in +# their support for complex data, the following option forces +# Elemental to cast all possible MPI communications in terms of twice +# as many real units of data. +option(Hydrogen_AVOID_COMPLEX_MPI + "Avoid potentially buggy complex MPI routines" OFF) +mark_as_advanced(Hydrogen_AVOID_COMPLEX_MPI) +if (Hydrogen_AVOID_COMPLEX_MPI) + set(EL_AVOID_COMPLEX_MPI ${Hydrogen_AVOID_COMPLEX_MPI}) +endif () + +# Due to a subtle flaw in the Blue Gene/P extensions for MPICH2, +# treating floating-point data as a collection of byte-sized objects +# results in a better algorithm being chosen for MPI_Allgather. This +# should not effect performance on most machines. +option(Hydrogen_USE_BYTE_ALLGATHERS + "Avoid BG/P allgather performance bug." OFF) +mark_as_advanced(Hydrogen_USE_BYTE_ALLGATHERS) +if (Hydrogen_USE_BYTE_ALLGATHERS) + set(EL_USE_BYTE_ALLGATHERS ${Hydrogen_USE_BYTE_ALLGATHERS}) +endif () + +# Runtime feedback options + +# Print a warning any time a redistribution is performed which unpacks +# a large amount of data with a non-unit stride +option(Hydrogen_CACHE_WARNINGS + "Warns when using cache-unfriendly routines" OFF) +mark_as_advanced(Hydrogen_CACHE_WARNINGS) +if (Hydrogen_CACHE_WARNINGS) + set(EL_CACHE_WARNINGS ${Hydrogen_CACHE_WARNINGS}) +endif () + +# Print a warning when an improperly aligned redistribution is +# performed, i.e., if an unnecessary permutation communication stage +# must take place +option(Hydrogen_UNALIGNED_WARNINGS + "Warn when performing unaligned redistributions" OFF) +mark_as_advanced(Hydrogen_UNALIGNED_WARNINGS) +if (Hydrogen_CACHE_WARNINGS) + set(EL_CACHE_WARNINGS ${Hydrogen_UNALIGNED_WARNINGS}) +endif () + +# Print a warning if an opportunity was missed to implement a +# redistribution approach specifically for vectors (instead of +# matrices) +option(Hydrogen_VECTOR_WARNINGS + "Warn when vector redistribution chances are missed" OFF) +mark_as_advanced(Hydrogen_VECTOR_WARNINGS) +if (Hydrogen_VECTOR_WARNINGS) + set(EL_VECTOR_WARNINGS ${Hydrogen_VECTOR_WARNINGS}) +endif () + +# Check the compiler features + +if (Hydrogen_ENABLE_HALF) + find_package(HALF REQUIRED) + set(HYDROGEN_HAVE_HALF TRUE) +endif () + +if (Hydrogen_ENABLE_CUDA) + enable_language(CUDA) + + find_package(CUDAToolkit REQUIRED) + set(H_CUDA_CXX_LIBS + CUDA::cudart + CUDA::cublas + CUDA::cusolver + CUDA::nvml) + + if (Hydrogen_ENABLE_GPU_TENSOR_MATH) + set(HYDROGEN_GPU_USE_TENSOR_OP_MATH TRUE) + endif () + + if (Hydrogen_ENABLE_GPU_FP16) + set(HYDROGEN_GPU_USE_FP16 TRUE) + endif () + + if (Hydrogen_ENABLE_CUB) + if (CUDAToolkit_VERSION_MAJOR LESS 11) + find_package(CUB MODULE REQUIRED) + set(H_EXTERNAL_CUB TRUE) + list(APPEND H_CUDA_CXX_LIBS cuda::cub) + endif () + set(HYDROGEN_HAVE_CUB TRUE) + endif () + + if (Hydrogen_ENABLE_NVPROF) + if (TARGET CUDA::nvToolsExt) + list(APPEND H_CUDA_CXX_LIBS CUDA::nvToolsExt) + else () + find_package(NVTX MODULE REQUIRED) + set(H_EXTERNAL_NVTX TRUE) + list(APPEND H_CUDA_CXX_LIBS cuda::nvtx) + endif () + set(HYDROGEN_HAVE_NVPROF TRUE) + endif () + + set(HYDROGEN_HAVE_CUDA TRUE) + +endif (Hydrogen_ENABLE_CUDA) + +if (Hydrogen_ENABLE_ROCM) + # This *must* come first! + find_package(hip CONFIG REQUIRED) + + enable_language(HIP) + + if (Hydrogen_ENABLE_CUB) + find_package(hipcub REQUIRED) + set(HYDROGEN_HAVE_CUB TRUE) + else () + set(HYDROGEN_HAVE_CUB FALSE) + endif () + + find_package(rocblas CONFIG REQUIRED) + find_package(rocsolver CONFIG REQUIRED) + find_package(rocthrust CONFIG REQUIRED) + + set(HYDROGEN_HAVE_ROCM TRUE) + message(STATUS "Found ROCm/HIP toolchain. Using HIP/ROCm.") + + set(H_ROCM_CXX_LIBS + hip::host + hip::hipcub + roc::rocblas + roc::rocsolver + roc::rocthrust) + + set(H_ROCM_HIP_LIBS + hip::device) +endif (Hydrogen_ENABLE_ROCM) + +if (HYDROGEN_HAVE_CUDA OR HYDROGEN_HAVE_ROCM) + set(HYDROGEN_HAVE_GPU TRUE) +endif () + +if (Hydrogen_ENABLE_ALUMINUM) + find_package(Aluminum 1.0.0 CONFIG QUIET) + if (NOT Aluminum_FOUND AND Aluminum_NOT_FOUND_MESSAGE) + message(STATUS + "A candidate Aluminum > v1.0.0 was found, but was not selected:") + message(STATUS + " ${Aluminum_NOT_FOUND_MESSAGE}") + endif () + # Try again, since we're technically ok with >v0.7.0 + if (NOT Aluminum_FOUND) + find_package(Aluminum 0.7.0 CONFIG QUIET) + if (NOT Aluminum_FOUND AND Aluminum_NOT_FOUND_MESSAGE) + message(STATUS + "A candidate Aluminum > v0.7.0 was found, but was not selected:") + message(STATUS + " ${Aluminum_NOT_FOUND_MESSAGE}") + endif () + endif () + + if (Aluminum_FOUND) + set(HYDROGEN_HAVE_ALUMINUM TRUE) + message(STATUS + "Found Aluminum@${ALUMINUM_VERSION}: ${Aluminum_DIR}") + + if (HYDROGEN_HAVE_GPU AND AL_HAS_NCCL) + set(HYDROGEN_HAVE_NCCL2 TRUE) + message(STATUS "Aluminum detected with NCCL2 backend support.") + else () + set(HYDROGEN_HAVE_NCCL2 FALSE) + endif (HYDROGEN_HAVE_GPU AND AL_HAS_NCCL) + + if (HYDROGEN_HAVE_GPU AND AL_HAS_HOST_TRANSFER) + set(HYDROGEN_HAVE_AL_HOST_XFER TRUE) + message(STATUS "Aluminum detected with HostTransfer backend support.") + else () + set(HYDROGEN_HAVE_AL_HOST_XFER FALSE) + endif (HYDROGEN_HAVE_GPU AND AL_HAS_HOST_TRANSFER) + + if (HYDROGEN_HAVE_GPU AND AL_HAS_MPI_CUDA) + set(HYDROGEN_HAVE_AL_MPI_CUDA TRUE) + message(STATUS "Aluminum detected with MPI-CUDA backend support.") + else () + set(HYDROGEN_HAVE_AL_MPI_CUDA FALSE) + endif (HYDROGEN_HAVE_GPU AND AL_HAS_MPI_CUDA) + else () + message(FATAL_ERROR "Aluminum support requested but not found. " + "Please set Aluminum_DIR to point to the installation prefix " + "for Aluminum.") + endif (Aluminum_FOUND) +endif (Hydrogen_ENABLE_ALUMINUM) + +# Sets up EL_RESTRICT and EL_HAVE_PRETTY_FUNCTION include(detect/CXX) -set(CXX_FLAGS "${CXX_FLAGS} ${CXX14_COMPILER_FLAGS}") - -# Detect MPI -# ---------- -include(detect/MPI) -message(STATUS "Appending ${MPI_C_INCLUDE_PATH} for MPI headers") -include_directories(${MPI_C_INCLUDE_PATH}) -set(CXX_FLAGS "${CXX_FLAGS} ${MPI_CXX_COMPILE_FLAGS}") - -# Detect OpenMP -# ------------- -include(detect/OpenMP) -if(EL_HYBRID) - set(CXX_FLAGS "${CXX_FLAGS} ${OpenMP_CXX_FLAGS}") -endif() - -# Detect Qt5 -# ---------- -include(detect/Qt5) -if(EL_HAVE_QT5) - set(CXX_FLAGS "${CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") -endif() - -# Allow valgrind support if possible (if running valgrind, explicitly zero init) -# ------------------------------------------------------------------------------ -if(NOT EL_DISABLE_VALGRIND) - include(FindValgrind) - if(VALGRIND_FOUND) - message(STATUS "Appending ${VALGRIND_INCLUDE_DIR} for Valgrind headers") - include_directories(${VALGRIND_INCLUDE_DIR}) - list(APPEND EXTERNAL_INCLUDE_DIRS ${VALGRIND_INCLUDE_DIR}) - set(EL_HAVE_VALGRIND TRUE) - endif() -endif() - -# Import several external math libraries (e.g., BLAS/LAPACK/METIS/ParMETIS) -# ------------------------------------------------------------------------- -include(external_projects/ElMath) - -# Now that testing is done, set the CXX build and link flags -# ---------------------------------------------------------- -set(CMAKE_CXX_FLAGS_${UPPER_BUILD_TYPE} ${CXX_FLAGS}) -set(EL_LINK_FLAGS) -if(MPI_CXX_LINK_FLAGS) - set(EL_LINK_FLAGS ${MPI_CXX_LINK_FLAGS}) -endif() -if(EL_BUILT_BLIS_LAPACK) - if(EL_LINK_FLAGS) - set(EL_LINK_FLAGS "${EL_LINK_FLAGS} ${OpenMP_CXX_FLAGS}") - else() - set(EL_LINK_FLAGS ${OpenMP_CXX_FLAGS}) - endif() -endif() - -# Elemental's mod's of Parallel Multiple Relatively Robust Representations -# ------------------------------------------------------------------------ -add_subdirectory(external/pmrrr) -if(EL_BUILT_SCALAPACK) - add_dependencies(pmrrr project_scalapack) -else() - if(EL_BUILT_BLIS_LAPACK) - add_dependencies(pmrrr project_blis_lapack) - endif() - if(EL_BUILT_OPENBLAS) - add_dependencies(pmrrr project_openblas) - endif() -endif() - -# Elemental's modifications of (a subset of) SuiteSparse -# ------------------------------------------------------ -add_subdirectory(external/suite_sparse) -include_directories(external/suite_sparse/include) - -# Create a file which can be included in Makefile's. -# This is meant to be analogous to PETSc's 'conf/petscvariables' file -include(CreateElVars) - -# The main library -# ================ - -# Get the combined list of source files for Elemental -# --------------------------------------------------- -file(GLOB_RECURSE EL_C_CPP_SOURCE RELATIVE "${PROJECT_SOURCE_DIR}" - "src/*.c" "src/*.cpp" "include/*.h" "include/*.hpp" ) -if(EL_HAVE_QT5) - set(EL_HEADERS_PREMOC - "include/El/io/DisplayWindow-premoc.hpp;include/El/io/ComplexDisplayWindow-premoc.hpp") - qt_wrap_cpp(El EL_MOC_SRC ${EL_HEADERS_PREMOC}) - message(STATUS "Appending ${Qt5Widgets_INCLUDE_DIRS} for Qt5 headers") - include_directories(${Qt5Widgets_INCLUDE_DIRS}) - add_definitions(${Qt5Widgets_DEFINITIONS}) - - # Qt5Widgets_DIR = Qt5_LIBDIR/cmake/Qt5Widgets - get_filename_component(Qt5_CMAKEDIR ${Qt5Widgets_DIR} PATH) - get_filename_component(Qt5_LIBDIR ${Qt5_CMAKEDIR} PATH) - - set(EL_C_CPP_FILES "${EL_C_CPP_SOURCE};${EL_MOC_SRC}") -else() - set(EL_C_CPP_FILES "${EL_C_CPP_SOURCE}") -endif() - -# Handle the header preparation and installation -# ---------------------------------------------- -configure_file("${PROJECT_SOURCE_DIR}/cmake/configure_files/config.h.in" - "${PROJECT_BINARY_DIR}/include/El/config.h") -install(FILES "${PROJECT_BINARY_DIR}/include/El/config.h" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/El) -add_custom_target(El_config DEPENDS "${PROJECT_BINARY_DIR}/include/El/config.h") -install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") - -# Define the main library for Elemental -# ------------------------------------- -add_library(El ${EL_C_CPP_FILES}) -set_target_properties(El PROPERTIES VERSION ${EL_VERSION_MINOR} - SOVERSION ${EL_VERSION_MAJOR}) -add_dependencies(El El_config) -if(EL_BUILT_SCALAPACK) - add_dependencies(El project_scalapack) -else() - if(EL_BUILT_BLIS_LAPACK) - add_dependencies(El project_blis_lapack) - endif() - if(EL_BUILT_OPENBLAS) - add_dependencies(El project_openblas) - endif() -endif() -if(EL_BUILT_METIS) - add_dependencies(El project_metis) -endif() -if(EL_BUILT_PARMETIS) - add_dependencies(El project_parmetis) -endif() -set(LINK_LIBS pmrrr ElSuiteSparse - ${EXTERNAL_LIBS} ${MATH_LIBS} ${MPI_CXX_LIBRARIES}) -if(EL_HAVE_QT5) - set(LINK_LIBS ${LINK_LIBS} ${Qt5Widgets_LIBRARIES}) -endif() -target_link_libraries(El ${LINK_LIBS}) -if(EL_LINK_FLAGS) - set_target_properties(El PROPERTIES LINK_FLAGS ${EL_LINK_FLAGS}) -endif() -target_include_directories(El INTERFACE ${EXTERNAL_INCLUDE_DIRS}) -install(TARGETS El EXPORT ElementalTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) - -# Decide if/how to install the Python interface -# --------------------------------------------- -if(BUILD_SHARED_LIBS) - # Create the environment file for Python which hardcodes the installation dir - configure_file("${PROJECT_SOURCE_DIR}/cmake/configure_files/environment.py.in" - "${PROJECT_BINARY_DIR}/python/core/environment.py") - if(INSTALL_PYTHON_PACKAGE) - if(NOT PYTHON_SITE_PACKAGES) - if(INSTALL_PYTHON_INTO_USER_SITE) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "import site; print site.USER_SITE" - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE) - else() - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c - "from distutils.sysconfig import get_python_lib; print get_python_lib()" - OUTPUT_VARIABLE PYTHON_SITE_PACKAGES - OUTPUT_STRIP_TRAILING_WHITESPACE) - endif() - set(PYTHON_SITE_PACKAGES "${PYTHON_SITE_PACKAGES}" - CACHE PATH "Destination for Python site package directory") - endif() - install(DIRECTORY "${PROJECT_SOURCE_DIR}/python/" - DESTINATION "${PYTHON_SITE_PACKAGES}/El" - FILES_MATCHING PATTERN "*.py") - install(FILES "${PROJECT_BINARY_DIR}/python/core/environment.py" - DESTINATION "${PYTHON_SITE_PACKAGES}/El/core") - else() - install(DIRECTORY "${PROJECT_SOURCE_DIR}/python/" - DESTINATION python/El - FILES_MATCHING PATTERN "*.py") - install(FILES "${PROJECT_BINARY_DIR}/python/core/environment.py" - DESTINATION python/El/core) - endif() -endif() -if(BINARY_SUBDIRECTORIES) - set(EXPERIMENTAL_INSTALL_DIR experimental/g3d) -endif() -# Experimental -# ============ -# NOTE: This is insanely outdated -if(EL_EXPERIMENTAL) - set(EXPERIMENTAL_DIR "${PROJECT_SOURCE_DIR}/experimental") - # Build the G3D example(s) - set(G3D_EXPERS G3DGemm) - set(OUTPUT_DIR "${PROJECT_BINARY_DIR}/bin/experimental/g3d") - foreach(EXPER ${G3D_EXPERS}) - set(DRIVER "${EXPERIMENTAL_DIR}/g3d/${EXPER}.cpp") - add_executable(experimental-g3d-${EXPER} "${DRIVER}") - set_source_files_properties("${DRIVER}" PROPERTIES - OBJECT_DEPENDS "${PREPARED_HEADERS}") - target_link_libraries(experimental-g3d-${EXPER} El) - set_target_properties(experimental-g3d-${EXPER} PROPERTIES - OUTPUT_NAME ${EXPER} - SUFFIX "${CMAKE_EXECUTABLE_SUFFIX_CXX}" - RUNTIME_OUTPUT_DIRECTORY ${OUTPUT_DIR}) - if(EL_LINK_FLAGS) - set_target_properties(experimental-g3d-${EXPER} PROPERTIES - LINK_FLAGS ${EL_LINK_FLAGS}) - endif() - install(TARGETS experimental-g3d-${EXPER} DESTINATION ${CMAKE_INSTALL_BINDIR}/${EXPERIMENTAL_INSTALL_DIR}) - endforeach() -endif() - -# Install data -# ============ -# TODO(poulson): Also install into the build directory? How to have drivers -# automatically find the right path? -install(DIRECTORY "${PROJECT_SOURCE_DIR}/data/" - DESTINATION ${CMAKE_INSTALL_DATADIR}/elemental/ FILES_MATCHING PATTERN "*.*") -# Install license and author information -# ====================================== -install(FILES - "${PROJECT_SOURCE_DIR}/AUTHORS" - "${PROJECT_SOURCE_DIR}/LICENSE" - "${PROJECT_SOURCE_DIR}/PUBLICATIONS.bib" - "${PROJECT_SOURCE_DIR}/README.md" - "${PROJECT_SOURCE_DIR}/REFERENCES.bib" - DESTINATION ${CMAKE_INSTALL_DOCDIR}) - -# Tests and examples -# ================== -include(CTest) - -# Sandbox test -# ------------ -install(FILES "${PROJECT_SOURCE_DIR}/sandbox/Makefile" - DESTINATION ${CMAKE_INSTALL_DOCDIR}/sandbox) -install(FILES "${PROJECT_SOURCE_DIR}/sandbox/test.cpp" - DESTINATION ${CMAKE_INSTALL_DOCDIR}/sandbox) -add_executable(sandbox-test "${PROJECT_SOURCE_DIR}/sandbox/test.cpp") -set_source_files_properties("${PROJECT_SOURCE_DIR}/sandbox/test.cpp" - PROPERTIES OBJECT_DEPENDS "${PREPARED_HEADERS}") -target_link_libraries(sandbox-test El) -set_target_properties(sandbox-test PROPERTIES - OUTPUT_NAME sandbox-test - SUFFIX "${CMAKE_EXECUTABLE_SUFFIX_CXX}" - RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") -if(EL_LINK_FLAGS) - set_target_properties(sandbox-test PROPERTIES LINK_FLAGS ${EL_LINK_FLAGS}) -endif() - -# Test drivers -# ------------ -if(EL_TESTS) - set(TEST_DIR "${PROJECT_SOURCE_DIR}/tests") - set(TEST_TYPES core blas_like lapack_like optimization) - foreach(TYPE ${TEST_TYPES}) - file(GLOB_RECURSE ${TYPE}_TESTS - RELATIVE "${PROJECT_SOURCE_DIR}/tests/${TYPE}/" "tests/${TYPE}/*.cpp") - - set(OUTPUT_DIR "${PROJECT_BINARY_DIR}/bin/tests/${TYPE}") - foreach(TEST ${${TYPE}_TESTS}) - set(DRIVER "${TEST_DIR}/${TYPE}/${TEST}") - get_filename_component(TESTNAME ${TEST} NAME_WE) - add_executable(tests-${TYPE}-${TESTNAME} "${DRIVER}") - set_source_files_properties("${DRIVER}" PROPERTIES - OBJECT_DEPENDS "${PREPARED_HEADERS}") - target_link_libraries(tests-${TYPE}-${TESTNAME} El) - if(BINARY_SUBDIRECTORIES) - set(TEST_INSTALL_DIR test/${TYPE}) - set(TEST_OUTPUT_NAME ${TESTNAME}) - else() - set(TEST_OUTPUT_NAME tests-${TYPE}-${TESTNAME}) - endif() - set_target_properties(tests-${TYPE}-${TESTNAME} PROPERTIES - OUTPUT_NAME ${TEST_OUTPUT_NAME} - SUFFIX "${CMAKE_EXECUTABLE_SUFFIX_CXX}" - RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}") - if(EL_LINK_FLAGS) - set_target_properties(tests-${TYPE}-${TESTNAME} PROPERTIES - LINK_FLAGS ${EL_LINK_FLAGS}) - endif() - install(TARGETS tests-${TYPE}-${TESTNAME} - DESTINATION ${CMAKE_INSTALL_BINDIR}/${TEST_INSTALL_DIR}) - if(NOT TESTNAME STREQUAL "SparseLDLRange") #Skip tests that can time out - add_test(NAME Tests/${TYPE}/${TESTNAME} - WORKING_DIRECTORY "${OUTPUT_DIR}" - COMMAND tests-${TYPE}-${TESTNAME} -platform offscreen) - endif() - endforeach() +# Other TPLs + +if (Hydrogen_ENABLE_VTUNE) + find_package(VTUNE REQUIRED) + set(HYDROGEN_HAVE_VTUNE TRUE) +else () + set(HYDROGEN_HAVE_VTUNE FALSE) +endif () + +if (Hydrogen_ENABLE_OPENMP) + include(FindAndVerifyOpenMP) + if (OpenMP_FOUND) + set(EL_HYBRID ON) + else () + message(WARNING "Requested OpenMP support but OpenMP support was either " + "not found or not functional.") + set(EL_HYBRID OFF) + set(Hydrogen_ENABLE_OPENMP OFF) + endif () +endif (Hydrogen_ENABLE_OPENMP) + +include(FindAndVerifyMPI) +include(FindAndVerifyLAPACK) +include(FindAndVerifyExtendedPrecision) + +# Catch2 +if (Hydrogen_ENABLE_UNIT_TESTS) + find_package(Catch2 2.0.0 CONFIG REQUIRED) + include(Catch) +endif () + +# Get the source files + +# Macro for setting up full paths +macro(set_full_path VAR) + unset(__tmp_names) + foreach(filename ${ARGN}) + unset(__name) + get_filename_component(__name "${filename}" ABSOLUTE) + list(APPEND __tmp_names "${__name}") endforeach() -endif() - -# Examples -# -------- -if(EL_EXAMPLES) - set(EXAMPLE_DIR "${PROJECT_SOURCE_DIR}/examples") - set(EXAMPLE_TYPES - optimization core blas_like interface io lapack_like matrices - number_theory) - foreach(TYPE ${EXAMPLE_TYPES}) - if(EL_C_INTERFACE) - file(GLOB_RECURSE ${TYPE}_EXAMPLES RELATIVE - "${PROJECT_SOURCE_DIR}/examples/${TYPE}/" - "examples/${TYPE}/*.cpp" - "examples/${TYPE}/*.c" ) - else() - file(GLOB_RECURSE ${TYPE}_EXAMPLES RELATIVE - "${PROJECT_SOURCE_DIR}/examples/${TYPE}/" - "examples/${TYPE}/*.cpp") - endif() - set(OUTPUT_DIR "${PROJECT_BINARY_DIR}/bin/examples/${TYPE}") - foreach(EXAMPLE ${${TYPE}_EXAMPLES}) - set(DRIVER "${EXAMPLE_DIR}/${TYPE}/${EXAMPLE}") - get_filename_component(EXNAME ${EXAMPLE} NAME_WE) - add_executable(examples-${TYPE}-${EXNAME} "${DRIVER}") - set_source_files_properties("${DRIVER}" PROPERTIES - OBJECT_DEPENDS "${PREPARED_HEADERS}") - target_link_libraries(examples-${TYPE}-${EXNAME} El) - if(BINARY_SUBDIRECTORIES) - set(EXAMPLE_INSTALL_DIR examples/${TYPE}) - set(EXAMPLE_OUTPUT_NAME ${EXNAME}) - else() - set(EXAMPLE_OUTPUT_NAME examples-${TYPE}-${EXNAME}) - endif() - set_target_properties(examples-${TYPE}-${EXNAME} PROPERTIES - OUTPUT_NAME ${EXAMPLE_OUTPUT_NAME} - SUFFIX "${CMAKE_EXECUTABLE_SUFFIX_CXX}" - RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}") - if(EL_LINK_FLAGS) - set_target_properties(examples-${TYPE}-${EXNAME} PROPERTIES - LINK_FLAGS ${EL_LINK_FLAGS}) - endif() - install(TARGETS examples-${TYPE}-${EXNAME} - DESTINATION ${CMAKE_INSTALL_BINDIR}/${EXAMPLE_INSTALL_DIR}) - add_test(NAME Examples/${TYPE}/${EXNAME} - WORKING_DIRECTORY "${OUTPUT_DIR}" - COMMAND examples-${TYPE}-${EXNAME} -platform offscreen) - endforeach() - endforeach() -endif() - -# CPack -# ===== -# While PackageMaker is deprecated, productbuild is not yet supported by CPack. -# Furthermore, it is possible to download the "Late July 2012" version of -# PackageMaker (which curiously has a release date of August 7, 2012) from -# Apple, but it appears to be incompatible with Yosemite. -# -# Lastly, the current CPack configuration does not yet allow the Python -# interface to be installed within a different directory than the main library -# (e.g., into the user-level or system-wide site-packages directory). -set(CPACK_PACKAGE_NAME "Elemental") -set(CPACK_PACKAGE_VENDOR "libelemental.org") -set(CPACK_PACKAGE_VERSION_MAJOR ${EL_VERSION_MAJOR}) -set(CPACK_PACKAGE_VERSION_MINOR ${EL_VERSION_MINOR}) -set(CPACK_PACKAGE_DESCRIPTION_SUMMARY - "Distributed-memory linear algebra and optimization") -set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/cmake/El.png") -include(CPack) - -# ProjectConfig -# ===== -# Create ElementalConfig.cmake for find_package. -# Add all targets to the build-tree export set -export(TARGETS El pmrrr ElSuiteSparse - FILE "${PROJECT_BINARY_DIR}/ElementalTargets.cmake") - -if(NOT CMAKE_EXPORT_NO_PACKAGE_REGISTRY) - # Export the package for use from the build-tree - # (this registers the build-tree with a global CMake-registry). - # - # While the NOT CMAKE_EXPORT_NO_PACKAGE_REGISTRY guard would seem to be - # redundant, the option was only added circa CMake 3.4.3, and so, rather than - # requiring such a new version of CMake entirely for a binary decision, we - # can instead manually circumvent the export. - export(PACKAGE Elemental) -endif() - -# Create the ElementalConfig.cmake and ElementalConfigVersion files -file(RELATIVE_PATH REL_INCLUDE_DIR "${PROJECT_BINARY_DIR}" - "${PROJECT_BINARY_DIR}/include") -# ... for the build tree -configure_file( - "${PROJECT_SOURCE_DIR}/cmake/configure_files/ElementalConfig.cmake.in" - "${PROJECT_BINARY_DIR}/ElementalConfig.cmake" @ONLY) -# ... for both + set(${VAR} "${__tmp_names}") +endmacro() + +set(HYDROGEN_HEADERS) +set(HYDROGEN_SOURCES) +add_subdirectory(include) +add_subdirectory(src) + +# Setup the configuration files for both "Elemental" and +# "Hydrogen". There's also one for Doxygen for building "build tree" +# docs (which has the advantage that preprocessing will take +# "{,hydrogen_}config.h" into consideration). +configure_file("${PROJECT_SOURCE_DIR}/cmake/configure_files/config.h.in" + "${PROJECT_BINARY_DIR}/include/El/config.h") +configure_file("${PROJECT_SOURCE_DIR}/cmake/configure_files/hydrogen_config.h.in" + "${PROJECT_BINARY_DIR}/include/El/hydrogen_config.h") +configure_file("${PROJECT_SOURCE_DIR}/doxy/Doxyfile.in" + "${PROJECT_BINARY_DIR}/doxy/Doxyfile") + +add_library(Hydrogen_CXX "${HYDROGEN_SOURCES}" "${HYDROGEN_HEADERS}") +target_include_directories(Hydrogen_CXX PUBLIC + $ + $ + $ + $) + +# For now, add all flags regardless of "developer" or not. +foreach (_FLAG IN LISTS __CXX_FLAGS __CXX_DEVELOPER_FLAGS) + check_compiler_flag(CXX "${_FLAG}" CXX_COMPLER_HAS_FLAG_${_FLAG}) + if (CXX_COMPILER_HAS_FLAG_${_FLAG}) + target_compile_options(Hydrogen_CXX PRIVATE + $<$:${_FLAG}>) + endif () +endforeach () + +target_link_libraries( + Hydrogen_CXX PUBLIC + ${Aluminum_LIBRARIES} + ${HALF_LIBRARIES} + ${VTUNE_LIBRARIES} + ${NVTX_LIBRARIES} + $ + $ + $ + $ + + ${H_CUDA_CXX_LIBS} + ${H_ROCM_CXX_LIBS} + ) + +set_target_properties(Hydrogen_CXX + PROPERTIES + VERSION ${HYDROGEN_VERSION}) + +if (NOT CMAKE_CXX_STANDARD) + set_target_properties(Hydrogen_CXX + PROPERTIES + CXX_STANDARD 17) +endif () + +# Add the CXX library to "Hydrogen" +set(HYDROGEN_LIBRARIES Hydrogen_CXX) + +if (HYDROGEN_HAVE_CUDA) + add_library(Hydrogen_CUDA "${HYDROGEN_GPU_SOURCES}") + target_include_directories(Hydrogen_CUDA PUBLIC + $ + $ + $) + + target_link_libraries(Hydrogen_CUDA + PUBLIC + ${HALF_LIBRARIES}) + + foreach (_FLAG IN LISTS __CUDA_FLAGS __CUDA_DEVELOPER_FLAGS) + check_compiler_flag(CUDA "${_FLAG}" CUDA_COMPLER_HAS_FLAG_${_FLAG}) + if (CUDA_COMPILER_HAS_FLAG_${_FLAG}) + target_compile_options(Hydrogen_CUDA PRIVATE + $<$:${_FLAG}>) + endif () + endforeach () + + set_target_properties(Hydrogen_CUDA + PROPERTIES + VERSION ${HYDROGEN_VERSION}) + + if (NOT CMAKE_CUDA_STANDARD) + set_target_properties(Hydrogen_CUDA + PROPERTIES CUDA_STANDARD 17) + endif () + + target_link_libraries(Hydrogen_CXX PUBLIC Hydrogen_CUDA) + list(APPEND HYDROGEN_LIBRARIES Hydrogen_CUDA) +endif () + +if (HYDROGEN_HAVE_ROCM) + add_library(Hydrogen_ROCM STATIC "${HYDROGEN_GPU_SOURCES}") + + # HIP files use the ".hip" extension. Since we don't want to copy + # these files, we have to explicitly set their language to be HIP. + get_target_property(H_HIP_SOURCES Hydrogen_ROCM SOURCES) + set_source_files_properties(${H_HIP_SOURCES} + PROPERTIES LANGUAGE HIP) + + target_include_directories(Hydrogen_ROCM PUBLIC + $ + $ + $ + ) + + target_link_libraries(Hydrogen_ROCM PUBLIC + ${HALF_LIBRARIES} + ${ROCBLAS_LIBRARIES} + ) + + set_target_properties(Hydrogen_ROCM + PROPERTIES + VERSION ${HYDROGEN_VERSION}) + + foreach (_FLAG IN LISTS __HIP_FLAGS __HIP_DEVELOPER_FLAGS) + check_compiler_flag(HIP "${_FLAG}" HIP_COMPLER_HAS_FLAG_${_FLAG}) + if (HIP_COMPILER_HAS_FLAG_${_FLAG}) + target_compile_options(Hydrogen_ROCM PRIVATE + $<$:${_FLAG}>) + endif () + endforeach () + + #set_target_properties(Hydrogen_ROCM PROPERTIES LINKER_LANGUAGE CXX) + list(APPEND HYDROGEN_LIBRARIES Hydrogen_ROCM) +endif () + +# Setup the tests +if (Hydrogen_ENABLE_TESTING OR Hydrogen_ENABLE_UNIT_TESTS) + include(CTest) +endif () + +if (Hydrogen_ENABLE_TESTING) + add_subdirectory(tests) +endif () + +if (Hydrogen_ENABLE_UNIT_TESTS) + add_subdirectory(unit_test) +endif () + +# Setup the library install +install(TARGETS ${HYDROGEN_LIBRARIES} + EXPORT HydrogenTargets + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + INCLUDES DESTINATION include/El + ) + +# Install target stuff +include (CMakePackageConfigHelpers) + +# Write the version file for both the build and the install tree configure_file( - "${PROJECT_SOURCE_DIR}/cmake/configure_files/ElementalConfigVersion.cmake.in" - "${PROJECT_BINARY_DIR}/ElementalConfigVersion.cmake" @ONLY) - -# Install the ElementalConfig.cmake and ElementalConfigVersion.cmake + "${CMAKE_SOURCE_DIR}/cmake/configure_files/HydrogenConfigVersion.cmake.in" + "${CMAKE_BINARY_DIR}/HydrogenConfigVersion.cmake" + @ONLY) + +# Write the configure file for the build tree +set(INCLUDE_INSTALL_DIRS "${CMAKE_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/include" + "${CMAKE_SOURCE_DIR}/include/El" + "${CMAKE_BINARY_DIR}/include/El") +set(LIB_INSTALL_DIR "${CMAKE_BINARY_DIR}") +set(EXTRA_CMAKE_MODULE_DIR "${CMAKE_SOURCE_DIR}/cmake/modules") +configure_package_config_file(cmake/configure_files/HydrogenConfig.cmake.in + "${CMAKE_BINARY_DIR}/HydrogenConfig.cmake" + INSTALL_DESTINATION "${CMAKE_BINARY_DIR}" + PATH_VARS INCLUDE_INSTALL_DIRS LIB_INSTALL_DIR) + +# Build tree export +export(EXPORT HydrogenTargets NAMESPACE H:: FILE HydrogenTargets.cmake) + +# Write the configure file for the install tree +set(INCLUDE_INSTALL_DIRS include) +set(LIB_INSTALL_DIR lib) +set(CMAKE_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/hydrogen) +set(EXTRA_CMAKE_MODULE_DIR) +configure_package_config_file( + cmake/configure_files/HydrogenConfig.cmake.in + "${CMAKE_BINARY_DIR}/cmake/HydrogenConfig.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_DIR} + PATH_VARS INCLUDE_INSTALL_DIRS LIB_INSTALL_DIR) + +# Install the configuration headers install(FILES - "${PROJECT_BINARY_DIR}/ElementalConfig.cmake" - "${PROJECT_BINARY_DIR}/ElementalConfigVersion.cmake" - DESTINATION "${INSTALL_CMAKE_DIR}/elemental" COMPONENT dev) + "${PROJECT_BINARY_DIR}/include/El/config.h" + "${PROJECT_BINARY_DIR}/include/El/hydrogen_config.h" + DESTINATION "include/El") + +# Install tree export +install(EXPORT HydrogenTargets + NAMESPACE H:: + DESTINATION ${CMAKE_INSTALL_DIR}) -install(EXPORT ElementalTargets - DESTINATION "${INSTALL_CMAKE_DIR}/elemental" COMPONENT dev) +# Install the headers +install(DIRECTORY include DESTINATION . + FILES_MATCHING PATTERN "*.hpp" PATTERN "*.h") + +# Install the cmake stuff +install(FILES + "${PROJECT_BINARY_DIR}/cmake/HydrogenConfig.cmake" + "${PROJECT_BINARY_DIR}/HydrogenConfigVersion.cmake" + DESTINATION ${CMAKE_INSTALL_DIR}) +install(DIRECTORY cmake/modules DESTINATION ${CMAKE_INSTALL_DIR} + FILES_MATCHING PATTERN "*.cmake") + +# Summarize this configuration +if (NOT __dont_print_summary) + include(PrintHydrogenSummary) + print_full_hydrogen_summary( + VERSION_VARIABLES + HYDROGEN_VERSION + HYDROGEN_GIT_VERSION + HYDROGEN_LATEST_SHA + HYDROGEN_LATEST_HYDROGEN_SHA + + PATH_VARIABLES + CMAKE_CXX_COMPILER + CMAKE_CUDA_COMPILER + CMAKE_CUDA_HOST_COMPILER + MPI_CXX_COMPILER + CMAKE_INSTALL_PREFIX + CMAKE_SOURCE_DIR + CMAKE_BINARY_DIR + + STRING_VARIABLES + CMAKE_BUILD_TYPE + CMAKE_CUDA_FLAGS + CMAKE_CXX_FLAGS + HYDROGEN_BLAS_SUFFIX + HYDROGEN_LAPACK_SUFFIX + + BOOLEAN_VARIABLES + BUILD_SHARED_LIBS + Hydrogen_ENABLE_TESTING + HYDROGEN_HAVE_QUADMATH + HYDROGEN_HAVE_QD + HYDROGEN_HAVE_GMP + HYDROGEN_HAVE_MPFR + HYDROGEN_HAVE_MPC + HYDROGEN_HAVE_ALUMINUM + HYDROGEN_HAVE_NCCL2 + HYDROGEN_HAVE_AL_MPI_CUDA + HYDROGEN_HAVE_CUDA + HYDROGEN_HAVE_ROCM + HYDROGEN_HAVE_CUB + HYDROGEN_HAVE_OMP_TASKLOOP + HYDROGEN_HAVE_CUDA_AWARE_MPI + HYDROGEN_ENSURE_HOST_MPI_BUFFERS + HYDROGEN_HAVE_OPENBLAS + HYDROGEN_HAVE_LAPACK + HYDROGEN_HAVE_MKL + HYDROGEN_HAVE_MKL_GEMMT + EL_USE_64BIT_INTS + EL_USE_64BIT_BLAS_INTS + EL_ZERO_INIT + EL_HAVE_VALGRIND + EL_HYBRID + EL_HAVE_OPENMP + EL_HAVE_OMP_COLLAPSE + EL_HAVE_OMP_SIMD + EL_USE_CUSTOM_ALLTOALLV + EL_AVOID_COMPLEX_MPI + EL_USE_BYTE_ALLGATHERS + EL_CACHE_WARNINGS + EL_VECTOR_WARNINGS + + PRINT_EMPTY_VARIABLES + ) + set(__dont_print_summary ON CACHE INTERNAL "" FORCE) + # Only print the configuration on initial configuration +endif () diff --git a/ElementalREADME.md b/ElementalREADME.md new file mode 100644 index 0000000000..570370b917 --- /dev/null +++ b/ElementalREADME.md @@ -0,0 +1,219 @@ +

+ +

+ +[![Build Status](https://api.travis-ci.org/elemental/Elemental.svg?branch=master)](https://travis-ci.org/elemental/Elemental) +[![Join the chat at https://gitter.im/elemental/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/elemental/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) + +**Elemental** is a modern C++ library for distributed-memory dense and +sparse-direct linear algebra, conic optimization, and lattice reduction. +The library was initially released in +[Elemental: A new framework for distributed memory dense linear algebra](https://dl.acm.org/citation.cfm?doid=2427023.2427030) +and absorbed, then greatly expanded upon, the functionality from the +sparse-direct solver [Clique](http://www.github.com/poulson/Clique.git), which +was originally released during a project on [Parallel Sweeping Preconditioners](http://epubs.siam.org/doi/abs/10.1137/120871985). + +### Documentation + +The (now outdated) [documentation for Elemental](http://libelemental.org/documentation) is built using [Sphinx](http://sphinx.pocoo.org) and the [Read the Docs Theme](http://docs.readthedocs.org/en/latest/theme.html) + +### Unique features + +Elemental supports a wide collection of sequential and distributed-memory +functionality, including sequential and distributed-memory support for the +datatypes: + +- `float`, `El::Complex` +- `double`, `El::Complex` +- `El::DoubleDouble`, `El::Complex` (on top of QD's *dd_real*) +- `El::QuadDouble`, `El::Complex` (on top of QD's *qd_real*) +- `El::Quad`, `El::Complex` (on top of GCC's *__float128*) +- `El::BigFloat`, `El::Complex` (on top of MPFR's *mpfr_t* and MPC's *mpc_t*) + +**Linear algebra**: +* Dense and sparse-direct (generalized) Least Squares + problems + - Least Squares / Minimum Length + - Tikhonov (and ridge) regression + - Equality-constrained Least Squares + - General (Gauss-Markov) Linear Models +* High-performance pseudospectral computation and visualization +* Aggressive Early Deflation Schur decompositions (currently sequential only) +* Blocked column-pivoted QR via Johnson-Lindenstrauss +* Quadratic-time low-rank Cholesky and LU modifications +* Bunch-Kaufman and Bunch-Parlett for accurate symmetric + factorization +* LU and Cholesky with full pivoting +* Column-pivoted QR and interpolative/skeleton decompositions +* Quadratically Weighted Dynamic Halley iteration for the polar decomposition +* Many algorithms for Singular-Value soft-Thresholding (SVT) +* Tall-skinny QR decompositions +* Hermitian matrix functions +* Prototype Spectral Divide and Conquer Schur decomposition and Hermitian EVD +* Sign-based Lyapunov/Ricatti/Sylvester solvers +* Arbitrary-precision distributed SVD (QR and D&C support), (generalized) Hermitian EVPs (QR and D&C support), and Schur decompositions (e.g., via Aggressive Early Deflation) + +**Convex optimization**: +* Dense and sparse Interior Point Methods for + Linear, Quadratic, and Second-Order Cone Programs (**Note: Scalability for sparse IPMs will be lacking until more general sparse matrix distributions are introduced into Elemental**) + - Basis Pursuit + - Chebyshev Points + - Dantzig selectors + - LASSO / Basis Pursuit Denoising + - Least Absolute Value regression + - Non-negative Least Squares + - Support Vector Machines + - (1D) Total Variation +* Jordan algebras over products of Second-Order Cones +* Various prototype dense Alternating Direction Method of Multipliers routines + - Sparse inverse covariance selection + - Robust Principal Component Analysis +* Prototype alternating direction Non-negative Matrix Factorization + +**Lattice reduction**: +* An extension of [Householder-based LLL](http://perso.ens-lyon.fr/damien.stehle/HLLL.html) to real and complex linearly-dependent bases (currently sequential only) +* Generalizations of [BKZ 2.0](http://link.springer.com/chapter/10.1007%2F978-3-642-25385-0_1) to complex bases (currently sequential only) + incorporating ["y-sparse" enumeration](https://eprint.iacr.org/2014/980) +* Integer images/kernels and relation-finding (currently sequential only) + +### The current development roadmap + +**Core data structures**: +* (1a) Eliminate `DistMultiVec` in favor of the newly extended `DistMatrix` +* (1b) Extend `DistSparseMatrix` to support elementwise and blockwise 2D distributions + +**Linear algebra**: +* (2a) Distributed iterative refinement tailored to two right-hand sides \[weakly depends on (1a)\] +* (2b) Extend black-box iterative refinement to `DistMatrix` +* (2c) Incorporate iterative refinement into linear solvers via optional control + structure \[weakly depends upon (2b)\] +* (2d) Support for the Fix-Heiberger method for accurate generalized Hermitian-definite EVPs + +**Convex optimization**: +* (3a) Add support for homogeneous self-dual embeddings \[weakly depends on (2a)\] +* (3b) Enhance sparse scalability via low edge-degree plus low-rank + decompositions \[depends on (1b); weakly depends on (1a)\] +* (3c) Distributed sparse semidefinite programs via chordal decompositions \[weakly depends on (3b)\] + +### License + +The vast majority of Elemental is distributed under the terms of the +[New BSD License](http://www.opensource.org/licenses/bsd-license.php). +Please see the [debian/copyright](https://github.com/elemental/Elemental/blob/master/debian/copyright) file for an overview of the copyrights and licenses for +the files in the library. + +The optional external dependency +[METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) +is distributed under the (equally permissive) +[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html), +though +[ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview) +can only be used for research purposes (and can be easily disabled). +[libquadmath](https://gcc.gnu.org/onlinedocs/libquadmath/) is +distributed under the terms of the [GNU Lesser General Public License, version 2.1 or later](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html), +while, +[QD](http://crd-legacy.lbl.gov/~dhbailey/mpdist/) is distributed under the +terms of the [LBNL-BSD-License](http://crd.lbl.gov/~dhbailey/mpdist/LBNL-BSD-License.doc). + +### Dependencies + +**Intranodal linear algebra** + +* [BLAS](http://netlib.org/blas) +* [LAPACK](http://netlib.org/lapack) +* [libflame](http://www.cs.utexas.edu/~flame/web/libFLAME.html) (optional for faster bidiagonal SVDs) +* Elemental is packed with a greatly modified version of the Alternating + Minimum Degree (AMD) reordering and unblocked sparse LDL factorization from + [SuiteSparse](http://faculty.cse.tamu.edu/davis/suitesparse.html) (**Note:** The used portions of SuiteSparse are licensed under the [GNU Lesser General Public License, version 2.1 or later](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)) + +[OpenBLAS](http://www.openblas.net) is automatically downloaded and installed +if no vendor/tuned BLAS/LAPACK is detected. + +**Intranodal graph partitioning** + +* [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) +* [ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview) (**Note:** commercial users must disable this option during configuration) + +If ParMETIS is not disabled and cannot be found (including access to internal APIs), then it is automatically downloaded and installed; +otherwise, if METIS support is not detected, METIS is downloaded and installed. + +**Internodal linear algebra** + +* [Parallel MRRR](https://code.google.com/p/pmrrr/) (packaged with Elemental) +* [ScaLAPACK](http://netlib.org/scalapack) (optional for benchmarking) + +If [ScaLAPACK](http://www.netlib.org/scalapack) support is not explicitly +disabled, then Elemental looks for a previous installation and, failing that, +attempts to automatically download and install the library. + +**Internodal communication** + +* MPI2 (typically [MPICH](http://www.mpich.org/), [MVAPICH](http://mvapich.cse.ohio-state.edu/), or [OpenMPI](http://www.open-mpi.org/)) + +**Auxiliary libraries** + +* [QD](http://crd-legacy.lbl.gov/~dhbailey/mpdist/) for efficient software analogues of 128-bit and 256-bit floating-point arithmetic (**Note:** QD is licensed under the [LBNL-BSD-License](http://crd.lbl.gov/~dhbailey/mpdist/LBNL-BSD-License.doc), which is a slight modification of the BSD License) + +* [libquadmath](https://gcc.gnu.org/onlinedocs/libquadmath/) for quad-precision support (especially for iterative refinement). (**Note:** libquadmath is licensed under the [GNU Lesser General Public License, version 2.1 or later](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)) + +* [MPFR](http://www.mpfr.org/) for arbitrary-precision real arithmetic. (**Note:** MPFR is licensed under the [GNU Lesser General Public License, v3 or later](http://www.gnu.org/copyleft/lesser.html)) + +* [MPC](http://www.multiprecision.org/index.php?prog=mpc) for arbitrary-precision complex arithmetic. (**Note:** MPC is licensed under the [GNU Lesser General Public License, v3 or later](http://www.gnu.org/copyleft/lesser.html)) + +**Python interface** + +* [matplotlib](http://matplotlib.org/) (optional for Python matrix visualization) +* [NetworkX](https://networkx.github.io/) (optional for Python graph visualization) +* [NumPy](http://www.numpy.org/) + +**C++ visualization** + +* [Qt5](http://qt-project.org/qt5) (optional for visualization from C++) + +**Build system** + +* [CMake >= 2.8.12](http://www.cmake.org/) + +### Third-party interfaces + +In addition to the C++11, C, and Python interfaces included within the project, +three external interfaces are currently being externally developed: + +* [R-El](https://github.com/rocanale/R-Elemental) is an [R](http://www.r-project.org) interface to Elemental developed by [Rodrigo Canales](https://github.com/rocanale) and [Paolo Bientinesi](http://hpac.rwth-aachen.de/~pauldj/) + +* [Elemental.jl](https://github.com/JuliaParallel/Elemental.jl) is an (in-progress) [Julia](http://julialang.org) interface to Elemental being developed by [Jake Bolewski](https://github.com/jakebolewski), [Jiahao Chen](https://jiahao.github.io), and [Andreas Noack](http://andreasnoack.github.io/academiccv.html). + +* [CVXPY](https://github.com/cvxgrp/cvxpy) is a Python-embedded modeling language for convex optimization problems with an (in-progress) interface to Elemental's distributed Interior Point Methods. This effort is being led by [Steven Diamond](http://web.stanford.edu/~stevend2/). + +### Related open-source projects + +**Distributed dense linear algebra**: + +* [ELPA](http://elpa.rzg.mpg.de) +* [CANDMC](https://github.com/solomonik/CANDMC) +* [PaRSEC/DPLASMA](http://icl.eecs.utk.edu/projectsdev/parsec/index.html) +* [PLAPACK](http://www.cs.utexas.edu/~plapack) +* [ScaLAPACK](http://www.netlib.org/scalapack) + +**Distributed sparse-direct linear algebra**: + +* [DSCPACK](http://www.cse.psu.edu/~raghavan/Dscpack/) +* [MUMPS](http://mumps.enseeiht.fr/) +* [SuperLU](http://crd-legacy.lbl.gov/~xiaoye/SuperLU/) + +**Distributed linear algebra Frameworks** + +* [PETSc](https://www.mcs.anl.gov/petsc/) +* [Trilinos](http://trilinos.sandia.gov) + +**Convex optimization** + +* [CVXOPT](http://cvxopt.org/) +* [ECOS](https://github.com/embotech/ecos) +* [L1-MAGIC](http://users.ece.gatech.edu/~justin/l1magic/) +* [SDPA](http://sdpa.sourceforge.net/index.html) + +**Lattice reduction and number theory** + +* [FPLLL](https://github.com/dstehle/fplll) +* [NTL](http://www.shoup.net/ntl/) diff --git a/Hydrogen_ReleaseNotes.txt b/Hydrogen_ReleaseNotes.txt new file mode 100644 index 0000000000..d0402471a2 --- /dev/null +++ b/Hydrogen_ReleaseNotes.txt @@ -0,0 +1,27 @@ +Notes for v1.1.0: + +- Miscellaneous bug fixes. +- Add profiling interface for VTune and NVProf. +- Add half-precision support for the the CPU. GPU support is still + work in progress. + +Notes for v1.0.1: + +- Significant tidying of build system + +- Added range-based version checking in CMake export + +- Added full Aluminum support for all collectives: AllGather, + AllReduce, AllToAll, Broadcast, Gather, Reduce, ReduceScatter, + and Scatter (and SendRecv). + +Notes for v1.0: + +- Added the notion of multiple "Devices" for matrices. + +- Added GPU support throughout the library. Support is still "as + needed". Please report gaps to Tom Benson31. + +- Using distributed objects with GPU memory requires CUDA-aware MPI. + +- Added preliminary Aluminum integration (https://github.com/llnl/aluminum). diff --git a/README.md b/README.md index ddd15f069c..bff13c5dc7 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,33 @@ +<<<<<<< HEAD +# Hydrogen +=======

+>>>>>>> 6eb15a0da (Update README.md) + +Hydrogen is a fork of +[Elemental](https://github.com/elemental/elemental) used by +[LBANN](https://github.com/llnl/lbann). Hydrogen is a redux of the +Elemental functionality that has been ported to make use of GPGPU +accelerators. The supported functionality is essentially the core +infrastructure plus BLAS-1 and BLAS-3. + +## Building + +<<<<<<< HEAD +Hydrogen builds with a [CMake](https://cmake.org) (version 3.9.0 or +newer) build system. The build system respects the "normal" CMake +variables (`CMAKE_CXX_COMPILER`, `CMAKE_INSTALL_PREFIX`, +`CMAKE_BUILD_TYPE`, etc) in addition to the [Hydrogen-specific options +documented below](#hydrogen-cmake-options). +======= +### Deprecation notice +Elemental has not been maintained since 2016. But the project was [forked by Lawrence Livermore National Lab](https://github.com/LLNL/Elemental). The author stopped being interested in volunteering to develop MPI codes and no one has stepped up after three years. -[![Build Status](https://api.travis-ci.org/elemental/Elemental.svg?branch=master)](https://travis-ci.org/elemental/Elemental) -[![Join the chat at https://gitter.im/elemental/chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/elemental/chat?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +**Software consists of teams of people. If you want people to continue developing a project after it ceases to be their personal interest, fund them for it.** -**Elemental** is a modern C++ library for distributed-memory dense and -sparse-direct linear algebra, conic optimization, and lattice reduction. -The library was initially released in -[Elemental: A new framework for distributed memory dense linear algebra](https://dl.acm.org/citation.cfm?doid=2427023.2427030) -and absorbed, then greatly expanded upon, the functionality from the -sparse-direct solver [Clique](http://www.github.com/poulson/Clique.git), which -was originally released during a project on [Parallel Sweeping Preconditioners](http://epubs.siam.org/doi/abs/10.1137/120871985). +The developer is now volunteering time towards high-performance math software for workstations at [hodgestar.com](https://hodgestar.com). ### Deprecation notice Elemental has not been maintained since 2016. But the project was [forked by Lawrence Livermore National Lab](https://github.com/LLNL/Elemental). The author stopped being interested in volunteering to develop MPI codes and no one has stepped up after three years. @@ -121,106 +137,169 @@ distributed under the terms of the [GNU Lesser General Public License, version 2 while, [QD](http://crd-legacy.lbl.gov/~dhbailey/mpdist/) is distributed under the terms of the [LBNL-BSD-License](http://crd.lbl.gov/~dhbailey/mpdist/LBNL-BSD-License.doc). +>>>>>>> 6eb15a0da (Update README.md) ### Dependencies -**Intranodal linear algebra** +The most basic build of Hydrogen requires only: + ++ [CMake](https://cmake.org): Version 3.9.0 or newer. + ++ A C++11-compliant compiler. + ++ MPI 3.0-compliant MPI library. + ++ [BLAS](http://www.netlib.org/blas/): Provides basic linear + algebra kernels for the CPU code path. + ++ [LAPACK](http://www.netlib.org/lapack/): Provides a few utility + functions (norms and 2D copies, e.g.). This could be demoted to + "optional" status with little effort. + +Optional dependencies of Hydrogen include: + ++ [Aluminum](https://github.com/llnl/aluminum): Provides asynchronous + blocking and non-blocking communication routines with an MPI-like + syntax. The use of Aluminum is **highly** recommended. + ++ [CUDA](https://developer.nvidia.com/cuda-zone): Version 9.2 or + newer. Hydrogen primarily uses the runtime API and also grabs some + features of NVML and NVPROF (if enabled). -* [BLAS](http://netlib.org/blas) -* [LAPACK](http://netlib.org/lapack) -* [libflame](http://www.cs.utexas.edu/~flame/web/libFLAME.html) (optional for faster bidiagonal SVDs) -* Elemental is packed with a greatly modified version of the Alternating - Minimum Degree (AMD) reordering and unblocked sparse LDL factorization from - [SuiteSparse](http://faculty.cse.tamu.edu/davis/suitesparse.html) (**Note:** The used portions of SuiteSparse are licensed under the [GNU Lesser General Public License, version 2.1 or later](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)) ++ [CUB](https://github.com/nvlabs/cub): Version 1.8.0 is + recommended. This will become required for CUDA-enabled builds in + the very near future. -[OpenBLAS](http://www.openblas.net) is automatically downloaded and installed -if no vendor/tuned BLAS/LAPACK is detected. ++ [Half](https://half.sourceforge.net): Provides support for IEEE-754 + 16-bit precision support. (*Note*: This is work in progress.) -**Intranodal graph partitioning** ++ [OpenMP](https://www.openmp.org): OpenMP 3.0 is probably sufficient + for the limited use of the features in Hydrogen. -* [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/overview) -* [ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview) (**Note:** commercial users must disable this option during configuration) ++ [VTune](https://software.intel.com/en-us/vtune): Proprietary + profiler from Intel. May provide more detailed annotations to + profiles of Hydrogen CPU code. -If ParMETIS is not disabled and cannot be found (including access to internal APIs), then it is automatically downloaded and installed; -otherwise, if METIS support is not detected, METIS is downloaded and installed. +### Hydrogen CMake options -**Internodal linear algebra** +Some of the options are inherited from Elemental with `EL_` replaced +by `Hydrogen_`. Others are unique to Hydrogen. Supported options are: -* [Parallel MRRR](https://code.google.com/p/pmrrr/) (packaged with Elemental) -* [ScaLAPACK](http://netlib.org/scalapack) (optional for benchmarking) ++ `Hydrogen_AVOID_CUDA_AWARE_MPI` (Default: `OFF`): There is a very + small amount of logic to try to detect CUDA-aware MPI (it should not + give a false-positive but is likey to give a false negative). This + option causes the library to ignore this and assume the MPI library + is not CUDA-aware. -If [ScaLAPACK](http://www.netlib.org/scalapack) support is not explicitly -disabled, then Elemental looks for a previous installation and, failing that, -attempts to automatically download and install the library. ++ `Hydrogen_ENABLE_ALUMINUM` (Default: `OFF`): Enable the + [Aluminum](https://github.com/llnl/aluminum) library for + asynchronous device-aware communication. The use of this library is + **highly** recommended for CUDA-enabled builds. -**Internodal communication** ++ `Hydrogen_ENABLE_CUDA` (Default: `OFF`): Enable CUDA support in the + library. This enables the device type `El::Device::GPU` and allows + memory to reside on CUDA-aware GPGPUs. -* MPI2 (typically [MPICH](http://www.mpich.org/), [MVAPICH](http://mvapich.cse.ohio-state.edu/), or [OpenMPI](http://www.open-mpi.org/)) ++ `Hydrogen_ENABLE_CUB` (Default: `Hydrogen_ENABLE_CUDA`): Only + available if CUDA is enabled. This enables device memory management + through a memory pool using [CUB](https://github.com/nvlabs/cub). -**Auxiliary libraries** ++ `Hydrogen_ENABLE_HALF` (Default: `OFF`): Enable IEEE-754 "binary16" + 16-bit precision floating point support through the [Half + library](https://half.sourceforge.net). -* [QD](http://crd-legacy.lbl.gov/~dhbailey/mpdist/) for efficient software analogues of 128-bit and 256-bit floating-point arithmetic (**Note:** QD is licensed under the [LBNL-BSD-License](http://crd.lbl.gov/~dhbailey/mpdist/LBNL-BSD-License.doc), which is a slight modification of the BSD License) ++ `Hydrogen_ENABLE_BFLOAT16` (Default: `OFF`): This option is a + placeholder. This will enable support for "bfloat16" 16-bit + precision floating point arithmetic if/when that becomes a thing. -* [libquadmath](https://gcc.gnu.org/onlinedocs/libquadmath/) for quad-precision support (especially for iterative refinement). (**Note:** libquadmath is licensed under the [GNU Lesser General Public License, version 2.1 or later](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)) ++ `Hydrogen_USE_64BIT_INTS` (Default: `OFF`): Use `long` as the + default signed integer type within Hydrogen. -* [MPFR](http://www.mpfr.org/) for arbitrary-precision real arithmetic. (**Note:** MPFR is licensed under the [GNU Lesser General Public License, v3 or later](http://www.gnu.org/copyleft/lesser.html)) ++ `Hydrogen_USE_64BIT_BLAS_INTS` (Default: `OFF`): Use `long` as the + default signed integer type for interacting with BLAS libraries. -* [MPC](http://www.multiprecision.org/index.php?prog=mpc) for arbitrary-precision complex arithmetic. (**Note:** MPC is licensed under the [GNU Lesser General Public License, v3 or later](http://www.gnu.org/copyleft/lesser.html)) ++ `Hydrogen_ENABLE_TESTING` (Default: `ON`): Build the test suite. -**Python interface** ++ `Hydrogen_ZERO_INIT` (Default: `OFF`): Initialize buffers to zero by + default. There will obviously be a compute-time overhead. -* [matplotlib](http://matplotlib.org/) (optional for Python matrix visualization) -* [NetworkX](https://networkx.github.io/) (optional for Python graph visualization) -* [NumPy](http://www.numpy.org/) ++ `Hydrogen_ENABLE_NVPROF` (Default: `OFF`): Enable library + annotations using the `nvtx` interface in CUDA. -**C++ visualization** ++ `Hydrogen_ENABLE_VTUNE` (Default: `OFF`): Enable library annotations + for use with Intel's VTune performance profiler. -* [Qt5](http://qt-project.org/qt5) (optional for visualization from C++) ++ `Hydrogen_ENABLE_SYNCHRONOUS_PROFILING` (Default: `OFF`): + Synchronize computation at the beginning of profiling regions. -**Build system** ++ `Hydrogen_ENABLE_OPENMP` (Default: `OFF`): Enable OpenMP on-node + parallelization primatives. OpenMP is used for CPU parallelization + only; the device offload features of modern OpenMP are not used. -* [CMake >= 2.8.12](http://www.cmake.org/) ++ `Hydrogen_ENABLE_OMP_TASKLOOP` (Default: `OFF`): Use `omp taskloop` + instead of `omp parallel for`. This is a highly experimental + feature. Use with caution. -### Third-party interfaces +The following options are legacy options inherited from Elemental. The +related functionality is not tested regularly. The likely implication +of this statement is that nothing specific to this option has been +removed from what remains of Elemental but also that nothing specific +to these options has been added to any of the new features of +Hydrogen. -In addition to the C++11, C, and Python interfaces included within the project, -three external interfaces are currently being externally developed: ++ `Hydrogen_ENABLE_VALGRIND` (Default: `OFF`): Search for `valgrind` + and enable related features if found. -* [R-El](https://github.com/rocanale/R-Elemental) is an [R](http://www.r-project.org) interface to Elemental developed by [Rodrigo Canales](https://github.com/rocanale) and [Paolo Bientinesi](http://hpac.rwth-aachen.de/~pauldj/) ++ `Hydrogen_ENABLE_QUADMATH` (Default: `OFF`): Search for the `quadmath` + library and enable related features if found. This is for + extended-precision computations. -* [Elemental.jl](https://github.com/JuliaParallel/Elemental.jl) is an (in-progress) [Julia](http://julialang.org) interface to Elemental being developed by [Jake Bolewski](https://github.com/jakebolewski), [Jiahao Chen](https://jiahao.github.io), and [Andreas Noack](http://andreasnoack.github.io/academiccv.html). ++ `Hydrogen_ENABLE_QD` (Default: `OFF`): Search for the `QD` library + and enable related features if found. This is for extended-precision + computations. -* [CVXPY](https://github.com/cvxgrp/cvxpy) is a Python-embedded modeling language for convex optimization problems with an (in-progress) interface to Elemental's distributed Interior Point Methods. This effort is being led by [Steven Diamond](http://web.stanford.edu/~stevend2/). ++ `Hydrogen_ENABLE_MPC` (Default: `OFF`): Search for the GNU MPC + library (requires MPFR and GMP as well) and enable related features + if found. This is for extended precision. -### Related open-source projects ++ `Hydrogen_USE_CUSTOM_ALLTOALLV` (Default: `OFF`): Avoid + MPI_Alltoallv for performance reasons. -**Distributed dense linear algebra**: ++ `Hydrogen_AVOID_COMPLEX_MPI` (Default: `OFF`): Avoid potentially + buggy complex MPI routines. -* [ELPA](http://elpa.rzg.mpg.de) -* [CANDMC](https://github.com/solomonik/CANDMC) -* [PaRSEC/DPLASMA](http://icl.eecs.utk.edu/projectsdev/parsec/index.html) -* [PLAPACK](http://www.cs.utexas.edu/~plapack) -* [ScaLAPACK](http://www.netlib.org/scalapack) ++ `Hydrogen_USE_BYTE_ALLGATHERS` (Default: `OFF`): Avoid BG/P + allgather performance bug. -**Distributed sparse-direct linear algebra**: ++ `Hydrogen_CACHE_WARNINGS` (Default: `OFF`): Warns when using + cache-unfriendly routines. -* [DSCPACK](http://www.cse.psu.edu/~raghavan/Dscpack/) -* [MUMPS](http://mumps.enseeiht.fr/) -* [SuperLU](http://crd-legacy.lbl.gov/~xiaoye/SuperLU/) ++ `Hydrogen_UNALIGNED_WARNINGS` (Default: `OFF`): Warn when performing + unaligned redistributions. -**Distributed linear algebra Frameworks** ++ `Hydrogen_VECTOR_WARNINGS` (Default: `OFF`): Warn when vector + redistribution chances are missed. -* [PETSc](https://www.mcs.anl.gov/petsc/) -* [Trilinos](http://trilinos.sandia.gov) +### Example CMake invocation -**Convex optimization** +The following builds a CUDA-enabled, CUB-enabled, Aluminum-enabled +version of Hydrogen: -* [CVXOPT](http://cvxopt.org/) -* [ECOS](https://github.com/embotech/ecos) -* [L1-MAGIC](http://users.ece.gatech.edu/~justin/l1magic/) -* [SDPA](http://sdpa.sourceforge.net/index.html) +```bash + cmake -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_PREFIX=/path/to/my/install \ + -DHydrogen_ENABLE_CUDA=ON \ + -DHydrogen_ENABLE_CUB=ON \ + -DHydrogen_ENABLE_ALUMINUM=ON \ + -DCUB_DIR=/path/to/cub \ + -DAluminum_DIR=/path/to/aluminum \ + /path/to/hydrogen + ninja install +``` -**Lattice reduction and number theory** +## Reporting issues -* [FPLLL](https://github.com/dstehle/fplll) -* [NTL](http://www.shoup.net/ntl/) +Issues should be reported [on +Github](https://github.com/llnl/elemental/issues/new). diff --git a/cmake/CreateElVars.cmake b/cmake/CreateElVars.cmake deleted file mode 100644 index 38b161e70e..0000000000 --- a/cmake/CreateElVars.cmake +++ /dev/null @@ -1,42 +0,0 @@ - -function(MakeString ITEMS ITEMSTRING) - set(${ITEMSTRING}) - foreach(ITEM ${${ITEMS}}) - set(${ITEMSTRING} "${${ITEMSTRING}} ${ITEM}") - endforeach() - set(${ITEMSTRING} ${${ITEMSTRING}} PARENT_SCOPE) -endfunction() - -function(MakeLibString LIBS LIBSTRING) - MakeString(${LIBS} ${LIBSTRING}) - set(${LIBSTRING} ${${LIBSTRING}} PARENT_SCOPE) -endfunction() - -function(MakeIncString INCPATHS INCSTRING) - set(${INCSTRING} PARENT_SCOPE) - foreach(INCPATH ${${INCPATHS}}) - set(${INCSTRING} "${${INCSTRING}} -I${INCPATH}") - endforeach() - set(${INCSTRING} ${${INCSTRING}} PARENT_SCOPE) -endfunction() - -MakeLibString(MATH_LIBS MATH_LIBSTRING) -MakeIncString(MPI_CXX_INCLUDE_PATH MPI_CXX_INCSTRING) -MakeLibString(MPI_CXX_LIBRARIES MPI_CXX_LIBSTRING) -MakeLibString(EXTERNAL_LIBS EXTERNAL_LIBSTRING) - -MakeIncString(QD_INCLUDES QD_INCSTRING) -MakeIncString(MPC_INCLUDES MPC_INCSTRING) -MakeIncString(MPFR_INCLUDES MPFR_INCSTRING) -MakeIncString(GMP_INCLUDES GMP_INCSTRING) -MakeIncString(EXTERNAL_INCLUDE_DIRS EXTERNAL_INCSTRING) - -MakeString(Qt5Widgets_DEFINITIONS QT5_DEFSTRING) -MakeIncString(Qt5Widgets_INCLUDE_DIRS QT5_INCSTRING) -MakeString(Qt5Widgets_EXECUTABLE_COMPILE_FLAGS QT5_COMPILESTRING) - -# TODO: Generalize this for non-Unix architectures -set(QT5_LIBSTRING "-L${Qt5_LIBDIR} -lQt5Widgets -lQt5Gui -lQt5Core") -configure_file(${PROJECT_SOURCE_DIR}/cmake/configure_files/ElVars.in - ${PROJECT_BINARY_DIR}/conf/ElVars @ONLY) -install(FILES ${PROJECT_BINARY_DIR}/conf/ElVars DESTINATION conf) diff --git a/cmake/configure_files/ElVars.in b/cmake/configure_files/ElVars.in deleted file mode 100644 index 7cd6aeb658..0000000000 --- a/cmake/configure_files/ElVars.in +++ /dev/null @@ -1,30 +0,0 @@ -# To help simplify including Elemental in external projects - -EL_INC = @CMAKE_INSTALL_PREFIX@/include -EL_LIB = @CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ - -CC = @CMAKE_C_COMPILER@ -CXX = @CMAKE_CXX_COMPILER@ - -EL_LINK_FLAGS = -L${EL_LIB} @EL_LINK_FLAGS@ - -ALL_MATH_INC = -I${EL_INC} -ALL_MATH_LIBS = -lEl -lpmrrr -lElSuiteSparse @CMAKE_THREAD_LIBS_INIT@ \ - @MATH_LIBSTRING@ @EXTERNAL_LIBSTRING@ -ALL_MPI_FLAGS = @MPI_CXX_INCSTRING@ @MPI_CXX_COMPILE_FLAGS@ -ifeq (@EL_HAVE_QD@,TRUE) - ALL_MATH_INC := ${ALL_MATH_INC} @QD_INCSTRING@ -endif -ifeq (@EL_HAVE_MPC@,TRUE) - ALL_MATH_INC := ${ALL_MATH_INC} \ - @MPC_INCSTRING@ @MPFR_INCSTRING@ @GMP_INCSTRING@ -endif - -EL_COMPILE_FLAGS = @CXX_FLAGS@ ${ALL_MATH_INC} ${ALL_MPI_FLAGS} -EL_LIBS = ${ALL_MATH_LIBS} @MPI_CXX_LIBSTRING@ - -ifeq (@EL_HAVE_QT5@,TRUE) - EL_COMPILE_FLAGS := ${EL_COMPILE_FLAGS} \ - @QT5_COMPILESTRING@ @QT5_INCSTRING@ @QT5_DEFSTRING@ - EL_LIBS := ${EL_LIBS} @QT5_LIBSTRING@ -endif diff --git a/cmake/configure_files/ElementalConfig.cmake.in b/cmake/configure_files/ElementalConfig.cmake.in deleted file mode 100644 index 8b46665339..0000000000 --- a/cmake/configure_files/ElementalConfig.cmake.in +++ /dev/null @@ -1,22 +0,0 @@ -set(Elemental_INCLUDE_DIRS "@CMAKE_INSTALL_PREFIX@/include") -set(Elemental_INCLUDE_DIRS "${Elemental_INCLUDE_DIRS};@MPI_CXX_INCLUDE_PATH@") -IF(@QD_FOUND@) - set(Elemental_INCLUDE_DIRS "${Elemental_INCLUDE_DIRS};@QD_INCLUDES@") -ENDIF() -IF(@MPC_FOUND@) - set(Elemental_INCLUDE_DIRS "${Elemental_INCLUDE_DIRS};@MPC_INCLUDES@") - set(Elemental_INCLUDE_DIRS "${Elemental_INCLUDE_DIRS};@MPFR_INCLUDES@") - set(Elemental_INCLUDE_DIRS "${Elemental_INCLUDE_DIRS};@GMP_INCLUDES@") -ENDIF() -set(Elemental_INCLUDE_DIRS - "${Elemental_INCLUDE_DIRS};@Qt5Widgets_INCLUDE_DIRS@") - -set(Elemental_COMPILE_FLAGS "@CXX_FLAGS@") -set(Elemental_LINK_FLAGS "@EL_LINK_FLAGS@") - -set(Elemental_DEFINITIONS "@Qt5Widgets_DEFINITIONS@") - -# Our library dependencies (contains definitions for IMPORTED targets) -include("${CMAKE_CURRENT_LIST_DIR}/ElementalTargets.cmake") - -set(Elemental_LIBRARIES El) diff --git a/cmake/configure_files/ElementalConfigVersion.cmake.in b/cmake/configure_files/ElementalConfigVersion.cmake.in deleted file mode 100644 index 44bccaab39..0000000000 --- a/cmake/configure_files/ElementalConfigVersion.cmake.in +++ /dev/null @@ -1,11 +0,0 @@ -set(PACKAGE_VERSION "@EL_VERSION@") - -# Check whether the requested PACKAGE_FIND_VERSION is compatible -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() diff --git a/cmake/configure_files/HydrogenConfig.cmake.in b/cmake/configure_files/HydrogenConfig.cmake.in new file mode 100644 index 0000000000..8127f803ec --- /dev/null +++ b/cmake/configure_files/HydrogenConfig.cmake.in @@ -0,0 +1,217 @@ +# This will create the H::hydrogen IMPORTED target. It will also +# export many useful variables that one may want. + +include(CMakeFindDependencyMacro) +include(CheckCompilerFlag) +include("${CMAKE_CURRENT_LIST_DIR}/HydrogenConfigVersion.cmake") + +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules") +list(APPEND CMAKE_MODULE_PATH "@EXTRA_CMAKE_MODULE_DIR@") + +set(HYDROGEN_VERSION ${PACKAGE_VERSION}) + +set(HYDROGEN_CXX_COMPILER "@CMAKE_CXX_COMPILER@") +set(HYDROGEN_CXX_FLAGS "@CMAKE_CXX_FLAGS@") +set(HYDROGEN_MPI_CXX_COMPILER "@MPI_CXX_COMPILER@") + +# FIXME (trb 01/08/2022): The FindAndVerify* modules may not be +# suitable for dealing with exports. We should consider refactoring +# this to be consistent with CMake's ideology re: transitive +# dependency resolution. However, this is separate from the +# CUDA/ROCm-related issues I'm handling at the moment. + +# Note: Setting things in the cache doesn't change anything if the +# cache variable is already set. +set(MPI_CXX_COMPILER "${HYDROGEN_MPI_CXX_COMPILER}" + CACHE FILEPATH "The MPI CXX compiler.") + +set(_HYDROGEN_HAVE_OPENMP @EL_HAVE_OPENMP@) +if (_HYDROGEN_HAVE_OPENMP) + set(_OpenMP_DIR "@OpenMP_DIR@") + if (NOT OpenMP_DIR) + set(OpenMP_DIR "${_OpenMP_DIR}") + endif () + include (FindAndVerifyOpenMP) +endif (_HYDROGEN_HAVE_OPENMP) +# FIXME: I should do verification to make sure all found features are +# the same. +include (FindAndVerifyMPI) + +# Aluminum +set(_HYDROGEN_HAVE_ALUMINUM @HYDROGEN_HAVE_ALUMINUM@) +set(_HYDROGEN_HAVE_NCCL2 @HYDROGEN_HAVE_NCCL2@) +set(_HYDROGEN_HAVE_AL_MPI_CUDA @HYDROGEN_HAVE_AL_MPI_CUDA@) +set(_HYDROGEN_HAVE_AL_HOST_XFER @HYDROGEN_HAVE_AL_HOST_XFER@) +if (_HYDROGEN_HAVE_ALUMINUM) + set(_HYDROGEN_MIN_AL_VERSION @ALUMINUM_VERSION@) + find_dependency(Aluminum "${HYDROGEN_MIN_AL_VERSION}") + + # This makes the assumption that there are no inter-backend + # dependencies among the "device backends" (i.e., any backend is + # allowed to depend on MPI, which is always available, but no + # backend should depend on any of the other backends). This checks + # that AT LEAST the backend set available when building Hydrogen is + # available now. + if (_HYDROGEN_HAVE_NCCL2 AND NOT AL_HAS_NCCL) + set(Hydrogen_NOT_FOUND_MESSAGE + "Hydrogen expects NCCL2 support " + "but found Aluminum does not have NCCL2 support.") + set(Hydrogen_FOUND FALSE) + endif () + if (_HYDROGEN_HAVE_AL_HOST_XFER AND NOT AL_HAS_HOST_TRANSFER) + set(Hydrogen_NOT_FOUND_MESSAGE + "Hydrogen expects HostTransfer support " + "but Aluminum does not have HostTransfer support.") + set(Hydrogen_FOUND FALSE) + endif () + if (_HYDROGEN_HAVE_AL_MPI_CUDA AND NOT AL_HAS_MPI_CUDA) + set(Hydrogen_NOT_FOUND_MESSAGE + "Hydrogen expects MPI-CUDA support " + "but Aluminum does not have MPI-CUDA support.") + set(Hydrogen_FOUND FALSE) + endif () +endif (_HYDROGEN_HAVE_ALUMINUM) + +# CUDA! +set(_HYDROGEN_HAVE_CUDA @HYDROGEN_HAVE_CUDA@) +set(_HYDROGEN_HAVE_CUB @HYDROGEN_HAVE_CUB@) +if (_HYDROGEN_HAVE_CUDA) + set(_HYDROGEN_EXTERNAL_CUB @H_EXTERNAL_CUB@) + set(_HYDROGEN_EXTERNAL_NVTX @H_EXTERNAL_NVTX@) + + find_dependency(CUDAToolkit) + + if (_HYDROGEN_EXTERNAL_CUB) + find_dependency(CUB MODULE) + endif () + + if (_HYDROGEN_EXTERNAL_NVTX) + find_dependency(NVTX MODULE) + endif () +endif () + +set(_HYDROGEN_HAVE_ROCM @HYDROGEN_HAVE_ROCM@) +if (_HYDROGEN_HAVE_ROCM) + + find_dependency(hip CONFIG) + + if (_HYDROGEN_HAVE_CUB) + find_dependency(hipcub) + set(HYDROGEN_HAVE_CUB TRUE) + else () + set(HYDROGEN_HAVE_CUB FALSE) + endif () + + find_dependency(rocblas CONFIG) + find_dependency(rocsolver CONFIG) + find_dependency(rocthrust CONFIG) + set(HYDROGEN_HAVE_ROCM TRUE) +endif (_HYDROGEN_HAVE_ROCM) + +set(HYDROGEN_HAVE_HALF @HYDROGEN_HAVE_HALF@) +if (HYDROGEN_HAVE_HALF) + find_dependency(HALF) +endif () + +if (_HYDROGEN_HAVE_CUDA) + set(HYDROGEN_GPU_USE_FP16 @HYDROGEN_GPU_USE_FP16@) +endif () + +# Math libraries +set(_HYDROGEN_HAVE_QUADMATH "@HYDROGEN_HAVE_QUADMATH@") +set(_HYDROGEN_HAVE_QD "@HYDROGEN_HAVE_QD@") +set(_HYDROGEN_HAVE_MPC "@HYDROGEN_HAVE_MPC@") +set(_HYDROGEN_HAVE_MKL "@HYDROGEN_HAVE_MKL@") +set(_HYDROGEN_HAVE_MKL_GEMMT "@HYDROGEN_HAVE_MKL_GEMMT@") + +# Quadmath +if (_HYDROGEN_HAVE_QUADMATH) + set(${PROJECT_NAME}_ENABLE_QUADMATH TRUE) + if (NOT QUADMATH_LIBRARY) + set(QUADMATH_LIBRARY "@QUADMATH_LIBRARY@") + endif () + if (NOT QUADMATH_INCLUDE_DIR) + set(QUADMATH_INCLUDE_DIR "@QUADMATH_INCLUDE_DIR@") + endif () +endif () + +# QD +if (_HYDROGEN_HAVE_QD) + set(${PROJECT_NAME}_ENABLE_QUADMATH TRUE) + if (NOT QD_LIBRARY) + set(QD_LIBRARY "@QD_LIBRARY@") + endif () + if (NOT QD_INCLUDE_DIR) + set(QD_INCLUDE_DIR "@QD_INCLUDE_DIR@") + endif () +endif () + +# MPC +if (_HYDROGEN_HAVE_MPC) + set(${PROJECT_NAME}_ENABLE_MPC TRUE) + if (NOT GMP_LIBRARY) + set(GMP_LIBRARY "@GMP_LIBRARY@" CACHE FILEPATH "The GMP library" FORCE) + endif () + if (NOT MPFR_LIBRARY) + set(MPFR_LIBRARY "@MPFR_LIBRARY@" CACHE FILEPATH "The MPFR library" FORCE) + endif () + if (NOT MPC_LIBRARY) + set(MPC_LIBRARY "@MPC_LIBRARY@" CACHE FILEPATH "The MPC library" FORCE) + endif () + if (NOT GMP_INCLUDE_DIR) + set(GMP_INCLUDE_DIR "@GMP_INCLUDE_DIR@" + CACHE FILEPATH "The GMP include directory" FORCE) + endif () + if (NOT MPFR_INCLUDE_DIR) + set(MPFR_INCLUDE_DIR "@MPFR_INCLUDE_DIR@" + CACHE FILEPATH "The MPFR include directory" FORCE) + endif () + if (NOT MPC_INCLUDE_DIR) + set(MPC_INCLUDE_DIR "@MPC_INCLUDE_DIR@" + CACHE FILEPATH "The MPC include directory" FORCE) + endif () +endif (_HYDROGEN_HAVE_MPC) + +include("FindAndVerifyExtendedPrecision") + +# LAPACK +set(_HYDROGEN_HAVE_OPENBLAS @HYDROGEN_HAVE_OPENBLAS@) +if (_HYDROGEN_HAVE_OPENBLAS) + set(BLAS_openblas_LIBRARY "@BLAS_openblas_LIBRARY@" + CACHE PATH "Path to a library") + set(LAPACK_openblas_LIBRARY "@LAPACK_openblas_LIBRARY@" + CACHE PATH "Path to a library") + set(BLA_VENDOR "OpenBLAS") +endif () + +include("FindAndVerifyLAPACK") + +@PACKAGE_INIT@ + +# Now actually import the Hydrogen target +set(_TMP_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIRS@") +foreach (_DIR ${_TMP_INCLUDE_DIRS}) + set_and_check(_INCLUDE_DIR "${_DIR}") + list(APPEND HYDROGEN_INCLUDE_DIRS "${_INCLUDE_DIR}") +endforeach (_DIR "${_TMP_INCLUDE_DIRS}") + +set(_TMP_LIBRARY_DIRS "@PACKAGE_LIB_INSTALL_DIR@") +foreach (_DIR ${_TMP_LIBRARY_DIRS}) + set_and_check(_LIBRARY_DIR "${_DIR}") + list(APPEND HYDROGEN_LIBRARY_DIRS "${_LIBRARY_DIR}") +endforeach (_DIR ${_TMP_LIBRARY_DIRS}) + +if (NOT TARGET H::Hydrogen) + include(${CMAKE_CURRENT_LIST_DIR}/HydrogenTargets.cmake) + + add_library(H::Hydrogen IMPORTED INTERFACE) + target_link_libraries(H::Hydrogen INTERFACE H::Hydrogen_CXX + $ + $ + ) +endif (NOT TARGET H::Hydrogen) + +check_required_components(Hydrogen) + +set(HYDROGEN_LIBRARIES H::Hydrogen) diff --git a/cmake/configure_files/HydrogenConfigVersion.cmake.in b/cmake/configure_files/HydrogenConfigVersion.cmake.in new file mode 100644 index 0000000000..35981ebf47 --- /dev/null +++ b/cmake/configure_files/HydrogenConfigVersion.cmake.in @@ -0,0 +1,88 @@ +# This verifies that the Hydrogen version falls within a compatible +# version range. Unfortunately, the versioning system is not entirely +# setup to do this implicitly. Consider this the explicit +# documentation. Compatible ranges are: +# +# [0.0.0 0.87) +# [0.87 1.0.0) +# [1.0.0 1.1.0) +# [1.1.0 1.2.0) +# [1.2.0 1.3.0) +# [1.3.0 1.4.0) +# [1.4.0 1.5.0) +# [1.5.0 ???) +# +# IMPORTANT: IF YOU MAKE A BREAKING CHANGE TO HYDROGEN, THE UPDATE +# MUST BE GIVEN A NEW VERSION NUMBER, WHICH THEN MUST BE APPENDED TO +# THIS LIST. + +set(_version_compat_ranges 0.0.0 0.87.0 1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0) + +# This is the version that has been installed. +set(PACKAGE_VERSION "@HYDROGEN_VERSION@") + +# The version we need to match is PACKAGE_FIND_VERSION. The condition is that +# +# is_in_version_range(PACKAGE_FIND_VERSION, get_version_range(${PACKAGE_VERSION})) +# +# i.e., TARGET_VERSION_RANGE.lower <= PACKAGE_FIND_VERSION < TARGET_VERSION_RANGE.upper + +if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + + # This bit gets the compatibility bucket for PACKAGE_FIND_VERSION + list(LENGTH _version_compat_ranges _num_versions) + + list(GET _version_compat_ranges 0 _minimum_version) + if (PACKAGE_FIND_VERSION VERSION_LESS _minimum_version) + message(FATAL_ERROR + "Could not find version range for Hydrogen version ${PACKAGE_FIND_VERSION}.") + endif () + + # Indices are 0-based and RANGE is inclusive + math(EXPR _num_versions "${_num_versions} - 1") + foreach (_lower_ind RANGE 0 ${_num_versions}) + + math(EXPR _upper_ind "${_lower_ind} + 1") + + # This is always the case + list(GET _version_compat_ranges ${_lower_ind} _lower_version) + + if (_lower_ind EQUAL _num_versions) + set(_upper_version "INF") # Low probability of spelling error... + else () + list(GET _version_compat_ranges ${_upper_ind} _upper_version) + + # Ranges are half-open: [lower upper) + if ((PACKAGE_VERSION VERSION_GREATER_EQUAL _lower_version) AND + (PACKAGE_VERSION VERSION_LESS _upper_version)) + break () + endif () + endif () + endforeach () + + if ((PACKAGE_FIND_VERSION VERSION_GREATER_EQUAL _lower_version) AND + ((PACKAGE_FIND_VERSION VERSION_LESS _upper_version) OR + (_upper_version STREQUAL "INF"))) + set(PACKAGE_VERSION_COMPATIBLE TRUE) + else () + set(PACKAGE_VERSION_COMPATIBLE FALSE) + endif () + + if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif() + +# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: +if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "") + return() +endif() + +# check that the installed version has the same 32/64bit-ness as the one which is currently searching: +if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@") + math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8") + set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") + set(PACKAGE_VERSION_UNSUITABLE TRUE) +endif() diff --git a/cmake/configure_files/config.h.in b/cmake/configure_files/config.h.in index 040acdc70d..a9e23818a4 100644 --- a/cmake/configure_files/config.h.in +++ b/cmake/configure_files/config.h.in @@ -2,19 +2,30 @@ Copyright (c) 2009-2016, Jack Poulson All rights reserved. - This file is part of Elemental and is under the BSD 2-Clause License, - which can be found in the LICENSE file in the root directory, or at + This file is part of Elemental and is under the BSD 2-Clause License, + which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #ifndef EL_CONFIG_H #define EL_CONFIG_H +#include "hydrogen_config.h" + /* Build type and version information */ #define EL_GIT_SHA1 "@GIT_SHA1@" #define EL_VERSION_MAJOR "@EL_VERSION_MAJOR@" #define EL_VERSION_MINOR "@EL_VERSION_MINOR@" +#define EL_VERSION_PATCH "@EL_VERSION_PATCH@" #define EL_CMAKE_BUILD_TYPE "@CMAKE_BUILD_TYPE@" -#cmakedefine EL_RELEASE + +#ifdef HYDROGEN_RELEASE_BUILD +#define EL_RELEASE +#endif + +#ifdef Hydrogen_EXPORTS +#define EL_EXPORTS +#endif + #cmakedefine EL_HYBRID #cmakedefine BUILD_SHARED_LIBS #cmakedefine MSVC @@ -49,14 +60,9 @@ #cmakedefine EL_BUILT_BLIS_LAPACK #cmakedefine EL_HAVE_OPENBLAS #cmakedefine EL_BUILT_OPENBLAS -#cmakedefine EL_HAVE_BLAS_SUFFIX -#cmakedefine EL_HAVE_LAPACK_SUFFIX -#ifdef EL_HAVE_BLAS_SUFFIX -# define EL_BLAS_SUFFIX @EL_BLAS_SUFFIX@ -#endif -#ifdef EL_HAVE_LAPACK_SUFFIX -# define EL_LAPACK_SUFFIX @EL_LAPACK_SUFFIX@ -#endif + +#cmakedefine HYDROGEN_BLAS_SUFFIX @HYDROGEN_BLAS_SUFFIX@ +#cmakedefine HYDROGEN_LAPACK_SUFFIX @HYDROGEN_LAPACK_SUFFIX@ #cmakedefine EL_HAVE_SCALAPACK #cmakedefine EL_BUILT_SCALAPACK @@ -82,35 +88,18 @@ #cmakedefine EL_HAVE_OMP_SIMD #cmakedefine EL_HAVE_QT5 #cmakedefine EL_AVOID_COMPLEX_MPI -#cmakedefine EL_HAVE_CXX11RANDOM -#cmakedefine EL_HAVE_STEADYCLOCK -#cmakedefine EL_HAVE_NOEXCEPT -#cmakedefine EL_HAVE_MPI_REDUCE_SCATTER_BLOCK -#cmakedefine EL_HAVE_MPI_LONG_LONG -#cmakedefine EL_HAVE_MPI_LONG_DOUBLE -#cmakedefine EL_HAVE_MPI_LONG_DOUBLE_COMPLEX -#cmakedefine EL_HAVE_MPI_C_COMPLEX -#cmakedefine EL_HAVE_MPI_COMM_SET_ERRHANDLER -#cmakedefine EL_HAVE_MPI_INIT_THREAD -#cmakedefine EL_HAVE_MPI_QUERY_THREAD -#cmakedefine EL_HAVE_MPI3_NONBLOCKING_COLLECTIVES -#cmakedefine EL_HAVE_MPIX_NONBLOCKING_COLLECTIVES -#cmakedefine EL_REDUCE_SCATTER_BLOCK_VIA_ALLREDUCE #cmakedefine EL_USE_BYTE_ALLGATHERS #cmakedefine EL_USE_64BIT_INTS #cmakedefine EL_USE_64BIT_BLAS_INTS /* Sparse-direct configuration */ #cmakedefine EL_USE_CUSTOM_ALLTOALLV -#cmakedefine EL_HAVE_METIS -#cmakedefine EL_HAVE_PARMETIS /* Advanced configuration options */ #cmakedefine EL_ZERO_INIT #cmakedefine EL_CACHE_WARNINGS #cmakedefine EL_UNALIGNED_WARNINGS #cmakedefine EL_VECTOR_WARNINGS -#cmakedefine EL_AVOID_OMP_FMA #ifdef BUILD_SHARED_LIBS # if defined _WIN32 || defined __CYGWIN__ @@ -144,19 +133,4 @@ #cmakedefine EL_HAVE_VALGRIND -/* METIS/ParMETIS */ -#ifdef BUILD_SHARED_LIBS -# if defined _WIN32 || defined __CYGWIN__ -# ifdef __GNUC__ /* Compiling with GNU on Windows */ -# define METIS_EXPORT __attribute__ ((dllimport)) -# else /* Compiling with non-GNU on Windows (check for MSVC?) */ -# define METIS_EXPORT __declspec(dllimport) -# endif -# else -# define METIS_EXPORT -# endif -#else -# define METIS_EXPORT -#endif - #endif /* EL_CONFIG_H */ diff --git a/cmake/configure_files/environment.py.in b/cmake/configure_files/environment.py.in deleted file mode 100644 index 184418fd0f..0000000000 --- a/cmake/configure_files/environment.py.in +++ /dev/null @@ -1,285 +0,0 @@ -# -# Copyright (c) 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -import sys, ctypes -import numpy as np -from ctypes import pythonapi - -lib = ctypes.cdll.LoadLibrary("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/@CMAKE_SHARED_LIBRARY_PREFIX@El@CMAKE_SHARED_LIBRARY_SUFFIX@") - -# Environment -# =========== - -# Basic types -# ----------- - -from ctypes import c_bool, c_size_t, c_ubyte, c_uint, c_int, c_float, c_double -from ctypes import c_longlong, c_void_p, c_char_p -from ctypes import pointer, POINTER - -bType = c_bool - -# Determine whether we have 64-bit integers or not -lib.ElUsing64BitInt.argtypes = [POINTER(bType)] -using64 = bType() -lib.ElUsing64BitInt(pointer(using64)) -if using64: - iType = c_longlong - iSize = 8 - iNpType = np.int64 -else: - iType = c_int - iSize = 4 - iNpType = np.int32 - -sType = c_float -sSize = 4 -sNpType = np.float32 - -dType = c_double -dSize = 8 -dNpType = np.float64 - -class ComplexFloat(ctypes.Structure): - _fields_ = [("real",sType),("imag",sType)] - def __init__(self,val0=0,val1=0): - real = sType() - imag = sType() - if type(val0) is cType or type(val0) is zType: - real = val0.real - imag = val0.imag - else: - real = val0 - imag = val1 - super(ComplexFloat,self).__init__(real,imag) -cType = ComplexFloat -cSize = 2*sSize -cNpType = np.complex64 - -class ComplexDouble(ctypes.Structure): - _fields_ = [("real",dType),("imag",dType)] - def __init__(self,val0=0,val1=0): - real = dType() - imag = dType() - if type(val0) is cType or type(val0) is zType: - real = val0.real - imag = val0.imag - else: - real = val0 - imag = val1 - super(ComplexDouble,self).__init__(real,imag) -zType = ComplexDouble -zSize = 2*dSize -zNpType = np.complex128 - -# Create a simple enum for the supported datatypes -(iTag,sTag,dTag,cTag,zTag)=(0,1,2,3,4) -def CheckTag(tag): - if tag != iTag and \ - tag != sTag and tag != dTag and \ - tag != cTag and tag != zTag: - print 'Unsupported datatype' - -def Base(tag): - if tag == iTag: return iTag - elif tag == sTag: return sTag - elif tag == dTag: return dTag - elif tag == cTag: return sTag - elif tag == zTag: return dTag - else: raise Exception('Invalid tag') - -def Complexify(tag): - if tag == sTag: return cTag - elif tag == dTag: return zTag - elif tag == cTag: return cTag - elif tag == zTag: return zTag - else: raise Exception('Invalid tag') - -# While for CTypes we should return the underlying value of, e.g., c_int, -# we cannot/should-not do the same for ComplexDouble -def ScalarData(alpha): - if type(alpha) is iType: return alpha.value - elif type(alpha) is sType: return alpha.value - elif type(alpha) is dType: return alpha.value - else: return alpha - -def TagToType(tag): - if tag == iTag: return iType - elif tag == sTag: return sType - elif tag == dTag: return dType - elif tag == cTag: return cType - elif tag == zTag: return zType - else: raise Exception('Invalid tag') - -def TagToSize(tag): - if tag == iTag: return iSize - elif tag == sTag: return sSize - elif tag == dTag: return dSize - elif tag == cTag: return cSize - elif tag == zTag: return zSize - else: raise Exception('Invalid tag') - -def TagToNumpyType(tag): - if tag == iTag: return iNpType - elif tag == sTag: return sNpType - elif tag == dTag: return dNpType - elif tag == cTag: return cNpType - elif tag == zTag: return zNpType - else: raise Exception('Invalid tag') - -# Emulate an enum for matrix distributions -(MC,MD,MR,VC,VR,STAR,CIRC)=(0,1,2,3,4,5,6) - -def GatheredDist(dist): - if dist == CIRC: return CIRC - else: return STAR - -def DiagColDist(colDist,rowDist): - if colDist == MC and rowDist == MR: return MD - elif colDist == MR and rowDist == MC: return MD - elif colDist == STAR: return rowDist - else: return colDist - -def DiagRowDist(colDist,rowDist): - if colDist == MC and rowDist == MR: return STAR - elif colDist == MR and rowDist == MC: return STAR - elif colDist == STAR: return colDist - else: return rowDist - -class IndexRange(ctypes.Structure): - _fields_ = [("beg",iType),("end",iType)] - def __init__(self,ind0,ind1=None): - beg = iType() - end = iType() - if isinstance(ind0,slice): - if ind0.step != None and ind0.step != 1: - raise Exception('Slice step must be one') - beg = iType(ind0.start) - end = iType(ind0.stop) - else: - beg = iType(ind0) - if ind1 is None: end = iType(beg.value+1) - else: end = iType(ind1) - super(IndexRange,self).__init__(beg,end) - -# Emulate various enums -# --------------------- - -# Grid ordering -(ROW_MAJOR,COL_MAJOR)=(0,1) - -# Upper or lower -(LOWER,UPPER)=(0,1) - -# Left or right -(LEFT,RIGHT)=(0,1) - -# Matrix orientation -(NORMAL,TRANSPOSE,ADJOINT)=(0,1,2) - -# Unit/non-unit diagonal -(NON_UNIT,UNIT)=(0,1) - -# File format -(AUTO,ASCII,ASCII_MATLAB,BINARY,BINARY_FLAT,BMP,JPG,JPEG,MATRIX_MARKET, - PNG,PPM,XBM,XPM)=(0,1,2,3,4,5,6,7,8,9,10,11,12) - -# Colormap -(GRAYSCALE,GRAYSCALE_DISCRETE,RED_BLACK_GREEN,BLUE_RED)=(0,1,2,3) - -# Norm types -(ONE_NORM,INFINITY_NORM,ENTRYWISE_ONE_NORM,MAX_NORM,NUCLEAR_NORM,FROBENIUS_NORM, - TWO_NORM)=(0,1,2,3,4,5,6) - -# Sort type -(UNSORTED,DESCENDING,ASCENDING)=(0,1,2) - -# Pencil -(AXBX,ABX,BAX)=(1,2,3) - -# TODO: Many more enums - -# Miscellaneous small data structures -# ----------------------------------- -class SafeProduct_s(ctypes.Structure): - _fields_ = [("rho",sType),("kappa",sType),("n",iType)] -class SafeProduct_d(ctypes.Structure): - _fields_ = [("rho",dType),("kappa",dType),("n",iType)] -class SafeProduct_c(ctypes.Structure): - _fields_ = [("rho",cType),("kappa",sType),("n",iType)] -class SafeProduct_z(ctypes.Structure): - _fields_ = [("rho",zType),("kappa",dType),("n",iType)] -def TagToSafeProduct(tag): - if tag == sTag: return SafeProduct_s() - elif tag == dTag: return SafeProduct_d() - elif tag == cTag: return SafeProduct_c() - elif tag == zTag: return SafeProduct_z() - else: DataExcept() - -class InertiaType(ctypes.Structure): - _fields_ = [("numPositive",iType),("numNegative",iType),("numZero",iType)] - -# Initialization -# -------------- - -lib.ElInitialize.argtypes = [POINTER(c_int),POINTER(POINTER(c_char_p))] -def Initialize(): - argc = c_int() - argv = POINTER(c_char_p)() - pythonapi.Py_GetArgcArgv(ctypes.byref(argc),ctypes.byref(argv)) - lib.ElInitialize(pointer(argc),pointer(argv)) - -lib.ElInitialized.argtypes = [POINTER(bType)] -def Initialized(): - active = bType() - lib.ElInitialized( pointer(active) ) - return active.value - -lib.ElSetBlocksize.argtypes = [iType] -def SetBlocksize(blocksize): - lib.ElSetBlocksize(blocksize) - -lib.ElBlocksize.argtypes = [POINTER(iType)] -def Blocksize(): - blocksize = iType() - lib.ElBlocksize(pointer(blocksize)) - return blocksize - -# Import several I/O routines -# --------------------------- -pythonapi.PyFile_AsFile.argtypes = [ctypes.py_object] -pythonapi.PyFile_AsFile.restype = c_void_p - -lib.ElPrintVersion.argtypes = [c_void_p] -def PrintVersion(f=pythonapi.PyFile_AsFile(sys.stdout)): - lib.ElPrintVersion(f) - -lib.ElPrintConfig.argtypes = [c_void_p] -def PrintConfig(f=pythonapi.PyFile_AsFile(sys.stdout)): - lib.ElPrintConfig(f) - -lib.ElPrintCCompilerInfo.argtypes = [c_void_p] -def PrintCCompilerInfo(f=pythonapi.PyFile_AsFile(sys.stdout)): - lib.ElPrintCCompilerInfo(f) - -lib.ElPrintCxxCompilerInfo.argtypes = [c_void_p] -def PrintCxxCompilerInfo(f=pythonapi.PyFile_AsFile(sys.stdout)): - lib.ElPrintCxxCompilerInfo(f) - -# Input routines -# -------------- -# TODO? - -# Initialize MPI -# -------------- -Initialize() - -def TypeExcept(): - raise Exception('Unsupported matrix type') -def DataExcept(): - raise Exception('Unsupported datatype') diff --git a/cmake/configure_files/hydrogen_config.h.in b/cmake/configure_files/hydrogen_config.h.in new file mode 100644 index 0000000000..a3f7434d2d --- /dev/null +++ b/cmake/configure_files/hydrogen_config.h.in @@ -0,0 +1,71 @@ +#ifndef HYDROGEN_CONFIG_H +#define HYDROGEN_CONFIG_H + +#define HYDROGEN_GIT_VERSION "@HYDROGEN_GIT_VERSION@" +// The latest HEAD of the current local branch +#define HYDROGEN_LATEST_SHA "@HYDROGEN_LATEST_SHA@" +// The latest commit on the local "hydrogen" branch +#define HYDROGEN_LATEST_HYDROGEN_SHA "@HYDROGEN_LATEST_HYDROGEN_SHA@" + +#define HYDROGEN_VERSION_MAJOR "@HYDROGEN_VERSION_MAJOR@" +#define HYDROGEN_VERSION_MINOR "@HYDROGEN_VERSION_MINOR@" +#define HYDROGEN_VERSION_PATCH "@HYDROGEN_VERSION_PATCH@" +#define HYDROGEN_VERSION "@HYDROGEN_VERSION@" + +#cmakedefine HYDROGEN_RELEASE_BUILD + +// LAPACK stuff +#cmakedefine HYDROGEN_BLAS_SUFFIX @HYDROGEN_BLAS_SUFFIX@ +#cmakedefine HYDROGEN_LAPACK_SUFFIX @HYDROGEN_LAPACK_SUFFIX@ + +// 16-bit floating point stuff +#cmakedefine HYDROGEN_HAVE_HALF +#cmakedefine HYDROGEN_HAVE_BFLOAT16 + +// Extended Precision stuff +#cmakedefine HYDROGEN_HAVE_QUADMATH +#cmakedefine HYDROGEN_HAVE_QD +#cmakedefine HYDROGEN_HAVE_MPC + +#cmakedefine HYDROGEN_HAVE_LAPACK + +// MKL stuff +#cmakedefine HYDROGEN_HAVE_MKL +#cmakedefine HYDROGEN_HAVE_MKL_GEMMT + +#cmakedefine HYDROGEN_HAVE_GPU + +// CUDA stuff +#cmakedefine HYDROGEN_HAVE_CUDA + +// ROCm stuff +#cmakedefine HYDROGEN_HAVE_ROCM + +// General GPU stuff +#cmakedefine HYDROGEN_HAVE_CUB +#cmakedefine HYDROGEN_GPU_USE_TENSOR_OP_MATH +#cmakedefine HYDROGEN_GPU_USE_FP16 + +// Aluminum stuff +#cmakedefine HYDROGEN_HAVE_ALUMINUM +#cmakedefine HYDROGEN_HAVE_NCCL2 +#cmakedefine HYDROGEN_HAVE_AL_MPI_CUDA +#cmakedefine HYDROGEN_HAVE_AL_HOST_XFER + +#cmakedefine HYDROGEN_ENSURE_HOST_MPI_BUFFERS +#cmakedefine HYDROGEN_HAVE_CUDA_AWARE_MPI +#cmakedefine HYDROGEN_MPI_IS_OPENMPI +#cmakedefine HYDROGEN_MPI_IS_MVAPICH2 + +#cmakedefine HYDROGEN_HAVE_OMP_TASKLOOP + +#cmakedefine HYDROGEN_HAVE_NVPROF +#cmakedefine HYDROGEN_HAVE_VTUNE +#cmakedefine HYDROGEN_DEFAULT_SYNC_PROFILING + +#cmakedefine HYDROGEN_DO_BOUNDS_CHECKING + +#define H_RESTRICT __restrict__ +#define H_PRETTY_FUNCTION __PRETTY_FUNCTION__ + +#endif /* HYDROGEN_CONFIG_H */ diff --git a/cmake/detect/CXX.cmake b/cmake/detect/CXX.cmake index 89f157e930..ff020a3422 100644 --- a/cmake/detect/CXX.cmake +++ b/cmake/detect/CXX.cmake @@ -6,99 +6,9 @@ # which can be found in the LICENSE file in the root directory, or at # http://opensource.org/licenses/BSD-2-Clause # -include(FindCXXFeatures) include(CheckCXXSourceCompiles) -message(STATUS "CXX11_COMPILER_FLAGS=${CXX11_COMPILER_FLAGS}") -message(STATUS "CXX14_COMPILER_FLAGS=${CXX14_COMPILER_FLAGS}") -set(CMAKE_REQUIRED_FLAGS ${CXX14_COMPILER_FLAGS}) - -# TODO(poulson): Test for C++14 features such as [[deprecated]] - -# Required features -# ================= -set(ALIAS_CODE - "#include - template - using Complex = std::complex; - int main() - { - Complex a; - }") -check_cxx_source_compiles("${ALIAS_CODE}" EL_HAVE_TEMPLATE_ALIAS) -if(NOT EL_HAVE_TEMPLATE_ALIAS) - message(FATAL_ERROR "C++11 template aliasing not detected. You may want to make sure that your compiler is sufficiently up-to-date (e.g., g++ >= 4.7)") -endif() - -# Standard but inconsistently supported features -# ============================================== -set(STEADYCLOCK_CODE - "#include - int main() - { - std::chrono::steady_clock clock; - return 0; - }") -set(NOEXCEPT_CODE - "#include - void Foo( const std::vector& x ) noexcept { } - int main() - { return 0; }") -check_cxx_source_compiles("${STEADYCLOCK_CODE}" EL_HAVE_STEADYCLOCK) -check_cxx_source_compiles("${NOEXCEPT_CODE}" EL_HAVE_NOEXCEPT) - -# C++11 random number generation -# ============================== -# Note: It was noticed that, for certain relatively recent Intel compiler -# releases, the following snippets will suggest that normal distributions -# are supported, but not uniform integer or real distributions. -# Unfortunately, it has been observed that, when one attempts to sample -# from a normal distribution, the application hangs indefinitely. -# Thus, Elemental takes the approach of requiring all of the following -# to be detected before any are used. -set(NORMAL_CODE - "#include - int main() - { - std::random_device rd; - std::mt19937 mt(rd()); - std::normal_distribution dist(0,1); - const double x = dist(mt); - return 0; - }") -set(UNIFORM_INT_CODE - "#include - int main() - { - std::random_device rd; - std::mt19937 mt(rd()); - std::uniform_int_distribution dist(0,10); - const int x = dist(mt); - return 0; - }") -set(UNIFORM_REAL_CODE - "#include - int main() - { - std::random_device rd; - std::mt19937 mt(rd()); - std::uniform_real_distribution dist(0,1); - const double x = dist(mt); - return 0; - }") -check_cxx_source_compiles("${NORMAL_CODE}" EL_HAVE_NORMAL_DIST) -check_cxx_source_compiles("${UNIFORM_INT_CODE}" EL_HAVE_UNIFORM_INT_DIST) -check_cxx_source_compiles("${UNIFORM_REAL_CODE}" EL_HAVE_UNIFORM_REAL_DIST) -if(EL_HAVE_NORMAL_DIST AND - EL_HAVE_UNIFORM_INT_DIST AND - EL_HAVE_UNIFORM_REAL_DIST) - set(EL_HAVE_CXX11RANDOM TRUE) -else() - set(EL_HAVE_CXX11RANDOM FALSE) -endif() - # "restrict" support -# ================== set(RESTRICT_CODE "int main() { int* RESTRICT a; return 0; }") set(CMAKE_REQUIRED_DEFINITIONS "-DRESTRICT=__restrict__") check_cxx_source_compiles("${RESTRICT_CODE}" EL_HAVE___restrict__) @@ -121,11 +31,10 @@ else() endif() # __PRETTY_FUNCTION__ support -# =========================== set(PRETTY_FUNCTION_CODE "#include int main() - { + { std::cout << __PRETTY_FUNCTION__ << std::endl; return 0; }") diff --git a/cmake/detect/Fortran.cmake b/cmake/detect/Fortran.cmake deleted file mode 100644 index bb7afaa3f9..0000000000 --- a/cmake/detect/Fortran.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(language_support_v2) - -# NOTE: There is not a consistent ABI for Fortran's LOGICAL. Though it is -# standard for it to be represented in the same manner as INTEGER, -# the value for .true. is often +1 but sometimes -1, whereas .false. -# is almost always 0. We will thus standardize on .true.=+1 and .false=0, -# though this is known to occasionally break. Unfortunately it is -# nontrivial to determine this value since the same Fortran compiler -# which compiled ScaLAPACK would need to be known in order to create -# a custom routine which sets the input to .true. or .false. -if(NOT EL_FORT_LOGICAL) - set(EL_FORT_LOGICAL int) -endif() -if(NOT EL_FORT_TRUE) - set(EL_FORT_TRUE 1) -endif() -if(NOT EL_FORT_FALSE) - set(EL_FORT_FALSE 0) -endif() - -# Go ahead and check for Fortran, but keep in mind that CMake's 'OPTIONAL' -# argument for enable_language is still completely broken as of 3.0.2 -workaround_9220(Fortran FORTRAN_WORKS) -if(FORTRAN_WORKS) - enable_language(Fortran OPTIONAL) - set(EL_HAVE_F90_INTERFACE FALSE) - if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) - include(FortranCInterface) - FortranCInterface_VERIFY(CXX) - if(FortranCInterface_VERIFIED_CXX) - set(EL_HAVE_F90_INTERFACE TRUE) - FortranCInterface_HEADER( - ${CMAKE_CURRENT_BINARY_DIR}/include/El/FCMangle.h - MACRO_NAMESPACE "FC_") - install(FILES ${PROJECT_BINARY_DIR}/include/El/FCMangle.h - DESTINATION include/El/) - endif() - else() - message(STATUS "${CMAKE_Fortran_COMPILER} does not appear to support F90") - endif() -else() - message(STATUS "Could not find working Fortran compiler") -endif() diff --git a/cmake/detect/MPI.cmake b/cmake/detect/MPI.cmake deleted file mode 100644 index aefcc460ff..0000000000 --- a/cmake/detect/MPI.cmake +++ /dev/null @@ -1,324 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(ElCheckCSourceCompiles) - -find_package(MPI) -if(NOT MPI_C_FOUND) - message(FATAL_ERROR "MPI C compiler was not found and is required") -endif() - -# NOTE: -# check_function_exists only supports cdecl calling conventions, despite the -# fact that MS-MPI uses __stdcall. Thus, it is best to avoid using -# check_function_exists in favor of check_c_source_compiles. -# Thanks to Ahn Vo for discovering this issue! - -# Ensure that we have MPI1 by looking for MPI_Reduce_scatter -# ========================================================== -set(CMAKE_REQUIRED_FLAGS "${MPI_C_COMPILE_FLAGS}") -set(CMAKE_REQUIRED_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") -set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH}) -set(CMAKE_REQUIRED_LIBRARIES ${MPI_C_LIBRARIES}) -set(MPI_REDUCE_SCATTER_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - int *recvCounts; - double *a, *b; - MPI_Reduce_scatter - ( a, b, recvCounts, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_REDUCE_SCATTER_CODE}" - EL_HAVE_MPI_REDUCE_SCATTER) -if(NOT EL_HAVE_MPI_REDUCE_SCATTER) - message(FATAL_ERROR "Could not find MPI_Reduce_scatter") -endif() - -# If we have Open MPI, ensure that we have a sufficiently new version -# =================================================================== -# Allow advanced users to override the default minimum version requirement. -# Version 1.6.5 is known to cause problems with complex datatypes, even when -# EL_AVOID_COMPLEX_MPI is enabled. Since 1.7 was a feature branch, 1.8 is the -# lowest stable branch after 1.6.5. -# (e.g., for academic investigations of behavior) -# -# NOTE: MPI_C_INCLUDE_PATH has been observed to be a list containing both -# an item corresponding to the directory containing mpi.h *and* the full -# path to mpi.h for Open MPI! -# -if(NOT OMPI_MIN_VERSION) - set(OMPI_MIN_VERSION 1.8.1) -endif() -foreach(MPI_PATH ${MPI_C_INCLUDE_PATH}) - if(EXISTS "${MPI_PATH}/mpi.h") - set(MPI_HEADER_PATH ${MPI_PATH}) - endif() -endforeach() -if(MPI_HEADER_PATH) - message(STATUS "Will parse MPI header ${MPI_HEADER_PATH}/mpi.h") - file(READ "${MPI_HEADER_PATH}/mpi.h" _mpi_header) - string(REGEX MATCH "define[ \t]+OMPI_MAJOR_VERSION[ \t]+([0-9]+)" - _ompi_major_version_match "${_mpi_header}") - set(OMPI_MAJOR_VERSION "${CMAKE_MATCH_1}") - if(OMPI_MAJOR_VERSION) - set(HAVE_OMPI TRUE) - endif() - if(HAVE_OMPI) - string(REGEX MATCH "define[ \t]+OMPI_MINOR_VERSION[ \t]+([0-9]+)" - _ompi_minor_version_match "${_mpi_header}") - set(OMPI_MINOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+OMPI_RELEASE_VERSION[ \t]+([0-9]+)" - _ompi_release_version_match "${_mpi_header}") - set(OMPI_RELEASE_VERSION "${CMAKE_MATCH_1}") - set(OMPI_VERSION - ${OMPI_MAJOR_VERSION}.${OMPI_MINOR_VERSION}.${OMPI_RELEASE_VERSION}) - if(${OMPI_VERSION} VERSION_LESS ${OMPI_MIN_VERSION}) - message(FATAL_ERROR "Detected Open MPI version ${OMPI_VERSION}, but known bugs in version 1.6.5 of Open MPI have led Elemental to require at least version ${OMPI_MIN_VERSION}") - else() - message(STATUS "Using Open MPI version ${OMPI_VERSION}") - endif() - endif() -else() - message(STATUS "Could not find mpi.h to check for OpenMPI workarounds.") -endif() - -# Test for whether or not we have Fortran MPI support -# =================================================== -if(MPI_Fortran_FOUND) - set(MPIF_EXISTS FALSE) - foreach(FORTRAN_INCLUDE_PATH ${MPI_Fortran_INCLUDE_PATH}) - if(EXISTS "${FORTRAN_INCLUDE_PATH}/mpif.h") - set(MPIF_EXISTS TRUE) - endif() - endforeach() - if(MPIF_EXISTS) - set(EL_HAVE_MPI_FORTRAN TRUE) - else() - message(WARNING - "Fortran MPI support detected, but mpif.h was not found in ${MPI_Fortran_INCLUDE_PATH}") - endif() -endif() - -# Ensure that we have MPI2 by looking for MPI_Type_create_struct -# ============================================================== -set(MPI_TYPE_CREATE_STRUCT_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - int count=2; - int blockLengths[2]; - MPI_Aint displs[2]; - MPI_Datatype types[2]; - MPI_Datatype newType; - MPI_Type_create_struct( count, blockLengths, displs, types, &newType ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_TYPE_CREATE_STRUCT_CODE}" - EL_HAVE_MPI_TYPE_CREATE_STRUCT) -if(NOT EL_HAVE_MPI_TYPE_CREATE_STRUCT) - message(FATAL_ERROR "Could not find MPI_Type_create_struct") -endif() - -# Ensure that we have MPI_[UNSIGNED_]LONG_LONG if compiling with 64-bit integers -# ============================================================================== -set(MPI_LONG_LONG_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Datatype lli = MPI_LONG_LONG_INT; - MPI_Datatype llu = MPI_UNSIGNED_LONG_LONG; - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_LONG_LONG_CODE}" EL_HAVE_MPI_LONG_LONG) -if(EL_USE_64BIT_INTS AND NOT EL_HAVE_MPI_LONG_LONG) - message(FATAL_ERROR - "Did not detect MPI_LONG_LONG_INT and MPI_UNSIGNED_LONG_LONG") -endif() - -# Check if MPI_LONG_DOUBLE[_COMPLEX] is supported -# =============================================== -set(MPI_LONG_DOUBLE_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Datatype longDbl = MPI_LONG_DOUBLE; - MPI_Finalize(); - return 0; - }") -set(MPI_LONG_DOUBLE_COMPLEX_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Datatype longDblCpx = MPI_LONG_DOUBLE_COMPLEX; - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_LONG_DOUBLE_CODE}" EL_HAVE_MPI_LONG_DOUBLE) -El_check_c_source_compiles("${MPI_LONG_DOUBLE_COMPLEX_CODE}" - EL_HAVE_MPI_LONG_DOUBLE_COMPLEX) - -# Check if MPI_C_FLOAT_COMPLEX and MPI_C_DOUBLE_COMPLEX exist -# =========================================================== -set(MPI_C_COMPLEX_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Datatype floatCpx = MPI_C_FLOAT_COMPLEX; - MPI_Datatype doubleCpx = MPI_C_DOUBLE_COMPLEX; - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_C_COMPLEX_CODE}" EL_HAVE_MPI_C_COMPLEX) - -# Detect support for various optional MPI routines -# ================================================ -set(MPI_REDUCE_SCATTER_BLOCK_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - double *a, *b; - MPI_Reduce_scatter_block( a, b, 5, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_REDUCE_SCATTER_BLOCK_CODE}" - EL_HAVE_MPI_REDUCE_SCATTER_BLOCK) -set(MPI_IALLGATHER_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - double *a, *b; - MPI_Request request; - MPI_Iallgather - ( a, 5, MPI_DOUBLE, - b, 5, MPI_DOUBLE, MPI_COMM_WORLD, &request ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_IALLGATHER_CODE}" - EL_HAVE_MPI3_NONBLOCKING_COLLECTIVES) -set(MPIX_IALLGATHER_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - double *a, *b; - MPI_Request request; - MPIX_Iallgather - ( a, 5, MPI_DOUBLE, - b, 5, MPI_DOUBLE, MPI_COMM_WORLD, &request ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPIX_IALLGATHER_CODE}" - EL_HAVE_MPIX_NONBLOCKING_COLLECTIVES) -set(MPI_INIT_THREAD_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - int required=MPI_THREAD_SINGLE, provided; - MPI_Init_thread( &argc, &argv, required, &provided ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_INIT_THREAD_CODE}" EL_HAVE_MPI_INIT_THREAD) -set(MPI_QUERY_THREAD_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - int provided; - MPI_Query_thread( &provided ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_QUERY_THREAD_CODE}" EL_HAVE_MPI_QUERY_THREAD ) -set(MPI_COMM_SET_ERRHANDLER_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Errhandler handler; - MPI_Comm_set_errhandler( MPI_COMM_WORLD, handler ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_COMM_SET_ERRHANDLER_CODE}" - EL_HAVE_MPI_COMM_SET_ERRHANDLER) -# Detecting MPI_IN_PLACE and MPI_Comm_f2c requires test compilation -# ----------------------------------------------------------------- -set(MPI_IN_PLACE_CODE - "#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - float a; - MPI_Allreduce - ( MPI_IN_PLACE, &a, 1, MPI_FLOAT, MPI_SUM, MPI_COMM_WORLD ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_IN_PLACE_CODE}" EL_HAVE_MPI_IN_PLACE) -if(NOT EL_HAVE_MPI_IN_PLACE) - message(FATAL_ERROR "MPI_IN_PLACE support was not detected") -endif() -set(MPI_COMM_F2C_CODE -"#include \"mpi.h\" - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Fint fint; - MPI_Comm comm = MPI_Comm_f2c( fint ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_COMM_F2C_CODE}" EL_HAVE_MPI_COMM_F2C) - -# Detect whether or not MPI_Comm and MPI_Group are implemented as an int -# ====================================================================== -# NOTE: These are no longer used internally by Elemental -set(MPI_COMM_NOT_INT_CODE - "#include \"mpi.h\" - void Foo( MPI_Comm comm ) { } - void Foo( int comm ) { } - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Finalize(); - return 0; - }") -set(MPI_GROUP_NOT_INT_CODE - "#include \"mpi.h\" - void Foo( MPI_Group group ) { } - void Foo( int group ) { } - int main( int argc, char* argv[] ) - { - MPI_Init( &argc, &argv ); - MPI_Finalize(); - return 0; - }") -El_check_c_source_compiles("${MPI_COMM_NOT_INT_CODE}" EL_MPI_COMM_NOT_INT) -El_check_c_source_compiles("${MPI_GROUP_NOT_INT_CODE}" EL_MPI_GROUP_NOT_INT) - -set(CMAKE_REQUIRED_FLAGS) -set(CMAKE_REQUIRED_LINKER_FLAGS) -set(CMAKE_REQUIRED_INCLUDES) -set(CMAKE_REQUIRED_LIBRARIES) diff --git a/cmake/detect/OpenMP.cmake b/cmake/detect/OpenMP.cmake deleted file mode 100644 index 853ed875f3..0000000000 --- a/cmake/detect/OpenMP.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(CheckCXXSourceCompiles) - -if(OpenMP_C_FLAGS AND OpenMP_CXX_FLAGS) - set(EL_HAVE_OPENMP TRUE) - message(STATUS "Using prespecified OpenMP_C_FLAGS=${OpenMP_C_FLAGS}") - message(STATUS "Using prespecified OpenMP_CXX_FLAGS=${OpenMP_CXX_FLAGS}") -else() - find_package(OpenMP QUIET) - if(OPENMP_FOUND) - set(EL_HAVE_OPENMP TRUE) - else() - set(OpenMP_C_FLAGS "" CACHE STRING "OpenMP C FLAGS") - set(OpenMP_CXX_FLAGS "" CACHE STRING "OpenMP CXX FLAGS") - if(EL_HYBRID) - message(FATAL_ERROR - "Hybrid build failed because OpenMP support not detected. Please specify OpenMP_C_FLAGS and OpenMP_CXX_FLAGS.") - endif() - endif() -endif() - -# See if we have 'collapse' support, since Clang is currently setting _OPENMP -# greater than 200805 despite not supporting OpenMP 3.0 (i.e., collapse) -if(EL_HAVE_OPENMP) - set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS}) - set(OMP_COLLAPSE_CODE - "#include - int main( int argc, char* argv[] ) - { - int k[100]; - #pragma omp collapse(2) - for( int i=0; i<10; ++i ) - for( int j=0; j<10; ++j ) - k[i+j*10] = i+j; - return 0; - }") - check_cxx_source_compiles("${OMP_COLLAPSE_CODE}" EL_HAVE_OMP_COLLAPSE) - set(CMAKE_REQUIRED_FLAGS) -else() - set(EL_HAVE_OMP_COLLAPSE FALSE) -endif() - -# See if we have 'simd' support, which was introduced in OpenMP 4.0 -if(EL_HAVE_OPENMP) - set(CMAKE_REQUIRED_FLAGS ${OpenMP_CXX_FLAGS}) - set(OMP_SIMD_CODE - "#include - int main( int argc, char* argv[] ) - { - int k[10]; - #pragma omp simd - for( int i=0; i<10; ++i ) - k[i] = i; - return 0; - }") - check_cxx_source_compiles("${OMP_SIMD_CODE}" EL_HAVE_OMP_SIMD) - set(CMAKE_REQUIRED_FLAGS) -else() - set(EL_HAVE_OMP_SIMD FALSE) -endif() diff --git a/cmake/detect/Qt5.cmake b/cmake/detect/Qt5.cmake deleted file mode 100644 index d29a0b5822..0000000000 --- a/cmake/detect/Qt5.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -set(EL_HAVE_QT5 FALSE) -if(Qt5_DIR) - set(Qt5_LIBDIR "${Qt5_DIR}/lib") -endif() -if(Qt5_LIBDIR) - set(Qt5Widgets_DIR "${Qt5_LIBDIR}/cmake/Qt5Widgets") -endif() -if(EL_USE_QT5 OR Qt5Widgets_DIR) - # Search for Qt5 - find_package(Qt5Widgets) - if(Qt5Widgets_FOUND) - set(EL_HAVE_QT5 TRUE) - message(STATUS "Found Qt5") - else() - message(STATUS "Did NOT find Qt5") - endif() -endif() diff --git a/cmake/external_projects/ElMath/BLIS_LAPACK.cmake b/cmake/external_projects/ElMath/BLIS_LAPACK.cmake deleted file mode 100644 index db9f375232..0000000000 --- a/cmake/external_projects/ElMath/BLIS_LAPACK.cmake +++ /dev/null @@ -1,149 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(ExternalProject) -include(ElCheckFunctionExists) -include(ElLibraryName) - -# NOTE: Elemental has not yet added support for BLIS with 64-bit integers - -find_package(OpenMP) - -if(CMAKE_COMPILER_IS_GNUCC) - if(NOT CMAKE_THREAD_LIBS_INIT) - set(CMAKE_THREAD_PREFER_PTHREAD ON) - find_package(Threads REQUIRED) - if(NOT CMAKE_USE_PTHREADS_INIT) - message(FATAL_ERROR "Could not find a pthreads library") - endif() - endif() - if(NOT STD_MATH_LIB) - find_library(STD_MATH_LIB m) - if(NOT STD_MATH_LIB) - message(FATAL_ERROR "Could not find standard math library") - endif() - endif() - set(GNU_ADDONS ${CMAKE_THREAD_LIBS_INIT} ${STD_MATH_LIB}) -else() - set(GNU_ADDONS) -endif() - -if(NOT EL_FORCE_BLIS_LAPACK_BUILD AND NOT EL_USE_64BIT_BLAS_INTS) - message(STATUS "Searching for previously installed BLIS+LAPACK") - # NOTE: The following tests will assume that liblapack is NOT sufficient - # by itself and must be supported with a valid BLAS library - find_library(BLIS NAMES blis PATHS ${MATH_PATHS}) - find_library(LAPACK NAMES lapack PATHS ${MATH_PATHS}) - if(BLIS AND LAPACK) - set(CMAKE_REQUIRED_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_REQUIRED_LIBRARIES ${LAPACK} ${BLIS} ${GNU_ADDONS}) - El_check_function_exists(dgemm EL_HAVE_DGEMM) - El_check_function_exists(dgemm_ EL_HAVE_DGEMM_POST) - El_check_function_exists(dstegr EL_HAVE_DSTEGR) - El_check_function_exists(dstegr_ EL_HAVE_DSTEGR_POST) - if(EL_HAVE_DGEMM AND (EL_HAVE_DSTEGR OR EL_HAVE_DSTEGR_POST)) - set(USE_FOUND_BLIS_LAPACK TRUE) - set(EL_BLAS_SUFFIX) - if(EL_HAVE_DSTEGR) - set(EL_LAPACK_SUFFIX) - else() - set(EL_LAPACK_SUFFIX _) - endif() - elseif(EL_HAVE_DGEMM_POST AND (EL_HAVE_DSTEGR OR EL_HAVE_DSTEGR_POST)) - set(USE_FOUND_BLIS_LAPACK TRUE) - set(EL_BLAS_SUFFIX _) - if(EL_HAVE_DSTEGR) - set(EL_LAPACK_SUFFIX) - else() - set(EL_LAPACK_SUFFIX _) - endif() - endif() - unset(CMAKE_REQUIRED_LINKER_FLAGS) - unset(CMAKE_REQUIRED_LIBRARIES) - endif() -endif() - -if(USE_FOUND_BLIS_LAPACK) - set(BLIS_LAPACK_LIBS ${LAPACK} ${BLIS} ${GNU_ADDONS}) - set(BLIS_LAPACK_LIBS_AT_CONFIG ${BLIS_LAPACK_LIBS}) - set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${BLIS_LAPACK_LIBS}) - set(EL_BUILT_BLIS_LAPACK FALSE) - set(EL_HAVE_BLIS_LAPACK TRUE) -elseif(EL_HAVE_F90_INTERFACE AND - NOT EL_USE_64BIT_BLAS_INTS AND - NOT MSVC AND - NOT EL_CONFIG_TIME_BLIS_LAPACK) - if(NOT DEFINED LAPACK_URL) - set(LAPACK_URL https://github.com/scibuilder/lapack) - endif() - message(STATUS "Will download LAPACK from ${LAPACK_URL}") - - set(LAPACK_SOURCE_DIR ${PROJECT_BINARY_DIR}/download/blis_lapack/source) - set(LAPACK_BINARY_DIR ${PROJECT_BINARY_DIR}/download/blis_lapack/build) - - # Provide a way for Elemental to pass down the BLIS architecture - if(BLIS_ARCH) - set(BLIS_ARCH_COMMAND -D BLIS_ARCH=${BLIS_ARCH}) - else() - set(BLIS_ARCH_COMMAND) - endif() - - # Set up a target for building and installing OpenBLAS - ExternalProject_Add(project_blis_lapack - PREFIX ${CMAKE_INSTALL_PREFIX} - GIT_REPOSITORY ${LAPACK_URL} - STAMP_DIR ${LAPACK_BINARY_DIR}/stamp - SOURCE_DIR ${LAPACK_SOURCE_DIR} - BINARY_DIR ${LAPACK_BINARY_DIR} - TMP_DIR ${LAPACK_BINARY_DIR}/tmp - UPDATE_COMMAND "" - CMAKE_ARGS - -D CMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -D CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} - -D CMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -D CMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS} - -D USE_OPTIMIZED_BLAS=ON - -D FORCE_BLIS_BUILD=ON ${BLIS_ARCH_COMMAND} - -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - -D CMAKE_MACOSX_RPATH=${CMAKE_MACOSX_RPATH} - -D CMAKE_SKIP_RPATH=${CMAKE_SKIP_RPATH} - -D CMAKE_SKIP_BUILD_RPATH=${CMAKE_SKIP_BUILD_RPATH} - -D CMAKE_BUILD_WITH_INSTALL_RPATH=${CMAKE_BUILD_WITH_INSTALL_RPATH} - -D CMAKE_INSTALL_RPATH_USE_LINK_PATH=${CMAKE_INSTALL_RPATH_USE_LINK_PATH} - -D CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} - INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - ) - - # Extract the source and install directories - ExternalProject_Get_Property(project_blis_lapack source_dir install_dir) - - # Add a target for libblis - add_library(libblis ${LIBRARY_TYPE} IMPORTED) - El_library_name(blis_name blis) - set(BLIS_LIB ${install_dir}/lib/${blis_name}) - set_property(TARGET libblis PROPERTY IMPORTED_LOCATION ${BLIS_LIB}) - - # Add a target for liblapack - add_library(liblapack ${LIBRARY_TYPE} IMPORTED) - El_library_name(lapack_name lapack) - set(LAPACK_LIB ${install_dir}/lib/${lapack_name}) - set_property(TARGET liblapack PROPERTY IMPORTED_LOCATION ${LAPACK_LIB}) - - set(BLIS_LAPACK_LIBS ${LAPACK_LIB} ${BLIS_LIB} ${GNU_ADDONS}) - set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${BLIS_LAPACK_LIBS}) - set(EL_BUILT_BLIS_LAPACK TRUE) - set(EL_HAVE_BLIS_LAPACK TRUE) -elseif(EL_HAVE_F90_INTERFACE AND NOT EL_USE_64BIT_BLAS_INTS) - set(EL_PLAN_BLIS_LAPACK TRUE) - set(EL_BUILT_BLIS_LAPACK FALSE) - set(EL_HAVE_BLIS_LAPACK FALSE) -else() - set(EL_BUILT_BLIS_LAPACK FALSE) - set(EL_HAVE_BLIS_LAPACK FALSE) -endif() diff --git a/cmake/external_projects/ElMath/METIS.cmake b/cmake/external_projects/ElMath/METIS.cmake deleted file mode 100644 index aee5477275..0000000000 --- a/cmake/external_projects/ElMath/METIS.cmake +++ /dev/null @@ -1,86 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(ExternalProject) -include(ElLibraryName) - -if(NOT EL_FORCE_METIS_BUILD) - message(STATUS "Searching for previously installed METIS") - find_package(METIS) -endif() - -if(METIS_FOUND) - # find_package returns 'METIS_LIBRARIES' but METIS's CMakeLists.txt - # returns 'METIS_LIBS' - set(METIS_LIBS ${METIS_LIBRARIES}) - - set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${METIS_LIBS}) - message(STATUS "Including ${METIS_INCLUDE_DIRS} for external METIS") - include_directories(${METIS_INCLUDE_DIRS}) - set(EL_HAVE_METIS TRUE) - -elseif(NOT EL_PREVENT_METIS_DOWNLOAD) - if(NOT DEFINED METIS_URL) - set(METIS_URL https://github.com/scibuilder/Metis.git) - endif() - message(STATUS "Will pull METIS from ${METIS_URL}") - - set(METIS_SOURCE_DIR ${PROJECT_BINARY_DIR}/download/metis/source) - set(METIS_BINARY_DIR ${PROJECT_BINARY_DIR}/download/metis/build) - - option(METIS_PCRE OFF) - if(MSVC OR MINGW) - option(METIS_GKREGEX "Use GKlib's internal regex?" ON) - else() - option(METIS_GKREGEX "Use GKlib's internal regex?" OFF) - endif() - - ExternalProject_Add(project_metis - PREFIX ${CMAKE_INSTALL_PREFIX} - GIT_REPOSITORY ${METIS_URL} - STAMP_DIR ${METIS_BINARY_DIR}/stamp - SOURCE_DIR ${METIS_SOURCE_DIR} - BINARY_DIR ${METIS_BINARY_DIR} - TMP_DIR ${METIS_BINARY_DIR}/tmp - UPDATE_COMMAND "" - CMAKE_ARGS - -D PCRE=${METIS_PCRE} - -D GKREGEX=${METIS_GKREGEX} - -D CMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -D CMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - -D CMAKE_EXECUTABLE_SUFFIX_C=${CMAKE_EXECUTABLE_SUFFIX_C} - -D CMAKE_MACOSX_RPATH=${CMAKE_MACOSX_RPATH} - -D CMAKE_SKIP_BUILD_RPATH=${CMAKE_SKIP_BUILD_RPATH} - -D CMAKE_BUILD_WITH_INSTALL_RPATH=${CMAKE_BUILD_WITH_INSTALL_RPATH} - -D CMAKE_INSTALL_RPATH_USE_LINK_PATH=${CMAKE_INSTALL_RPATH_USE_LINK_PATH} - -D CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} - INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - ) - - # Extract the installation directory - ExternalProject_Get_Property(project_metis install_dir) - set(METIS_INCLUDE_DIRS "${install_dir}/include") - - # Add a target for libmetis (either shared or static) - add_library(libmetis ${LIBRARY_TYPE} IMPORTED) - El_library_name(metis_name metis) - set(METIS_LIB ${install_dir}/lib/${metis_name}) - set_property(TARGET libmetis PROPERTY IMPORTED_LOCATION ${METIS_LIB}) - - set(METIS_LIBS ${METIS_LIB}) - set(EL_BUILT_METIS TRUE) - - set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${METIS_LIBS}) - message(STATUS "Including ${METIS_INCLUDE_DIRS} for external METIS") - include_directories(${METIS_INCLUDE_DIRS}) - set(EL_HAVE_METIS TRUE) -else() - set(EL_HAVE_METIS FALSE) -endif() diff --git a/cmake/external_projects/ElMath/OpenBLAS.cmake b/cmake/external_projects/ElMath/OpenBLAS.cmake deleted file mode 100644 index e6a9eff3ec..0000000000 --- a/cmake/external_projects/ElMath/OpenBLAS.cmake +++ /dev/null @@ -1,188 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(ExternalProject) -include(ElCheckFunctionExists) -include(ElLibraryName) - -if(EL_USE_64BIT_BLAS_INTS) - set(OPENBLAS_SUFFIX 64) -else() - set(OPENBLAS_SUFFIX) -endif() - -if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") - set(GFORTRAN_PATHS /usr/lib - /usr/lib64 - /usr/local/lib - /usr/local/lib64 - /usr/lib/openmpi/lib - /usr/lib/gcc/x86_64-linux-gnu/4.8 - /usr/lib/gcc/x86_64-linux-gnu/4.9 - /usr/lib/gcc/x86_64-linux-gnu/5 - /usr/lib/gcc/x86_64-linux-gnu/6 - /lib/x86_64-linux-gnu - /usr/lib/x86_64-linux-gnu - /usr/lib/openblas-base - /usr/lib64/openblas-base - /usr/local/lib/gcc/4.8 - /usr/local/lib/gcc/4.9 - /usr/local/lib/gcc/5 - /usr/local/lib/gcc/6) - if(NOT GFORTRAN_LIB) - find_library(GFORTRAN_LIB NAMES gfortran PATHS ${GFORTRAN_PATHS}) - if(NOT GFORTRAN_LIB) - if(APPLE) - message(FATAL_ERROR "Could not find gfortran library; please consider setting the GFORTRAN_LIB variable. If you installed gfortran via homebrew, please see the issue filed at https://github.com/Homebrew/homebrew/issues/8539") - else() - message(FATAL_ERROR "Could not find gfortran library; please consider setting the GFORTRAN_LIB variable.") - endif() - endif() - endif() - if(NOT CMAKE_THREAD_LIBS_INIT) - set(CMAKE_THREAD_PREFER_PTHREAD ON) - find_package(Threads) - if(NOT CMAKE_USE_PTHREADS_INIT) - message(FATAL_ERROR "Could not find a pthreads library") - endif() - endif() - if(NOT STD_MATH_LIB) - find_library(STD_MATH_LIB m) - if(NOT STD_MATH_LIB) - message(FATAL_ERROR "Could not find standard math library") - endif() - endif() - set(GNU_ADDONS ${GFORTRAN_LIB} ${CMAKE_THREAD_LIBS_INIT} ${STD_MATH_LIB}) -else() - set(GNU_ADDONS) -endif() - -if(NOT EL_FORCE_OPENBLAS_BUILD) - message(STATUS "Searching for previously installed OpenBLAS+LAPACK") - find_library(OpenBLAS NAMES openblas${OPENBLAS_SUFFIX} PATHS ${MATH_PATHS}) - if(OpenBLAS) - set(CMAKE_REQUIRED_LIBRARIES ${OpenBLAS} ${GNU_ADDONS}) - El_check_function_exists(dgemm${OPENBLAS_SUFFIX} EL_HAVE_DGEMM_OPENBLAS) - El_check_function_exists(dgemm${OPENBLAS_SUFFIX}_ EL_HAVE_DGEMM_POST_OPENBLAS) - El_check_function_exists(dsytrd${OPENBLAS_SUFFIX} EL_HAVE_DSYTRD_OPENBLAS) - El_check_function_exists(dsytrd${OPENBLAS_SUFFIX}_ EL_HAVE_DSYTRD_POST_OPENBLAS) - if(EL_HAVE_DGEMM_OPENBLAS OR EL_HAVE_DGEMM_POST_OPENBLAS) - set(EL_HAVE_OPENBLAS_BLAS TRUE) - if(EL_HYBRID) - message("Found OpenBLAS as ${OpenBLAS}; you may want to experiment with the environment variable OPENBLAS_NUM_THREADS") - else() - message("Found OpenBLAS as ${OpenBLAS}; you may want to set the environment variable OPENBLAS_NUM_THREADS=1") - endif() - else() - message(WARNING "OpenBLAS was found as ${OpenBLAS}, but BLAS support was not detected") - endif() - if(EL_HAVE_DSYTRD_OPENBLAS OR EL_HAVE_DSYTRD_POST_OPENBLAS) - set(EL_HAVE_OPENBLAS_LAPACK TRUE) - else() - message(WARNING "OpenBLAS was found as ${OpenBLAS}, but LAPACK support was not detected") - endif() - if(EL_HAVE_OPENBLAS_BLAS AND EL_HAVE_OPENBLAS_LAPACK) - if(EL_HAVE_DGEMM_OPENBLAS) - set(EL_BLAS_SUFFIX ${OPENBLAS_SUFFIX}) - else() - set(EL_BLAS_SUFFIX ${OPENBLAS_SUFFIX}_) - endif() - if(EL_HAVE_DSYTRD_OPENBLAS) - set(EL_LAPACK_SUFFIX ${OPENBLAS_SUFFIX}) - else() - set(EL_LAPACK_SUFFIX ${OPENBLAS_SUFFIX}_) - endif() - endif() - unset(CMAKE_REQUIRED_LIBRARIES) - endif() -endif() - -if(EL_HAVE_OPENBLAS_BLAS AND EL_HAVE_OPENBLAS_LAPACK) - set(OPENBLAS_LIBS ${OpenBLAS} ${GNU_ADDONS}) - set(OPENBLAS_LIBS_AT_CONFIG ${OPENBLAS_LIBS}) - set(EL_HAVE_OPENBLAS TRUE) - set(EL_BUILT_OPENBLAS FALSE) - message(STATUS "Using OpenBLAS+LAPACK found at ${OpenBLAS}") -elseif(FORTRAN_WORKS AND NOT MSVC AND NOT EL_CONFIG_TIME_OPENBLAS) - if(NOT DEFINED OPENBLAS_URL) - set(OPENBLAS_URL https://github.com/xianyi/OpenBLAS.git) - endif() - if(NOT DEFINED OPENBLAS_TAG) - set(OPENBLAS_TAG "v0.2.15") - endif() - message(STATUS "Will pull OpenBLAS (tag ${OPENBLAS_TAG}) from ${OPENBLAS_URL}") - - set(OPENBLAS_SOURCE_DIR ${PROJECT_BINARY_DIR}/download/OpenBLAS/source) - set(OPENBLAS_BINARY_DIR ${PROJECT_BINARY_DIR}/download/OpenBLAS/build) - - if(APPLE) - if(NOT OPENBLAS_ARCH_COMMAND) - # This is a hack but is a good default for modern Mac's - set(OPENBLAS_ARCH_COMMAND TARGET=SANDYBRIDGE) - endif() - else() - if(NOT OPENBLAS_ARCH_COMMAND) - set(OPENBLAS_ARCH_COMMAND) - endif() - endif() - - if(NOT OPENBLAS_THREAD_COMMAND) - if(EL_HYBRID) - set(OPENBLAS_THREAD_COMMAND USE_OPENMP=1) - else() - set(OPENBLAS_THREAD_COMMAND USE_THREAD=0) - endif() - endif() - - if(EL_USE_64BIT_BLAS_INTS) - set(OPENBLAS_INTERFACE_COMMAND INTERFACE64=1 SYMBOLSUFFIX=64) - else() - set(OPENBLAS_INTERFACE_COMMAND INTERFACE64=0) - endif() - - ExternalProject_Add(project_openblas - PREFIX ${CMAKE_INSTALL_PREFIX} - GIT_REPOSITORY ${OPENBLAS_URL} - GIT_TAG ${OPENBLAS_TAG} - STAMP_DIR ${OPENBLAS_BINARY_DIR}/stamp - BUILD_IN_SOURCE 1 - SOURCE_DIR ${OPENBLAS_SOURCE_DIR} - TMP_DIR ${OPENBLAS_BINARY_DIR}/tmp - INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - CONFIGURE_COMMAND "" - UPDATE_COMMAND "" - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - CC=${CMAKE_C_COMPILER} - FC=${CMAKE_Fortran_COMPILER} - ${OPENBLAS_THREAD_COMMAND} - ${OPENBLAS_ARCH_COMMAND} - ${OPENBLAS_INTERFACE_COMMAND} - libs netlib shared - INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install PREFIX= - ) - - # Extract the installation directory - ExternalProject_Get_Property(project_openblas install_dir) - - # Add a target for libopenblas(64) (either shared or static) - add_library(libopenblas ${LIBRARY_TYPE} IMPORTED) - El_library_name(openblas_name openblas${OPENBLAS_SUFFIX}) - set(OPENBLAS_LIB ${install_dir}/lib/${openblas_name}) - set_property(TARGET libopenblas PROPERTY IMPORTED_LOCATION ${OPENBLAS_LIB}) - - set(OPENBLAS_LIBS ${OPENBLAS_LIB} ${GNU_ADDONS}) - set(EL_HAVE_OPENBLAS TRUE) - set(EL_BUILT_OPENBLAS TRUE) -elseif(FORTRAN_WORKS AND NOT MSVC) - set(EL_PLAN_OPENBLAS TRUE) - set(EL_HAVE_OPENBLAS FALSE) - set(EL_BUILT_OPENBLAS FALSE) -else() - set(EL_HAVE_OPENBLAS FALSE) - set(EL_BUILT_OPENBLAS FALSE) -endif() diff --git a/cmake/external_projects/ElMath/ScaLAPACK.cmake b/cmake/external_projects/ElMath/ScaLAPACK.cmake deleted file mode 100644 index 22e7114ec1..0000000000 --- a/cmake/external_projects/ElMath/ScaLAPACK.cmake +++ /dev/null @@ -1,383 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(ExternalProject) -include(ElCheckFunctionExists) -include(ElLibraryName) - -# If MATH_LIBS_AT_CONFIG exists, see if it supports ScaLAPACK -if(MATH_LIBS_AT_CONFIG) - set(CMAKE_REQUIRED_FLAGS "${MPI_C_COMPILE_FLAGS}") - set(CMAKE_REQUIRED_LINKER_FLAGS - "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH}) - set(CMAKE_REQUIRED_LIBRARIES ${MATH_LIBS_AT_CONFIG} ${MPI_C_LIBRARIES}) - if(EL_BLAS_SUFFIX) - El_check_function_exists(dtrsm${EL_BLAS_SUFFIX} EL_HAVE_DTRSM) - if(EL_HAVE_DTRSM) - set(HAVE_BLAS TRUE) - else() - set(HAVE_BLAS FALSE) - endif() - else() - El_check_function_exists(dtrsm EL_HAVE_DTRSM) - El_check_function_exists(dtrsm_ EL_HAVE_DTRSM_POST) - if(EL_HAVE_DTRSM OR EL_HAVE_DTRSM_POST) - set(HAVE_BLAS TRUE) - else() - set(HAVE_BLAS FALSE) - endif() - endif() - if(NOT HAVE_BLAS) - message(FATAL_ERROR "Could not find BLAS in ${MATH_LIBS_AT_CONFIG}") - endif() - if(EL_LAPACK_SUFFIX) - El_check_function_exists(dsytrd${EL_LAPACK_SUFFIX} EL_HAVE_DSYTRD) - if(EL_HAVE_DSYTRD) - set(HAVE_LAPACK TRUE) - else() - set(HAVE_LAPACK FALSE) - endif() - else() - El_check_function_exists(dsytrd EL_HAVE_DSYTRD) - El_check_function_exists(dsytrd_ EL_HAVE_DSYTRD_POST) - if(EL_HAVE_DSYTRD OR EL_HAVE_DSYTRD_POST) - set(HAVE_LAPACK TRUE) - else() - set(HAVE_LAPACK FALSE) - endif() - endif() - if(NOT HAVE_LAPACK) - message(FATAL_ERROR "Could not find LAPACK in ${MATH_LIBS_AT_CONFIG}") - endif() - if(EL_SCALAPACK_SUFFIX) - El_check_function_exists(pdsyngst${EL_SCALAPACK_SUFFIX} EL_HAVE_PDSYNGST) - El_check_function_exists(Csys2blacs_handle EL_HAVE_CSYS2BLACS) - if(NOT EL_HAVE_PDSYNGST OR NOT EL_HAVE_CSYS2BLACS) - message(STATUS "Did not detect ScaLAPACK") - elseif(HAVE_BLAS AND HAVE_LAPACK) - set(MATH_LIBS_HAS_SCALAPACK TRUE) - set(EL_HAVE_SCALAPACK_SUFFIX TRUE) - endif() - else() - # NOTE: pdsyngst was chosen because MKL ScaLAPACK only defines pdsyngst_, - # but not pdsyngst, despite defining both pdpotrf and pdpotrf_. - El_check_function_exists(pdsyngst EL_HAVE_PDSYNGST) - El_check_function_exists(pdsyngst_ EL_HAVE_PDSYNGST_POST) - El_check_function_exists(Csys2blacs_handle EL_HAVE_CSYS2BLACS) - if(HAVE_BLAS AND HAVE_LAPACK AND EL_HAVE_PDSYNGST AND EL_HAVE_CSYS2BLACS) - set(EL_SCALAPACK_SUFFIX) - set(MATH_LIBS_HAS_SCALAPACK TRUE) - elseif(HAVE_BLAS AND HAVE_LAPACK AND - EL_HAVE_PDSYNGST_POST AND EL_HAVE_CSYS2BLACS) - set(EL_SCALAPACK_SUFFIX _) - set(EL_HAVE_SCALAPACK_SUFFIX TRUE) - set(MATH_LIBS_HAS_SCALAPACK TRUE) - else() - message(STATUS "Did not detect ScaLAPACK") - endif() - endif() - if(MATH_LIBS_HAS_SCALAPACK) - El_check_function_exists(pdlaqr0${EL_SCALAPACK_SUFFIX} EL_HAVE_PDLAQR0) - El_check_function_exists(pdlaqr1${EL_SCALAPACK_SUFFIX} EL_HAVE_PDLAQR1) - if(NOT EL_HAVE_PDLAQR0 OR NOT EL_HAVE_PDLAQR1) - message(STATUS "MATH_LIBS_AT_CONFIG=${MATH_LIBS_AT_CONFIG} supports some of ScaLAPACK, but not PDLAQR{0,1}.") - set(MATH_LIBS_HAS_SCALAPACK FALSE) - endif() - endif() - unset(CMAKE_REQUIRED_FLAGS) - unset(CMAKE_REQUIRED_LINKER_FLAGS) - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) -endif() - -if(NOT MATH_LIBS_HAS_SCALAPACK AND NOT EL_FORCE_SCALAPACK_BUILD) - message(STATUS "Searching for previously installed ScaLAPACK") - find_library(ScaLAPACK NAMES scalapack PATHS ${MATH_PATHS}) - if(ScaLAPACK) - get_filename_component(ScaLAPACK_DIR ScaLAPACK DIRECTORY) - if(EXISTS "${ScaLAPACK_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}blacs${CMAKE_SHARED_LIBRARY_SUFFIX}" OR - EXISTS "${ScaLAPACK_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}blacs${CMAKE_STATIC_LIBRARY_SUFFIX}") - message(WARNING "Found blacs library in ${ScaLAPACK_DIR}; ScaLAPACK appears to be too old to link to") - else() - set(CMAKE_REQUIRED_FLAGS "${MPI_C_COMPILE_FLAGS}") - set(CMAKE_REQUIRED_LINKER_FLAGS - "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_REQUIRED_INCLUDES ${MPI_C_INCLUDE_PATH}) - set(CMAKE_REQUIRED_LIBRARIES - ${ScaLAPACK} ${MATH_LIBS_AT_CONFIG} ${MPI_C_LIBRARIES}) - if(EL_BLAS_SUFFIX) - El_check_function_exists(dtrsm${EL_BLAS_SUFFIX} EL_HAVE_DTRSM) - if(EL_HAVE_DTRSM) - set(HAVE_BLAS TRUE) - else() - set(HAVE_BLAS FALSE) - endif() - else() - El_check_function_exists(dtrsm EL_HAVE_DTRSM) - El_check_function_exists(dtrsm_ EL_HAVE_DTRSM_POST) - if(EL_HAVE_DTRSM OR EL_HAVE_DTRSM_POST) - set(HAVE_BLAS TRUE) - else() - set(HAVE_BLAS FALSE) - endif() - endif() - if(MATH_LIBS_AT_CONFIG AND NOT HAVE_BLAS) - message(FATAL_ERROR - "Cannot link BLAS with found ScaLAPACK and MATH_LIBS") - endif() - if(EL_LAPACK_SUFFIX) - El_check_function_exists(dsytrd${EL_LAPACK_SUFFIX} EL_HAVE_DSYTRD) - if(EL_HAVE_DSYTRD) - set(HAVE_LAPACK TRUE) - else() - set(HAVE_LAPACK FALSE) - endif() - else() - El_check_function_exists(dsytrd EL_HAVE_DSYTRD) - El_check_function_exists(dsytrd_ EL_HAVE_DSYTRD_POST) - if(EL_HAVE_DSYTRD OR EL_HAVE_DSYTRD_POST) - set(HAVE_LAPACK TRUE) - else() - set(HAVE_LAPACK FALSE) - endif() - endif() - if(MATH_LIBS_AT_CONFIG AND NOT HAVE_LAPACK) - message(FATAL_ERROR - "Cannot link LAPACK with found ScaLAPACK and MATH_LIBS") - endif() - if(EL_SCALAPACK_SUFFIX) - El_check_function_exists(pdsyngst${EL_SCALAPACK_SUFFIX} EL_HAVE_PDSYNGST) - El_check_function_exists(Csys2blacs_handle EL_HAVE_CSYS2BLACS) - if(NOT EL_HAVE_PDSYNGST OR NOT EL_HAVE_CSYS2BLACS) - message(WARNING "Could not find pdsyngst${EL_SCALAPACK_SUFFIX} and Csys2blacs_handle") - elseif(HAVE_BLAS AND HAVE_LAPACK) - set(USE_FOUND_SCALAPACK TRUE) - set(EL_HAVE_SCALAPACK_SUFFIX TRUE) - endif() - else() - # pdsyngst was chosen because MKL ScaLAPACK only defines pdsyngst_, - # but not pdsyngst, despite defining both pdpotrf and pdpotrf_. - El_check_function_exists(pdsyngst EL_HAVE_PDSYNGST) - El_check_function_exists(pdsyngst_ EL_HAVE_PDSYNGST_POST) - El_check_function_exists(Csys2blacs_handle EL_HAVE_CSYS2BLACS) - if(HAVE_BLAS AND HAVE_LAPACK AND - EL_HAVE_PDSYNGST AND EL_HAVE_CSYS2BLACS) - set(EL_SCALAPACK_SUFFIX) - set(USE_FOUND_SCALAPACK TRUE) - elseif(HAVE_BLAS AND HAVE_LAPACK AND - EL_HAVE_PDSYNGST_POST AND EL_HAVE_CSYS2BLACS) - set(EL_SCALAPACK_SUFFIX _) - set(EL_HAVE_SCALAPACK_SUFFIX TRUE) - set(USE_FOUND_SCALAPACK TRUE) - else() - message(STATUS "Could not link ScaLAPACK") - endif() - endif() - if(USE_FOUND_SCALAPACK) - El_check_function_exists(pdlaqr0${EL_SCALAPACK_SUFFIX} EL_HAVE_PDLAQR0) - El_check_function_exists(pdlaqr1${EL_SCALAPACK_SUFFIX} EL_HAVE_PDLAQR1) - if(NOT EL_HAVE_PDLAQR0 OR NOT EL_HAVE_PDLAQR1) - message(STATUS "${ScaLAPACK} supports some of ScaLAPACK, but not PDLAQR{0,1}.") - set(USE_FOUND_SCALAPACK FALSE) - endif() - endif() - unset(CMAKE_REQUIRED_FLAGS) - unset(CMAKE_REQUIRED_LINKER_FLAGS) - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) - endif() - endif() -endif() - -if(MATH_LIBS_HAS_SCALAPACK) - set(SCALAPACK_LIBS ${MATH_LIBS_AT_CONFIG}) - set(SCALAPACK_LIBS_AT_CONFIG ${MATH_LIBS_AT_CONFIG}) - set(EL_BUILT_SCALAPACK FALSE) - set(EL_HAVE_SCALAPACK TRUE) -elseif(USE_FOUND_SCALAPACK) - set(SCALAPACK_LIBS ${ScaLAPACK} ${MATH_LIBS_AT_CONFIG}) - set(SCALAPACK_LIBS_AT_CONFIG ${ScaLAPACK} ${MATH_LIBS_AT_CONFIG}) - set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${SCALAPACK_LIBS}) - set(EL_HAVE_SCALAPACK TRUE) -elseif(EL_HAVE_F90_INTERFACE AND EL_HAVE_MPI_FORTRAN AND - (MATH_LIBS_AT_CONFIG OR NOT MSVC)) - if(NOT DEFINED SCALAPACK_URL) - set(SCALAPACK_URL https://github.com/scibuilder/scalapack.git) - endif() - message(STATUS "Will pull ScaLAPACK from ${SCALAPACK_URL}") - - set(SCALAPACK_SOURCE_DIR ${PROJECT_BINARY_DIR}/download/scalapack/source) - set(SCALAPACK_BINARY_DIR ${PROJECT_BINARY_DIR}/download/scalapack/build) - - if(CUSTOM_BLAS_SUFFIX AND NOT CUSTOM_LAPACK_SUFFIX) - message(FATAL_ERROR - "Attempted custom BLAS but not custom LAPACK ScaLAPACK build") - endif() - if(NOT CUSTOM_BLAS_SUFFIX AND CUSTOM_LAPACK_SUFFIX) - message(FATAL_ERROR - "Attempted custom LAPACK but not custom BLAS ScaLAPACK build") - endif() - - # Convert various MPI lists (delimted with ';') to use a '^^' delimiter - # (following the advice from - # http://www.kitware.com/media/html/BuildingExternalProjectsWithCMake2.8.html) - # due to running into build problems within ScaLAPACK's linking of OpenMPI - # Fortran libraries. - string(REPLACE ";" "^^" MPI_C_INCSTRING "${MPI_C_INCLUDE_PATH}") - string(REPLACE ";" "^^" MPI_Fortran_INCSTRING "${MPI_Fortran_INCLUDE_PATH}") - string(REPLACE ";" "^^" MPI_C_LIBSTRING "${MPI_C_LIBRARIES}") - string(REPLACE ";" "^^" MPI_Fortran_LIBSTRING "${MPI_Fortran_LIBRARIES}") - string(REPLACE ";" "^^" MATH_LIBS_AT_CONFIG_STRING "${MATH_LIBS_AT_CONFIG}") - - if(MATH_LIBS_AT_CONFIG AND - NOT CUSTOM_BLAS_SUFFIX AND NOT CUSTOM_LAPACK_SUFFIX) - set(LAPACK_COMMAND -D LAPACK_LIBRARIES=${MATH_LIBS_AT_CONFIG_STRING}) - elseif(EL_HAVE_VECLIB AND - NOT EL_PREFER_OPENBLAS AND NOT EL_PREFER_BLIS_LAPACK) - set(LAPACK_COMMAND -D LAPACK_LIBRARIES:STRING=-framework\ vecLib) - elseif(EL_HAVE_ACCELERATE AND - NOT EL_PREFER_OPENBLAS AND NOT EL_PREFER_BLIS_LAPACK) - set(LAPACK_COMMAND -D LAPACK_LIBRARIES:STRING=-framework\ Accelerate) - else() - if((EL_DISABLE_OPENBLAS OR EL_PREFER_BLIS_LAPACK) - AND NOT EL_DISABLE_BLIS_LAPACK) - set(LAPACK_COMMAND -D FORCE_BLIS_LAPACK_BUILD=ON) - else() - if(EL_DISABLE_OPENBLAS) - message(FATAL_ERROR "OpenBLAS was last option and was disabled") - endif() - set(LAPACK_COMMAND -D FORCE_OPENBLAS_BUILD=ON) - if(OPENBLAS_ARCH_COMMAND) - set(LAPACK_COMMAND ${LAPACK_COMMAND} - -D OPENBLAS_ARCH_COMMAND=${OPENBLAS_ARCH_COMMAND}) - endif() - if(OPENBLAS_THREAD_COMMAND) - set(LAPACK_COMMAND ${LAPACK_COMMAND} - -D OPENBLAS_THREAD_COMMAND=${OPENBLAS_THREAD_COMMAND}) - endif() - endif() - endif() - - if(GFORTRAN_LIB) - set(GFORTRAN_COMMAND -D GFORTRAN_LIB=${GFORTRAN_LIB}) - else() - set(GFORTRAN_COMMAND) - endif() - ExternalProject_Add(project_scalapack - PREFIX ${CMAKE_INSTALL_PREFIX} - GIT_REPOSITORY ${SCALAPACK_URL} - STAMP_DIR ${SCALAPACK_BINARY_DIR}/stamp - SOURCE_DIR ${SCALAPACK_SOURCE_DIR} - BINARY_DIR ${SCALAPACK_BINARY_DIR} - TMP_DIR ${SCALAPACK_BINARY_DIR}/tmp - UPDATE_COMMAND "" - LIST_SEPARATOR ^^ - CMAKE_ARGS - -D CMAKE_C_COMPILER=${CMAKE_C_COMPILER} - -D CMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER} - -D CMAKE_C_FLAGS=${CMAKE_C_FLAGS} - -D CMAKE_Fortran_FLAGS=${CMAKE_Fortran_FLAGS} - -D MPI_C_INCLUDE_PATH:STRING=${MPI_C_INCSTRING} - -D MPI_Fortran_INCLUDE_PATH:STRING=${MPI_Fortran_INCSTRING} - -D MPI_C_COMPILE_FLAGS=${MPI_C_COMPILE_FLAGS} - -D MPI_Fortran_COMPILE_FLAGS=${MPI_Fortran_COMPILE_FLAGS} - -D MPI_C_LIBRARIES:STRING=${MPI_C_LIBSTRING} - -D MPI_Fortran_LIBRARIES:STRING=${MPI_Fortran_LIBSTRING} - -D MPI_C_LINK_FLAGS=${MPI_C_LINK_FLAGS} - ${LAPACK_COMMAND} - ${GFORTRAN_COMMAND} - -D SCALAPACK_HYBRID=${EL_HYBRID} - -D DISABLE_MKL=${EL_DISABLE_MKL} - -D TEST_SCALAPACK=OFF - -D CMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} - -D BUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} - -D CMAKE_EXECUTABLE_SUFFIX_C=${CMAKE_EXECUTABLE_SUFFIX_C} - -D CMAKE_MACOSX_RPATH=${CMAKE_MACOSX_RPATH} - -D CMAKE_SKIP_RPATH=${CMAKE_SKIP_RPATH} - -D CMAKE_SKIP_BUILD_RPATH=${CMAKE_SKIP_BUILD_RPATH} - -D CMAKE_BUILD_WITH_INSTALL_RPATH=${CMAKE_BUILD_WITH_INSTALL_RPATH} - -D CMAKE_INSTALL_RPATH_USE_LINK_PATH=${CMAKE_INSTALL_RPATH_USE_LINK_PATH} - -D CMAKE_INSTALL_RPATH=${CMAKE_INSTALL_RPATH} - INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - ) - - # Extract the source and install directories - ExternalProject_Get_Property(project_scalapack source_dir install_dir) - - # Add targets for libscalapack (either shared or static) - add_library(libscalapack ${LIBRARY_TYPE} IMPORTED) - El_library_name(scalapack_name scalapack) - set(SCALAPACK_LIB ${install_dir}/lib/${scalapack_name}) - set_property(TARGET libscalapack PROPERTY IMPORTED_LOCATION ${SCALAPACK_LIB}) - if(WIN32) - add_library(libscalapack-F ${LIBRARY_TYPE} IMPORTED) - El_library_name(scalapack-F_name scalapack-F) - set(SCALAPACKF_LIB ${install_dir}/lib${scalapack_name}) - set_property(TARGET libscalapack-F PROPERTY - IMPORTED_LOCATION ${SCALAPACKF_LIB}) - endif() - if(WIN32) - set(SCALAPACK_BASE ${SCALAPACK_LIB} ${SCALAPACKF_LIB}) - else() - set(SCALAPACK_BASE ${SCALAPACK_LIB}) - endif() - - # Attempt to reproduce the build preferences for the ScaLAPACK CMake config - # (which should not have happened yet...) - if(MATH_LIBS_AT_CONFIG AND - NOT CUSTOM_BLAS_SUFFIX AND NOT CUSTOM_LAPACK_SUFFIX) - set(SCALAPACK_LIBS ${SCALAPACK_BASE} ${MATH_LIBS_AT_CONFIG}) - set(SCALAPACK_LIBS_AT_CONFIG ${MATH_LIBS_AT_CONFIG}) - elseif(EL_HAVE_VECLIB AND - NOT EL_PREFER_OPENBLAS AND NOT EL_PREFER_BLIS_LAPACK) - set(SCALAPACK_LIBS ${SCALAPACK_BASE} "-framework vecLib") - elseif(EL_HAVE_ACCELERATE AND - NOT EL_PREFER_OPENBLAS AND NOT EL_PREFER_BLIS_LAPACK) - set(SCALAPACK_LIBS ${SCALAPACK_BASE} "-framework Accelerate") - else() - if((EL_DISABLE_OPENBLAS OR EL_PREFER_BLIS_LAPACK) - AND NOT EL_DISABLE_BLIS_LAPACK) - set(EL_BUILT_BLIS_LAPACK TRUE) - else() - set(EL_BUILT_OPENBLAS TRUE) - endif() - endif() - - # NOTE: This is such a mess...sorry - if(EL_BUILT_OPENBLAS) - add_library(libopenblas ${LIBRARY_TYPE} IMPORTED) - El_library_name(openblas_name openblas) - set(OPENBLAS_LIB ${install_dir}/lib/${openblas_name}) - set_property(TARGET libopenblas PROPERTY - IMPORTED_LOCATION ${OPENBLAS_LIB}) - - set(EL_BUILT_OPENBLAS TRUE) - set(SCALAPACK_LIBS ${SCALAPACK_BASE} ${OPENBLAS_LIB}) - elseif(EL_BUILT_BLIS_LAPACK) - add_library(liblapack ${LIBRARY_TYPE} IMPORTED) - El_library_name(lapack_name lapack) - set(LAPACK_LIB ${install_dir}/lib/${lapack_name}) - set_property(TARGET liblapack PROPERTY IMPORTED_LOCATION ${LAPACK_LIB}) - - add_library(libblis ${LIBRARY_TYPE} IMPORTED) - El_library_name(blis_name blis) - set(BLIS_LIB ${install_dir}/lib/${blis_name}) - set_property(TARGET libblis PROPERTY IMPORTED_LOCATION ${BLIS_LIB}) - - set(EL_BUILT_BLIS_LAPACK TRUE) - set(SCALAPACK_LIBS ${SCALAPACK_BASE} ${LAPACK_LIB} ${BLIS_LIB}) - endif() - - set(EXTERNAL_LIBS ${EXTERNAL_LIBS} ${SCALAPACK_LIBS}) - set(EL_BUILT_SCALAPACK TRUE) - set(EL_HAVE_SCALAPACK TRUE) -else() - set(EL_BUILT_SCALAPACK FALSE) - set(EL_HAVE_SCALAPACK FALSE) -endif() diff --git a/cmake/external_projects/MPICH.cmake b/cmake/external_projects/MPICH.cmake deleted file mode 100644 index 14babd49ba..0000000000 --- a/cmake/external_projects/MPICH.cmake +++ /dev/null @@ -1,72 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -include(ExternalProject) -include(ElLibraryName) - -# NOTE: There is no test for MPICH since it will be assumed that tests/MPI -# was already run (and did not find MPI) - -# NOTE: This is untested and not yet used by Elemental, as querying for the -# flags used by MPICH is non-trivial and might be best hard-coded for -# different architectures. - -if(MSVC) - set(EL_HAVE_MPICH FALSE) - set(EL_BUILT_MPICH FALSE) -else() - if(NOT DEFINED MPICH_URL) - set(MPICH_URL http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz) - endif() - message(STATUS "Will download MPICH tarball from ${MPICH_URL}") - - set(MPICH_SOURCE_DIR ${PROJECT_BINARY_DIR}/download/mpich/source) - set(MPICH_BINARY_DIR ${PROJECT_BINARY_DIR}/download/mpich/build) - if(CMAKE_Fortran_COMPILER) - set(TRY_TO_PASS_FC --FC=${CMAKE_Fortran_COMPILER}) - else() - set(TRY_TO_PASS_FC --disable-fortran) - endif() - - ExternalProject_Add(project_mpich - PREFIX ${CMAKE_INSTALL_PREFIX} - URL ${MPICH_URL} - STAMP_DIR ${MPICH_BINARY_DIR}/stamp - BUILD_IN_SOURCE 1 - SOURCE_DIR ${MPICH_SOURCE_DIR} - TMP_DIR ${MPICH_BINARY_DIR}/tmp - INSTALL_DIR ${CMAKE_INSTALL_PREFIX} - CONFIGURE_COMMAND ${MPICH_SOURCE_DIR}/configure --prefix= --CC=${CMAKE_C_COMPILER} --CXX=${CMAKE_CXX_COMPILER} ${TRY_TO_PASS_FC} - UPDATE_COMMAND "" - BUILD_COMMAND ${CMAKE_MAKE_PROGRAM} - INSTALL_COMMAND ${CMAKE_MAKE_PROGRAM} install - ) - - # Extract the installation directory - ExternalProject_Get_Property(project_mpich install_dir) - - # Add targets for mpich (either shared or static) - # TODO: Fortran libraries? - add_library(libmpi ${LIBRARY_TYPE} IMPORTED) - add_library(libpmpi ${LIBRARY_TYPE} IMPORTED) - add_library(libmpicxx ${LIBRARY_TYPE} IMPORTED) - El_library_name(mpi_name mpi) - El_library_name(pmpi_name pmpi) - El_library_name(mpicxx_name mpicxx) - set(MPICH_LIB ${install_dir}/lib/${mpi_name}) - set(MPICH_PMPI_LIB ${install_dir}/lib/${pmpi_name}) - set(MPICH_CXX_LIB ${install_dir}/lib/${mpicxx_name}) - set_property(TARGET libmpi PROPERTY IMPORTED_LOCATION ${MPICH_LIB}) - set_property(TARGET libpmpi PROPERTY IMPORTED_LOCATION ${MPICH_PMPI_LIB}) - set_property(TARGET libmpicxx PROPERTY IMPORTED_LOCATION ${MPICH_CXX_LIB}) - - set(MPI_C_LIBRARIES ${MPICH_LIB} ${MPICH_PMPI_LIB}) - set(MPI_CXX_LIBRARIES ${MPICH_CXX_LIB} ${MPICH_LIB} ${MPICH_PMPI_LIB}) - set(EL_HAVE_MPICH TRUE) - set(EL_BUILT_MPICH TRUE) -endif() diff --git a/cmake/modules/ElCheckCSourceCompiles.cmake b/cmake/modules/ElCheckCSourceCompiles.cmake deleted file mode 100644 index 05cd92c5e3..0000000000 --- a/cmake/modules/ElCheckCSourceCompiles.cmake +++ /dev/null @@ -1,139 +0,0 @@ -#.rst: -# ElCheckCSourceCompiles -# ---------------------- -# -# Check if given C source compiles and links into an executable -# -# CHECK_C_SOURCE_COMPILES( [FAIL_REGEX ]) -# -# :: -# -# - source code to try to compile, must define 'main' -# - variable to store whether the source code compiled -# Will be created as an internal cache variable. -# - fail if test output matches this regex -# -# The following variables may be set before calling this macro to modify -# the way the check is run: -# -# :: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# CMAKE_REQUIRED_LIBRARIES = list of libraries to link -# CMAKE_REQUIRED_QUIET = execute quietly without messages - -# CMake - Cross Platform Makefile Generator -# Copyright 2000-2015 Kitware, Inc. -# Copyright 2000-2011 Insight Software Consortium -# 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. -# -# - -# Copyright 2015, Jack Poulson -# All rights reserved. - -macro(EL_CHECK_C_SOURCE_COMPILES SOURCE VAR) - if(NOT DEFINED "${VAR}") - set(_FAIL_REGEX) - set(_key) - foreach(arg ${ARGN}) - if("${arg}" MATCHES "^(FAIL_REGEX)$") - set(_key "${arg}") - elseif(_key) - list(APPEND _${_key} "${arg}") - else() - message(FATAL_ERROR "Unknown argument:\n ${arg}\n") - endif() - endforeach() - set(MACRO_CHECK_FUNCTION_DEFINITIONS - "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") - if(CMAKE_REQUIRED_LINKER_FLAGS) - set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}) - else() - set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS) - endif() - if(CMAKE_REQUIRED_LIBRARIES) - set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES - LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) - else() - set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) - endif() - if(CMAKE_REQUIRED_INCLUDES) - set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else() - set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) - endif() - file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" - "${SOURCE}\n") - - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR}") - endif() - try_compile(${VAR} - ${CMAKE_BINARY_DIR} - ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - ${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES} - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS} - "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) - - foreach(_regex ${_FAIL_REGEX}) - if("${OUTPUT}" MATCHES "${_regex}") - set(${VAR} 0) - endif() - endforeach() - - if(${VAR}) - set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Success") - endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" - "${OUTPUT}\n" - "Source file was:\n${SOURCE}\n") - else() - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Performing Test ${VAR} - Failed") - endif() - set(${VAR} "" CACHE INTERNAL "Test ${VAR}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" - "${OUTPUT}\n" - "Source file was:\n${SOURCE}\n") - endif() - endif() -endmacro() diff --git a/cmake/modules/ElCheckFunctionExists.cmake b/cmake/modules/ElCheckFunctionExists.cmake deleted file mode 100644 index 0204e8cab3..0000000000 --- a/cmake/modules/ElCheckFunctionExists.cmake +++ /dev/null @@ -1,115 +0,0 @@ -#.rst: -# ElCheckFunctionExists -# --------------------- -# -# Check if a C function can be linked -# -# EL_CHECK_FUNCTION_EXISTS( ) -# -# Check that the is provided by libraries on the system and -# store the result in a . This does not verify that any -# system header file declares the function, only that it can be found at -# link time (consider using CheckSymbolExists). -# will be created as an internal cache variable. -# -# The following variables may be set before calling this macro to modify -# the way the check is run: -# -# :: -# -# CMAKE_REQUIRED_FLAGS = string of compile command line flags -# CMAKE_REQUIRED_LINKER_FLAGS = list of linking command line flags -# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) -# CMAKE_REQUIRED_INCLUDES = list of include directories -# CMAKE_REQUIRED_LIBRARIES = list of libraries to link -# CMAKE_REQUIRED_QUIET = execute quietly without messages - -# CMake - Cross Platform Makefile Generator -# Copyright 2000-2015 Kitware, Inc. -# Copyright 2000-2011 Insight Software Consortium -# 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. -# -# - -# Copyright 2015, Jack Poulson -# All rights reserved. - -macro(EL_CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) - if(NOT DEFINED "${VARIABLE}" OR "x${${VARIABLE}}" STREQUAL "x${VARIABLE}") - set(MACRO_CHECK_FUNCTION_DEFINITIONS - "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION}") - endif() - if(CMAKE_REQUIRED_LINKER_FLAGS) - set(CHECK_FUNCTION_EXISTS_ADD_LINKER_FLAGS -DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}) - else() - set(CHECK_FUNCTION_EXISTS_ADD_LINKER_FLAGS) - endif() - if(CMAKE_REQUIRED_LIBRARIES) - set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES - LINK_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) - else() - set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) - endif() - if(CMAKE_REQUIRED_INCLUDES) - set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") - else() - set(CHECK_FUNCTION_EXISTS_ADD_INCLUDES) - endif() - try_compile(${VARIABLE} - ${CMAKE_BINARY_DIR} - ${CMAKE_ROOT}/Modules/CheckFunctionExists.c - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} - ${CHECK_FUNCTION_EXISTS_ADD_LIBRARIES} - CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_FUNCTION_EXISTS_ADD_LINKER_FLAGS} - "${CHECK_FUNCTION_EXISTS_ADD_INCLUDES}" - OUTPUT_VARIABLE OUTPUT) - if(${VARIABLE}) - set(${VARIABLE} 1 CACHE INTERNAL "Have function ${FUNCTION}") - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} - found") - endif() - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the function ${FUNCTION} exists passed with the following output:\n" - "${OUTPUT}\n\n") - else() - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${FUNCTION} - not found") - endif() - set(${VARIABLE} "" CACHE INTERNAL "Have function ${FUNCTION}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the function ${FUNCTION} exists failed with the following output:\n" - "${OUTPUT}\n\n") - endif() - endif() -endmacro() diff --git a/cmake/modules/ElLibraryName.cmake b/cmake/modules/ElLibraryName.cmake deleted file mode 100644 index 70693629bd..0000000000 --- a/cmake/modules/ElLibraryName.cmake +++ /dev/null @@ -1,17 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -macro(EL_LIBRARY_NAME FULLNAME BASENAME) - if(BUILD_SHARED_LIBS) - set(${FULLNAME} - ${CMAKE_SHARED_LIBRARY_PREFIX}${BASENAME}${CMAKE_SHARED_LIBRARY_SUFFIX}) - else() - set(${FULLNAME} - ${CMAKE_STATIC_LIBRARY_PREFIX}${BASENAME}${CMAKE_STATIC_LIBRARY_SUFFIX}) - endif() -endmacro() diff --git a/cmake/modules/ElSetParentScope.cmake b/cmake/modules/ElSetParentScope.cmake deleted file mode 100644 index 4c8e6d5b25..0000000000 --- a/cmake/modules/ElSetParentScope.cmake +++ /dev/null @@ -1,13 +0,0 @@ -# -# Copyright 2009-2016, Jack Poulson -# All rights reserved. -# -# This file is part of Elemental and is under the BSD 2-Clause License, -# which can be found in the LICENSE file in the root directory, or at -# http://opensource.org/licenses/BSD-2-Clause -# -macro(EL_SET_PARENT_SCOPE) - foreach(VAR ${ARGN}) - set(VAR ${VAR} PARENT_SCOPE) - endforeach() -endmacro() diff --git a/cmake/modules/FindAndVerifyExtendedPrecision.cmake b/cmake/modules/FindAndVerifyExtendedPrecision.cmake new file mode 100644 index 0000000000..9e99454f1b --- /dev/null +++ b/cmake/modules/FindAndVerifyExtendedPrecision.cmake @@ -0,0 +1,66 @@ +include(CheckCXXSourceCompiles) + +if (NOT UPPER_PROJECT_NAME) + string(TOUPPER "${PROJECT_NAME}" UPPER_PROJECT_NAME) +endif () + +# Check for quad-precision support +# ================================ +if(${PROJECT_NAME}_ENABLE_QUADMATH) + find_package(Quadmath) + + if (Quadmath_FOUND) + set(${UPPER_PROJECT_NAME}_HAVE_QUADMATH TRUE) + list(APPEND EXTENDED_PRECISION_LIBRARIES "${QUADMATH_LIBRARIES}") + else() + message(WARNING "libquadmath requested but not found. Disabling.") + set(${UPPER_PROJECT_NAME}_HAVE_QUADMATH FALSE) + endif() +endif() + +# Check for QD +# ============ +if (${PROJECT_NAME}_ENABLE_QD) + find_package(QD) + + if (QD_FOUND) + set(${UPPER_PROJECT_NAME}_HAVE_QD TRUE) + list(APPEND EXTENDED_PRECISION_LIBRARIES "${QD_LIBRARIES}") + else () + message(WARNING "QD requested but not found. Disabling.") + set(${UPPER_PROJECT_NAME}_HAVE_QD FALSE) + endif() +endif() + +# Check for GMP, MPFR, *and* MPC support +# ====================================== +if (${PROJECT_NAME}_ENABLE_MPC) + if (NOT EL_HAVE_MPI_LONG_LONG) + message("Disabling MPFR since MPI_LONG_LONG was not detected") + set(${PROJECT_NAME}_ENABLE_MPC OFF) + else () + set(GMP_REQUIRED_VERSION "6.0.0") + set(MPFR_REQUIRED_VERSION "3.1.0") + set(MPC_REQUIRED_VERSION "1.0.0") + + find_package(MPC "${MPC_REQUIRED_VERSION}") + if (MPC_FOUND) + set(${UPPER_PROJECT_NAME}_HAVE_GMP TRUE) + set(${UPPER_PROJECT_NAME}_HAVE_MPFR TRUE) + set(${UPPER_PROJECT_NAME}_HAVE_MPC TRUE) + list(APPEND EXTENDED_PRECISION_LIBRARIES "${MPC_LIBRARIES}") + else () + message(WARNING "MPC requested but not found. Disabling.") + set(${UPPER_PROJECT_NAME}_HAVE_GMP FALSE) + set(${UPPER_PROJECT_NAME}_HAVE_MPFR FALSE) + set(${UPPER_PROJECT_NAME}_HAVE_MPC FALSE) + endif (MPC_FOUND) + endif (NOT EL_HAVE_MPI_LONG_LONG) +endif (${PROJECT_NAME}_ENABLE_MPC) + +if (NOT TARGET EP::extended_precision) + add_library(EP::extended_precision INTERFACE IMPORTED) + + set_property(TARGET EP::extended_precision + PROPERTY INTERFACE_LINK_LIBRARIES ${EXTENDED_PRECISION_LIBRARIES}) +endif (NOT TARGET EP::extended_precision) diff --git a/cmake/modules/FindAndVerifyLAPACK.cmake b/cmake/modules/FindAndVerifyLAPACK.cmake new file mode 100644 index 0000000000..74dd609767 --- /dev/null +++ b/cmake/modules/FindAndVerifyLAPACK.cmake @@ -0,0 +1,184 @@ +# This will handle the logic surrounding BLAS/LAPACK +# +# Options that affect the choices made here: +# +# BLA_VENDOR -- If set, use this value and ignore all other options. +# Hydrogen_USE_MKL -- If set, look for MKL installations. +# Hydrogen_USE_OpenBLAS -- If set, look for OpenBLAS implementation. +# Hydrogen_USE_ACCELERATE -- If set, skip other searches in favor of +# Apple's accelerate framework +# Hydrogen_USE_GENERIC_LAPACK -- If set, skip other searches in +# favor of a generic LAPACK library +# Hydrogen_GENERAL_LAPACK_FALLBACK -- If set and no other LAPACK +# library has been found, this will call "find_package(LAPACK)" +# with all influential variables to that module cleared. +# +# In addition to the variables set by the standard FindBLAS and +# FindLAPACK modules, this module also defines the IMPORTED library +# "LAPACK::lapack" and might output the variable +# +# HYDROGEN_BLAS_SUFFIX -- Only defined if BLAS requires a suffix, usually "_". +# HYDROGEN_LAPACK_SUFFIX -- Only defined if LAPACK requires a suffix, usually "_". +# +# This will prioritize BLA_VENDOR, MKL, OpenBLAS, Apple, Generic, and +# setting multiple options above will cause a short-circuit if any are +# found in that order. +# +# Ultimately, this boils down to repeated calls to +# "find_package(LAPACK)" with changes to the environment. These calls, +# of course, can be avoided if LAPACK_LIBRARIES and related variables +# are set on the command line. + +if (NOT UPPER_PROJECT_NAME) + string(TOUPPER "${PROJECT_NAME}" UPPER_PROJECT_NAME) +endif () + +# Check straight-away if BLA_VENDOR is already set +if (BLA_VENDOR) + find_package(LAPACK QUIET) +endif (BLA_VENDOR) + +# Check for MKL +# TODO (trb 10.26.2017): add LP model support if 64bit indices +if (${PROJECT_NAME}_USE_MKL AND NOT LAPACK_FOUND) + set(BLA_VENDOR "Intel10_64") + find_package(LAPACK QUIET) +endif (${PROJECT_NAME}_USE_MKL AND NOT LAPACK_FOUND) + +# Check for OpenBLAS +if (${PROJECT_NAME}_USE_OpenBLAS AND NOT LAPACK_FOUND) + set(BLA_VENDOR "OpenBLAS") + set(LAPACK_DIR "${OpenBLAS_DIR}") + set(BLAS_DIR "${OpenBLAS_DIR}") + find_package(LAPACK) + + # Build OpenBLAS if requested + if (NOT LAPACK_FOUND) + + find_package(OpenBLAS NO_MODULE REQUIRED + PATH_SUFFIXES lib/cmake/openblas) + + # FIXME: So it looks like this might be the only way to trick the + # FindLAPACK module?? Another possibility is that we just say that + # LAPACK_FOUND=BLAS_FOUND=OpenBLAS_FOUND, + # LAPACK_LIBRARIES=BLAS_LIBRARIES=OpenBLAS_LIBRARIES, and no + # {BLAS,LAPACK}_LINK_FLAGS. + get_filename_component(_openblas_lib_dir "${OpenBLAS_LIBRARIES}" DIRECTORY) + if (APPLE) + set(_tmp_ld_path $ENV{DYLD_LIBRARY_PATH}) + set(ENV{DYLD_LIBRARY_PATH} "${_openblas_lib_dir}:$ENV{DYLD_LIBRARY_PATH}") + find_package(LAPACK REQUIRED) + set(ENV{DYLD_LIBRARY_PATH} "${_tmp_ld_path}") + else () + set(_tmp_ld_path $ENV{LD_LIBRARY_PATH}) + set(ENV{LD_LIBRARY_PATH} "${_openblas_lib_dir}:$ENV{LD_LIBRARY_PATH}") + find_package(LAPACK REQUIRED) + set(ENV{LD_LIBRARY_PATH} "${_tmp_ld_path}") + endif () + endif() + set(${UPPER_PROJECT_NAME}_HAVE_OPENBLAS ${LAPACK_FOUND}) +endif (${PROJECT_NAME}_USE_OpenBLAS AND NOT LAPACK_FOUND) + +# Set the flag here +set(EL_HAVE_OPENBLAS ${${UPPER_PROJECT_NAME}_HAVE_OPENBLAS}) + +# Check for Accelerate +if (APPLE AND ${PROJECT_NAME}_USE_ACCELERATE AND NOT LAPACK_FOUND) + set(BLA_VENDOR "Apple") + find_package(LAPACK QUIET) +endif (APPLE AND ${PROJECT_NAME}_USE_ACCELERATE AND NOT LAPACK_FOUND) + +# Check for a generic lapack build +if (${PROJECT_NAME}_USE_GENERIC_LAPACK AND NOT LAPACK_FOUND) + set(BLA_VENDOR "Generic") + find_package(LAPACK QUIET) +endif (${PROJECT_NAME}_USE_GENERIC_LAPACK AND NOT LAPACK_FOUND) + +# Check for a fallback if requested +if (${PROJECT_NAME}_GENERAL_LAPACK_FALLBACK AND NOT LAPACK_FOUND) + set(BLA_VENDOR "All") + find_package(LAPACK QUIET) +endif (${PROJECT_NAME}_GENERAL_LAPACK_FALLBACK AND NOT LAPACK_FOUND) + +find_package(LAPACK) + +# Wrap-up +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(HydrogenLAPACK + DEFAULT_MSG + LAPACK_FOUND LAPACK_LIBRARIES) + +if (LAPACK_FOUND) + message(STATUS "Found LAPACK: ${LAPACK_LIBRARIES}") +else () + message(FATAL_ERROR "No LAPACK library found!") +endif () + +# Define the imported target +if (NOT TARGET LAPACK::lapack) + add_library(LAPACK::lapack INTERFACE IMPORTED) + + # This only uses the LAPACK_* variables. LAPACK_LIBRARIES _should_ + # include BLAS_LIBRARIES and LAPACK_LINKER_FLAGS _should_ include + # BLAS_LINKER_FLAGS. If it is ever discovered that this isn't true, + # it can be fixed. + if (LAPACK_LINKER_FLAGS) + if (UNIX)# Or we could force CMake 3.9 and use NATIVE_COMMAND! + separate_arguments(__link_flags UNIX_COMMAND "${LAPACK_LINKER_FLAGS}") + else () + separate_arguments(__link_flags WINDOWS_COMMAND "${LAPACK_LINKER_FLAGS}") + endif () + endif () + list(APPEND __link_flags "${LAPACK_LIBRARIES}") + + set_property(TARGET LAPACK::lapack PROPERTY + INTERFACE_LINK_LIBRARIES "${__link_flags}") + +endif (NOT TARGET LAPACK::lapack) + +# Detect the suffix +include(CheckFunctionExists) + +set(CMAKE_REQUIRED_LIBRARIES "${BLAS_LINKER_FLAGS}" "${BLAS_LIBRARIES}") +check_function_exists(dgemm BLAS_NO_USE_UNDERSCORE) +check_function_exists(dgemm_ BLAS_USE_UNDERSCORE) + +set(CMAKE_REQUIRED_LIBRARIES "${LAPACK_LINKER_FLAGS}" "${LAPACK_LIBRARIES}") +check_function_exists(dlacpy LAPACK_NO_USE_UNDERSCORE) +check_function_exists(dlacpy_ LAPACK_USE_UNDERSCORE) + +# If both dgemm and dgemm_ are found, don't use the suffix +if (BLAS_NO_USE_UNDERSCORE) + unset(${UPPER_PROJECT_NAME}_BLAS_SUFFIX) + message(STATUS "Using BLAS with no symbol mangling.") +elseif (BLAS_USE_UNDERSCORE) + set(${UPPER_PROJECT_NAME}_BLAS_SUFFIX "_") + message(STATUS "Using BLAS with trailing underscore.") +else () + message(FATAL_ERROR "Could not determine BLAS suffix!") +endif () + +set(${UPPER_PROJECT_NAME}_HAVE_LAPACK ON) +if (LAPACK_NO_USE_UNDERSCORE) + unset(${UPPER_PROJECT_NAME}_LAPACK_SUFFIX) + message(STATUS "Using LAPACK with no symbol mangling.") +elseif (LAPACK_USE_UNDERSCORE) + set(${UPPER_PROJECT_NAME}_LAPACK_SUFFIX "_") + message(STATUS "Using LAPACK with trailing underscore.") +else () + message(STATUS + "Could not find LAPACK's copy function. Disabling LAPACK support.") + set(${UPPER_PROJECT_NAME}_HAVE_LAPACK) +endif () + +if (NOT ${UPPER_PROJECT_NAME}_HAVE_LAPACK) + message(FATAL_ERROR "LAPACK support is currently required.") +endif () + +# Check a few MKL features +check_function_exists(mkl_dcsrmv ${UPPER_PROJECT_NAME}_HAVE_MKL) +if (${UPPER_PROJECT_NAME}_HAVE_MKL) + check_function_exists(dgemmt ${UPPER_PROJECT_NAME}_HAVE_MKL_GEMMT) + check_function_exists(dgemmt_ ${UPPER_PROJECT_NAME}_HAVE_MKL_GEMMT) +endif () +set(CMAKE_REQUIRED_LIBRARIES) diff --git a/cmake/modules/FindAndVerifyMPI.cmake b/cmake/modules/FindAndVerifyMPI.cmake new file mode 100644 index 0000000000..bc9af6ea94 --- /dev/null +++ b/cmake/modules/FindAndVerifyMPI.cmake @@ -0,0 +1,150 @@ +# +# Copyright 2009-2016, Jack Poulson +# All rights reserved. +# +# This file is part of Elemental and is under the BSD 2-Clause License, +# which can be found in the LICENSE file in the root directory, or at +# http://opensource.org/licenses/BSD-2-Clause +# +include(CheckCXXSourceCompiles) + +find_package(MPI 3.0 REQUIRED COMPONENTS CXX) +if (MPI_CXX_FOUND) + if (NOT TARGET MPI::MPI_CXX) + add_library(MPI::MPI_CXX INTERFACE IMPORTED) + if (MPI_CXX_COMPILE_FLAGS) + separate_arguments(_MPI_CXX_COMPILE_OPTIONS UNIX_COMMAND + "${MPI_CXX_COMPILE_FLAGS}") + set_property(TARGET MPI::MPI_CXX PROPERTY + INTERFACE_COMPILE_OPTIONS "${_MPI_CXX_COMPILE_OPTIONS}") + endif() + + if(MPI_CXX_LINK_FLAGS) + separate_arguments(_MPI_CXX_LINK_LINE UNIX_COMMAND + "${MPI_CXX_LINK_FLAGS}") + endif() + + set_property(TARGET MPI::MPI_CXX APPEND PROPERTY + INTERFACE_LINK_LIBRARIES "${MPI_CXX_LIBRARIES}") + + set_property(TARGET MPI::MPI_CXX APPEND PROPERTY + LINK_FLAGS "${_MPI_CXX_LINK_LINE}") + + set_property(TARGET MPI::MPI_CXX APPEND PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${MPI_CXX_INCLUDE_PATH}") + + endif (NOT TARGET MPI::MPI_CXX) +else() + message(FATAL_ERROR "MPI CXX compiler was not found and is required") +endif() + +# Fix the imported target + +# FIXME (trb): We should split the library into language-specific +# targets. That is, the .cu files should never need MPI linkage or +# OpenMP, so they should be built into a separate target without +# MPI::MPI_CXX or OpenMP::OpenMP_CXX "linkage". +get_target_property( + __mpi_compile_options MPI::MPI_CXX INTERFACE_COMPILE_OPTIONS) +if (__mpi_compile_options) + set_property(TARGET MPI::MPI_CXX PROPERTY + INTERFACE_COMPILE_OPTIONS + $<$:${__mpi_compile_options}>) + unset(__mpi_compile_options) +endif () + +get_property(_TMP_MPI_LINK_LIBRARIES TARGET MPI::MPI_CXX + PROPERTY INTERFACE_LINK_LIBRARIES) +foreach(lib IN LISTS _TMP_MPI_LINK_LIBRARIES) + if ("${lib}" MATCHES "-Wl*") + list(APPEND _MPI_LINK_FLAGS "${lib}") + else() + list(APPEND _MPI_LINK_LIBRARIES "${lib}") + endif () +endforeach() + +#set_property(TARGET MPI::MPI_CXX PROPERTY LINK_FLAGS ${_MPI_LINK_FLAGS}) +set_property(TARGET MPI::MPI_CXX + PROPERTY INTERFACE_LINK_LIBRARIES ${_MPI_LINK_LIBRARIES}) + +set(CMAKE_REQUIRED_FLAGS "${MPI_CXX_COMPILE_FLAGS}") +set(CMAKE_REQUIRED_LINKER_FLAGS "${MPI_CXX_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") +set(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH}) +set(CMAKE_REQUIRED_LIBRARIES ${MPI_CXX_LIBRARIES}) + +# These are a few checks to determine if we're using one of the common +# MPI libraries. This might matter for some atrocities we might commit +# with respect to synchronizing CUDA streams with the MPI library. +set(MPI_IS_OPEN_MPI_VARIANT_CODE + "#include + int main(int argc, char** argv) + { + int is_open_mpi = OPEN_MPI; + return !is_open_mpi; + }") +check_cxx_source_compiles("${MPI_IS_OPENMPI_VARIANT_CODE}" + HYDROGEN_MPI_IS_OPENMPI) + +set(MPI_IS_MVAPICH2_VARIANT_CODE + "#include + #include + int main(int argc, char** argv) + { + std::cout << MVAPICH2_VERSION << std::endl; + return 0; + }") +check_cxx_source_compiles("${MPI_IS_MVAPICH2_VARIANT_CODE}" + HYDROGEN_MPI_IS_MVAPICH2) + +# Check for CUDA-aware MPI +set(HYDROGEN_ENSURE_HOST_MPI_BUFFERS ON) +if (HYDROGEN_HAVE_CUDA + AND (HYDROGEN_MPI_IS_OPENMPI OR HYDROGEN_MPI_IS_MVAPICH2)) + + if (HYDROGEN_MPI_IS_OPENMPI) + set(MPI_IS_CUDA_AWARE_CODE + "#include + #include + int main(int argc, char** argv) + { + int has_mpi_support = MPIX_CUDA_AWARE_SUPPORT; + return !has_mpi_support; + }") + check_cxx_source_compiles("${MPI_IS_CUDA_AWARE_CODE}" + HYDROGEN_HAVE_CUDA_AWARE_MPI) + + elseif (HYDROGEN_MPI_IS_MVAPICH2) + set(MPI_IS_CUDA_AWARE_CODE + "#include + #include + extern cudaStream_t stream_d2h; + int main(int argc, char** argv) + { + if (stream_d2h) + return 0; + else + return 0; + }") + set(CMAKE_REQUIRED_INCLUDES ${MPI_CXX_INCLUDE_PATH} ${CUDA_INCLUDE_DIRS}) + check_cxx_source_compiles("${MPI_IS_CUDA_AWARE_CODE}" + HYDROGEN_HAVE_CUDA_AWARE_MPI) + + endif () + + if (NOT HYDROGEN_HAVE_CUDA_AWARE_MPI) + message(STATUS + "Cannot detect CUDA-aware MPI. Support disabled.") + else() + if (NOT Hydrogen_AVOID_CUDA_AWARE_MPI) + message(STATUS "Assuming CUDA-aware MPI.") + set(HYDROGEN_ENSURE_HOST_MPI_BUFFERS OFF) + else () + message(STATUS "CUDA-aware MPI detected but not used.") + endif () + endif () +endif () + +set(CMAKE_REQUIRED_FLAGS) +set(CMAKE_REQUIRED_LINKER_FLAGS) +set(CMAKE_REQUIRED_INCLUDES) +set(CMAKE_REQUIRED_LIBRARIES) diff --git a/cmake/modules/FindAndVerifyOpenMP.cmake b/cmake/modules/FindAndVerifyOpenMP.cmake new file mode 100644 index 0000000000..8f0d3649ce --- /dev/null +++ b/cmake/modules/FindAndVerifyOpenMP.cmake @@ -0,0 +1,139 @@ +include(CheckCXXSourceCompiles) + +# Attempt to use the built-in module +find_package(OpenMP COMPONENTS CXX) + +if (NOT OpenMP_FOUND AND CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + find_library(_OpenMP_LIBRARY + NAMES omp gomp iomp5md + HINTS ${OpenMP_DIR} $ENV{OpenMP_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The libomp library.") + find_library(_OpenMP_LIBRARY + NAMES omp gomp iomp5md) + mark_as_advanced(_OpenMP_LIBRARY) + + if (NOT _OpenMP_LIBRARY) + message(FATAL_ERROR "No OpenMP library found.") + else () + + get_filename_component(_OpenMP_LIB_DIR "${_OpenMP_LIBRARY}" DIRECTORY) + + if (${_OpenMP_LIBRARY} MATCHES "libomp") + set(OpenMP_libomp_LIBRARY ${_OpenMP_LIBRARY} + CACHE PATH "The OpenMP omp library.") + set(OpenMP_CXX_LIB_NAMES omp) + set(OpenMP_CXX_FLAGS "-fopenmp=libomp") + set(OpenMP_omp_LIBRARY "${_OpenMP_LIBRARY}") + elseif (${_OpenMP_LIBRARY} MATCHES "libgomp") + set(OpenMP_libgomp_LIBRARY ${_OpenMP_LIBRARY} + CACHE PATH "The OpenMP gomp library.") + set(OpenMP_CXX_LIB_NAMES gomp) + set(OpenMP_CXX_FLAGS "-fopenmp") + set(OpenMP_gomp_LIBRARY "${_OpenMP_LIBRARY}") + elseif (${_OpenMP_LIBRARY} MATCHES "libiomp5md") + set(OpenMP_libiomp5md_LIBRARY ${_OpenMP_LIBRARY} + CACHE PATH "The OpenMP iomp5md library.") + set(OpenMP_CXX_LIB_NAMES iomp5md) + set(OpenMP_CXX_FLAGS "-fopenmp=libiomp5") + set(OpenMP_iomp5md_LIBRARY "${_OpenMP_LIBRARY}") + endif () + + # Let's try this again + find_package(OpenMP COMPONENTS CXX) + if (OpenMP_CXX_FOUND) + if (CMAKE_VERSION VERSION_GREATER 3.13.0) + target_link_directories( + OpenMP::OpenMP_CXX INTERFACE "${_OpenMP_LIB_DIR}") + else () + # This isn't great, but it should work. The better solution is + # to use a version of CMake that is at least 3.13.0. + set_property(TARGET OpenMP::OpenMP_CXX APPEND + PROPERTY INTERFACE_LINK_LIBRARIES "-L${_OpenMP_LIB_DIR}") + endif () + endif () + endif (NOT _OpenMP_LIBRARY) +endif () + +set(_OPENMP_TEST_SOURCE + " +#include +int main() { +#pragma omp parallel +{ + int x = omp_get_num_threads(); +} +}") + +include(CheckCXXSourceCompiles) +set(CMAKE_REQUIRED_FLAGS "${OpenMP_CXX_FLAGS}") +set(CMAKE_REQUIRED_LIBRARIES OpenMP::OpenMP_CXX) +check_cxx_source_compiles("${_OPENMP_TEST_SOURCE}" _OPENMP_TEST_COMPILES) + +get_target_property(_OMP_FLAGS OpenMP::OpenMP_CXX INTERFACE_COMPILE_OPTIONS) +set_property(TARGET OpenMP::OpenMP_CXX PROPERTY + INTERFACE_COMPILE_OPTIONS $<$:${_OMP_FLAGS}>) + +set(OpenMP_FOUND ${_OPENMP_TEST_COMPILES}) + +if (OpenMP_FOUND) + set(EL_HAVE_OPENMP TRUE) +else () + set(EL_HAVE_OPENMP FALSE) +endif () + +if (EL_HAVE_OPENMP) + set(OMP_COLLAPSE_CODE + "#include + int main( int argc, char* argv[] ) + { + int k[100]; + #pragma omp parallel for collapse(2) + for( int i=0; i<10; ++i ) + for( int j=0; j<10; ++j ) + k[i+j*10] = i+j; + return 0; + }") + check_cxx_source_compiles("${OMP_COLLAPSE_CODE}" EL_HAVE_OMP_COLLAPSE) + + set(OMP_SIMD_CODE + "#include + int main( int argc, char* argv[] ) + { + int k[10]; + #pragma omp simd + for( int i=0; i<10; ++i ) + k[i] = i; + return 0; + }") + check_cxx_source_compiles("${OMP_SIMD_CODE}" EL_HAVE_OMP_SIMD) + + # See if we have 'taskloop' support, which was introduced in OpenMP 4.0 + if (${PROJECT_NAME}_ENABLE_OMP_TASKLOOP) + set(OMP_TASKLOOP_CODE + "#include + int main( int argc, char* argv[] ) + { + int k[10]; + #pragma omp taskloop + for( int i=0; i<10; ++i ) + k[i] = i; + return 0; + }") + check_cxx_source_compiles("${OMP_TASKLOOP_CODE}" HYDROGEN_HAVE_OMP_TASKLOOP) + set(${PROJECT_NAME}_ENABLE_OMP_TASKLOOP ${HYDROGEN_HAVE_OMP_TASKLOOP}) + else () + set(HYDROGEN_HAVE_OMP_TASKLOOP FALSE) + set(${PROJECT_NAME}_ENABLE_OMP_TASKLOOP FALSE) + endif () +else () + set(HYDROGEN_HAVE_OMP_TASKLOOP FALSE) + set(EL_HAVE_OMP_SIMD FALSE) + set(EL_HAVE_OMP_COLLAPSE FALSE) + set(Hydrogen_ENABLE_OMP_TASKLOOP FALSE) +endif (EL_HAVE_OPENMP) + +set(CMAKE_REQUIRED_FLAGS) +set(CMAKE_REQUIRED_LIBRARIES) +set(CMAKE_REQUIRED_LINK_OPTIONS) diff --git a/cmake/modules/FindCUB.cmake b/cmake/modules/FindCUB.cmake new file mode 100644 index 0000000000..345fafc8e4 --- /dev/null +++ b/cmake/modules/FindCUB.cmake @@ -0,0 +1,44 @@ +# Exports the following variables +# +# CUB_FOUND +# CUB_INCLUDE_PATH +# CUB_LIBRARIES +# +# Also adds the following imported target: +# +# cuda::cub +# + +find_path(CUB_INCLUDE_PATH cub/cub.cuh + HINTS ${CUB_DIR} $ENV{CUB_DIR} ${CUDA_TOOLKIT_ROOT_DIR} ${CUDA_SDK_ROOT_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "The CUB header directory." + ) +find_path(CUB_INCLUDE_PATH cub/cub.cuh) + +# Standard handling of the package arguments +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CUB + DEFAULT_MSG CUB_INCLUDE_PATH) + +# Setup the imported target +if (NOT TARGET cuda::cub) + add_library(cuda::cub INTERFACE IMPORTED) +endif (NOT TARGET cuda::cub) + +# Set the include directories for the target +if (CUB_INCLUDE_PATH) + set_property(TARGET cuda::cub + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CUB_INCLUDE_PATH}) +endif () + +# +# Cleanup +# + +# Set the include directories +mark_as_advanced(FORCE CUB_INCLUDE_PATH) + +# Set the libraries +set(CUB_LIBRARIES cuda::cub) diff --git a/cmake/modules/FindCXXFeatures.cmake b/cmake/modules/FindCXXFeatures.cmake deleted file mode 100644 index 69418bdddb..0000000000 --- a/cmake/modules/FindCXXFeatures.cmake +++ /dev/null @@ -1,206 +0,0 @@ -#.rst: -# FindCXXFeatures -# --------------- -# -# Check which features of the C++ standard the compiler supports -# -# When found it will set the following variables:: -# -# CXX11_COMPILER_FLAGS - the compiler flags needed to get C++11 features -# CXX14_COMPILER_FLAGS - the compiler flags needed to get C++14 features -# -# CXXFeatures_auto_FOUND - auto keyword -# CXXFeatures_class_override_final_FOUND - override and final keywords for classes and methods -# CXXFeatures_constexpr_FOUND - constexpr keyword -# CXXFeatures_cstdint_header_FOUND - cstdint header -# CXXFeatures_decltype_FOUND - decltype keyword -# CXXFeatures_defaulted_functions_FOUND - default keyword for functions -# CXXFeatures_delegating_constructors_FOUND - delegating constructors -# CXXFeatures_deleted_functions_FOUND - delete keyword for functions -# CXXFeatures_func_identifier_FOUND - __func__ preprocessor constant -# CXXFeatures_initializer_list_FOUND - initializer list -# CXXFeatures_lambda_FOUND - lambdas -# CXXFeatures_long_long_FOUND - long long signed & unsigned types -# CXXFeatures_nullptr_FOUND - nullptr -# CXXFeatures_rvalue_references_FOUND - rvalue references -# CXXFeatures_sizeof_member_FOUND - sizeof() non-static members -# CXXFeatures_static_assert_FOUND - static_assert() -# CXXFeatures_variadic_templates_FOUND - variadic templates - -#============================================================================= -# Copyright 2011-2013 Rolf Eike Beer -# Copyright 2012 Andreas Weis -# Copyright 2013 Jan Kundrát -# Copyright 2016 Jack Poulson -# -# 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 name of the owner nor the names of its 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. -#============================================================================= - -if(NOT CMAKE_CXX_COMPILER_LOADED) - message(FATAL_ERROR - "CXXFeatures modules only works if language CXX is enabled") -endif() - -# Check for needed compiler flags -include(CheckCXXCompilerFlag) - -function(test_11_flags FLAG NAME) - check_cxx_compiler_flag("${FLAG}" _HAS_${NAME}_FLAG) - if(_HAS_${NAME}_FLAG) - set(CXX11_COMPILER_FLAGS "${FLAG}" PARENT_SCOPE) - endif() -endfunction() - -function(test_14_flags FLAG NAME) - check_cxx_compiler_flag("${FLAG}" _HAS_${NAME}_FLAG) - if(_HAS_${NAME}_FLAG) - set(CXX14_COMPILER_FLAGS "${FLAG}" PARENT_SCOPE) - endif() -endfunction() - -if(CMAKE_CXX_COMPILER_ID STREQUAL "XL") - test_11_flags("-qlanglvl=extended0x" CXX11) - test_14_flags("-qlanglvl=extended1y" CXX14) -elseif (CMAKE_CXX_COMPILER_ID MATCHES "(Borland|Watcom)") - # No C++11 or C++14 flag for those compilers, but check_cxx_compiler_flag() - # can't detect because they either will not always complain (Borland) - # or will hang (Watcom). -elseif (CMAKE_CXX_COMPILER_ID MATCHES "Cray") - test_11_flags("-h std=c++11" CXX11) - test_14_flags("-h std=c++14" CXX14) - if(NOT CXX14_COMPILER_FLAGS) - message(FATAL_ERROR "Could not use -h std=c++14 with Cray C/C++") - endif() -elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Intel" AND WIN32) - # The Intel compiler on Windows may use these flags. - test_11_flags("/Qstd=c++11" CXX11) - test_14_flags("/Qstd=c++14" CXX14) -elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - # GCC needs -std=gnu++11 or -std=gnu++14 for the libquadmath literals; - # Intel does not - test_11_flags("-std=gnu++11" CXX11) - test_14_flags("-std=gnu++14" CXX14) - if(NOT CXX14_COMPILER_FLAGS) - message(FATAL_ERROR "Could not use -std=gnu++14 with GCC") - endif() -else() - test_11_flags("-std=c++11" CXX11) - test_14_flags("-std=c++14" CXX14) - if(NOT CXX14_COMPILER_FLAGS) - message(FATAL_ERROR "Could not use -std=c++14 with unknown compiler") - endif() -endif() - -# TODO(poulson): Extend to test C++14 features such as [[deprecated]] -function(cxx_check_feature FEATURE_NAME) - set(RESULT_VAR "CXXFeatures_${FEATURE_NAME}_FOUND") - if(DEFINED ${RESULT_VAR}) - return() - endif() - - set(_bindir "${CMAKE_CURRENT_BINARY_DIR}/cxx_${FEATURE_NAME}") - - set(_SRCFILE_BASE ${CMAKE_CURRENT_LIST_DIR}/FindCXXFeatures/cxx11-${FEATURE_NAME}) - set(_LOG_NAME "\"${FEATURE_NAME}\"") - message(STATUS "Checking C++ support for ${_LOG_NAME}") - - set(_SRCFILE "${_SRCFILE_BASE}.cxx") - set(_SRCFILE_FAIL_COMPILE "${_SRCFILE_BASE}_fail_compile.cxx") - - try_compile(${RESULT_VAR} "${_bindir}" "${_SRCFILE}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}" - OUTPUT_VARIABLE _SRCFILE_COMPILE_PASS_OUTPUT) - - if(${RESULT_VAR} AND EXISTS ${_SRCFILE_FAIL_COMPILE}) - try_compile(_TMP_RESULT "${_bindir}_fail_compile" "${_SRCFILE_FAIL_COMPILE}" - COMPILE_DEFINITIONS "${CXX11_COMPILER_FLAGS}" - OUTPUT_VARIABLE _SRCFILE_COMPILE_FAIL_OUTPUT) - if(_TMP_RESULT) - set(${RESULT_VAR} FALSE) - else() - set(${RESULT_VAR} TRUE) - endif() - endif() - - if(${RESULT_VAR}) - message(STATUS "Checking C++ support for ${_LOG_NAME}: works") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Checking C++ support for ${_LOG_NAME} passed.\n" - "Compile pass output:\n${_SRCFILE_COMPILE_PASS_OUTPUT}\n" - "Compile fail output:\n${_SRCFILE_COMPILE_FAIL_OUTPUT}\n") - else() - message(STATUS "Checking C++ support for ${_LOG_NAME}: not supported") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Checking C++ support for ${_LOG_NAME} failed.\n" - "Compile pass output:\n${_SRCFILE_COMPILE_PASS_OUTPUT}\n" - "Compile fail output:\n${_SRCFILE_COMPILE_FAIL_OUTPUT}\n") - endif() - set(${RESULT_VAR} "${${RESULT_VAR}}" CACHE INTERNAL - "C++ support for ${_LOG_NAME}") -endfunction(cxx_check_feature) - -set(_CXX_ALL_FEATURES - auto - class_override_final - constexpr - cstdint_header - decltype - defaulted_functions - delegating_constructors - deleted_functions - func_identifier - initializer_list - lambda - long_long - nullptr - rvalue_references - sizeof_member - static_assert - variadic_templates -) - -if (CXXFeatures_FIND_COMPONENTS) - foreach (_cxx_feature IN LISTS CXXFeatures_FIND_COMPONENTS) - list(FIND _CXX_ALL_FEATURES "${_cxx_feature}" _feature_index) - if (_feature_index EQUAL -1) - message(FATAL_ERROR "Unknown component: '${_cxx_feature}'") - endif () - endforeach () - unset(_feature_index) -else () - set(CXXFEATURES_FIND_COMPONENTS ${_CXX_ALL_FEATURES}) -endif () - -foreach (_cxx_feature IN LISTS CXXFEATURES_FIND_COMPONENTS) - cxx_check_feature(${_cxx_feature} ${FEATURE_NAME}) -endforeach (_cxx_feature) - -include(FindPackageHandleStandardArgs) -set(DUMMY_VAR TRUE) -find_package_handle_standard_args(CXXFeatures REQUIRED_VARS DUMMY_VAR HANDLE_COMPONENTS) -unset(DUMMY_VAR) -unset(_CXX_ALL_FEATURES) diff --git a/cmake/modules/FindCXXFeatures/cxx11-auto.cxx b/cmake/modules/FindCXXFeatures/cxx11-auto.cxx deleted file mode 100644 index 19491e69ef..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-auto.cxx +++ /dev/null @@ -1,11 +0,0 @@ -int main() -{ - auto i = 5; - auto f = 3.14159f; - auto d = 3.14159; - bool ret = ( - (sizeof(f) < sizeof(d)) && - (sizeof(i) == sizeof(int)) - ); - return ret ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-auto_fail_compile.cxx b/cmake/modules/FindCXXFeatures/cxx11-auto_fail_compile.cxx deleted file mode 100644 index ac152d518d..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-auto_fail_compile.cxx +++ /dev/null @@ -1,7 +0,0 @@ -int main(void) -{ - // must fail because there is no initializer - auto i; - - return 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-class_override_final.cxx b/cmake/modules/FindCXXFeatures/cxx11-class_override_final.cxx deleted file mode 100644 index 5e938ff30e..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-class_override_final.cxx +++ /dev/null @@ -1,21 +0,0 @@ -class base { -public: - virtual int foo(int a) - { return 4 + a; } - virtual int bar(int a) final - { return a - 2; } -}; - -class sub final : public base { -public: - virtual int foo(int a) override - { return 8 + 2 * a; }; -}; - -int main(void) -{ - base b; - sub s; - - return (b.foo(2) * 2 == s.foo(2)) ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-class_override_final_fail_compile.cxx b/cmake/modules/FindCXXFeatures/cxx11-class_override_final_fail_compile.cxx deleted file mode 100644 index bc00b278ed..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-class_override_final_fail_compile.cxx +++ /dev/null @@ -1,25 +0,0 @@ -class base { -public: - virtual int foo(int a) - { return 4 + a; } - virtual int bar(int a) final - { return a - 2; } -}; - -class sub final : public base { -public: - virtual int foo(int a) override - { return 8 + 2 * a; }; - virtual int bar(int a) - { return a; } -}; - -class impossible : public sub { }; - -int main(void) -{ - base b; - sub s; - - return 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-constexpr.cxx b/cmake/modules/FindCXXFeatures/cxx11-constexpr.cxx deleted file mode 100644 index ba66d655c1..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-constexpr.cxx +++ /dev/null @@ -1,19 +0,0 @@ -constexpr int square(int x) -{ - return x * x; -} - -constexpr int the_answer() -{ - return 42; -} - -int main() -{ - int test_arr[square(3)]; - bool ret = ( - (square(the_answer()) == 1764) && - (sizeof(test_arr)/sizeof(test_arr[0]) == 9) - ); - return ret ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-cstdint_header.cxx b/cmake/modules/FindCXXFeatures/cxx11-cstdint_header.cxx deleted file mode 100644 index d02e93c350..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-cstdint_header.cxx +++ /dev/null @@ -1,11 +0,0 @@ -#include - -int main() -{ - bool test = - (sizeof(int8_t) == 1) && - (sizeof(int16_t) == 2) && - (sizeof(int32_t) == 4) && - (sizeof(int64_t) == 8); - return test ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-decltype.cxx b/cmake/modules/FindCXXFeatures/cxx11-decltype.cxx deleted file mode 100644 index ce33089c11..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-decltype.cxx +++ /dev/null @@ -1,10 +0,0 @@ -bool check_size(int i) -{ - return sizeof(int) == sizeof(decltype(i)); -} - -int main() -{ - bool ret = check_size(42); - return ret ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-defaulted_functions.cxx b/cmake/modules/FindCXXFeatures/cxx11-defaulted_functions.cxx deleted file mode 100644 index c7ca5b8944..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-defaulted_functions.cxx +++ /dev/null @@ -1,13 +0,0 @@ -struct A { - int foo; - - A(int foo): foo(foo) {} - A() = default; -}; - -int main(void) -{ - A bar; - A baz(10); - return 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-delegating_constructors.cxx b/cmake/modules/FindCXXFeatures/cxx11-delegating_constructors.cxx deleted file mode 100644 index e2f6abdb83..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-delegating_constructors.cxx +++ /dev/null @@ -1,25 +0,0 @@ -class del { -public: - del(); - del(int k); - - int m_k; -}; - -del::del() - : del(42) -{ -} - -del::del(int k) - : m_k(k) -{ -} - -int main() -{ - del q(41); - del a; - - return a.m_k - q.m_k - 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-deleted_functions.cxx b/cmake/modules/FindCXXFeatures/cxx11-deleted_functions.cxx deleted file mode 100644 index c1ec2b994d..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-deleted_functions.cxx +++ /dev/null @@ -1,10 +0,0 @@ -struct A { - A() = delete; - A(int) {} -}; - -int main(void) -{ - A bar(10); - return 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-deleted_functions_fail_compile.cxx b/cmake/modules/FindCXXFeatures/cxx11-deleted_functions_fail_compile.cxx deleted file mode 100644 index 216f074704..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-deleted_functions_fail_compile.cxx +++ /dev/null @@ -1,18 +0,0 @@ -struct A { - A() = delete; - ~A() = delete; - int m; - int ret(); -}; - -int A::ret() -{ - return 2 * m; -} - -int main(void) -{ - A bar; - bar.m = 1; - return bar.ret(); -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-func_identifier.cxx b/cmake/modules/FindCXXFeatures/cxx11-func_identifier.cxx deleted file mode 100644 index e29273b639..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-func_identifier.cxx +++ /dev/null @@ -1,10 +0,0 @@ -#include - -int main(void) -{ - if (!__func__) - return 1; - if (!(*__func__)) - return 1; - return strstr(__func__, "main") != 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-initializer_list.cxx b/cmake/modules/FindCXXFeatures/cxx11-initializer_list.cxx deleted file mode 100644 index a23e962fd4..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-initializer_list.cxx +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include - -class seq { -public: - seq(std::initializer_list list); - - int length() const; -private: - std::vector m_v; -}; - -seq::seq(std::initializer_list list) - : m_v(list) -{ -} - -int seq::length() const -{ - return m_v.size(); -} - -int main(void) -{ - seq a = {18, 20, 2, 0, 4, 7}; - - return (a.length() == 6) ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-lambda.cxx b/cmake/modules/FindCXXFeatures/cxx11-lambda.cxx deleted file mode 100644 index a302b2f3ab..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-lambda.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - int ret = 0; - return ([&ret]() -> int { return ret; })(); -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-long_long.cxx b/cmake/modules/FindCXXFeatures/cxx11-long_long.cxx deleted file mode 100644 index 3fa59fbc90..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-long_long.cxx +++ /dev/null @@ -1,7 +0,0 @@ -int main(void) -{ - long long l; - unsigned long long ul; - - return ((sizeof(l) >= 8) && (sizeof(ul) >= 8)) ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-nullptr.cxx b/cmake/modules/FindCXXFeatures/cxx11-nullptr.cxx deleted file mode 100644 index 317f4710f6..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-nullptr.cxx +++ /dev/null @@ -1,19 +0,0 @@ -int func(int) -{ - return 1; -} - -int func(void *) -{ - return 0; -} - -int main(void) -{ - void *v = nullptr; - - if (v) - return 1; - - return func(nullptr); -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-nullptr_fail_compile.cxx b/cmake/modules/FindCXXFeatures/cxx11-nullptr_fail_compile.cxx deleted file mode 100644 index adfd24f657..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-nullptr_fail_compile.cxx +++ /dev/null @@ -1,6 +0,0 @@ -int main(void) -{ - int i = nullptr; - - return 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-rvalue_references.cxx b/cmake/modules/FindCXXFeatures/cxx11-rvalue_references.cxx deleted file mode 100644 index e6e7e5a98a..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-rvalue_references.cxx +++ /dev/null @@ -1,57 +0,0 @@ -#include - -class rvmove { -public: - void *ptr; - char *array; - - rvmove() - : ptr(0), - array(new char[10]) - { - ptr = this; - } - - rvmove(rvmove &&other) - : ptr(other.ptr), - array(other.array) - { - other.array = 0; - other.ptr = 0; - } - - ~rvmove() - { - assert(((ptr != 0) && (array != 0)) || ((ptr == 0) && (array == 0))); - delete[] array; - } - - rvmove &operator=(rvmove &&other) - { - delete[] array; - ptr = other.ptr; - array = other.array; - other.array = 0; - other.ptr = 0; - return *this; - } - - static rvmove create() - { - return rvmove(); - } -private: - rvmove(const rvmove &); - rvmove &operator=(const rvmove &); -}; - -int main() -{ - rvmove mine; - if (mine.ptr != &mine) - return 1; - mine = rvmove::create(); - if (mine.ptr == &mine) - return 1; - return 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-sizeof_member.cxx b/cmake/modules/FindCXXFeatures/cxx11-sizeof_member.cxx deleted file mode 100644 index 8aebc554f4..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-sizeof_member.cxx +++ /dev/null @@ -1,14 +0,0 @@ -struct foo { - char bar; - int baz; -}; - -int main(void) -{ - bool ret = ( - (sizeof(foo::bar) == 1) && - (sizeof(foo::baz) >= sizeof(foo::bar)) && - (sizeof(foo) >= sizeof(foo::bar) + sizeof(foo::baz)) - ); - return ret ? 0 : 1; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-static_assert.cxx b/cmake/modules/FindCXXFeatures/cxx11-static_assert.cxx deleted file mode 100644 index 5976cfce52..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-static_assert.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main(void) -{ - static_assert(0 < 1, "your ordering of integers is screwed"); - return 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-static_assert_fail_compile.cxx b/cmake/modules/FindCXXFeatures/cxx11-static_assert_fail_compile.cxx deleted file mode 100644 index 484abc0a87..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-static_assert_fail_compile.cxx +++ /dev/null @@ -1,5 +0,0 @@ -int main(void) -{ - static_assert(1 < 0, "your ordering of integers is screwed"); - return 0; -} diff --git a/cmake/modules/FindCXXFeatures/cxx11-variadic_templates.cxx b/cmake/modules/FindCXXFeatures/cxx11-variadic_templates.cxx deleted file mode 100644 index e81ca9db0c..0000000000 --- a/cmake/modules/FindCXXFeatures/cxx11-variadic_templates.cxx +++ /dev/null @@ -1,23 +0,0 @@ -int Accumulate() -{ - return 0; -} - -template -int Accumulate(T v, Ts... vs) -{ - return v + Accumulate(vs...); -} - -template -int CountElements() -{ - return sizeof...(Is); -} - -int main() -{ - int acc = Accumulate(1, 2, 3, 4, -5); - int count = CountElements<1,2,3,4,5>(); - return ((acc == 5) && (count == 5)) ? 0 : 1; -} diff --git a/cmake/modules/FindGMP.cmake b/cmake/modules/FindGMP.cmake index 96d4a55e03..c2622814ca 100644 --- a/cmake/modules/FindGMP.cmake +++ b/cmake/modules/FindGMP.cmake @@ -1,76 +1,92 @@ -# Try to find the GMP library -# https://gmplib.org/ +# Sets the following variables: # -# This module supports requiring a minimum version, e.g. you can do -# find_package(GMP 6.0.0) -# to require version 6.0.0 to newer of GMP. -# -# Once done this will define -# -# GMP_FOUND - system has GMP lib with correct version -# GMP_INCLUDES - the GMP include directory -# GMP_LIBRARIES - the GMP library -# GMP_VERSION - GMP version -# -# Copyright (c) 2016 Jack Poulson, -# Redistribution and use is allowed according to the terms of the BSD license. +# GMP_FOUND +# GMP_VERSION_OK +# GMP_INCLUDE_DIR -- Location of gmp.h +# GMP_LIBRARIES -- libgmp library -find_path(GMP_INCLUDES NAMES gmp.h PATHS $ENV{GMPDIR} ${INCLUDE_INSTALL_DIR}) +if (GMP_FIND_VERSION_COUNT EQUAL 0) + if (GMP_REQUIRED_VERSION) + set(GMP_FIND_VERSION "${GMP_REQUIRED_VERSION}") + else () + set(GMP_FIND_VERSION "5.1.1") + endif () +endif () -# Set GMP_FIND_VERSION to 5.1.0 if no minimum version is specified -if(NOT GMP_FIND_VERSION) - if(NOT GMP_FIND_VERSION_MAJOR) - set(GMP_FIND_VERSION_MAJOR 5) - endif() - if(NOT GMP_FIND_VERSION_MINOR) - set(GMP_FIND_VERSION_MINOR 1) - endif() - if(NOT GMP_FIND_VERSION_PATCH) - set(GMP_FIND_VERSION_PATCH 0) - endif() - set(GMP_FIND_VERSION - "${GMP_FIND_VERSION_MAJOR}.${GMP_FIND_VERSION_MINOR}.${GMP_FIND_VERSION_PATCH}") -endif() +find_path(GMP_INCLUDE_DIR gmp.h + HINTS ${GMP_DIR} $ENV{GMP_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "Directory with gmp.h header.") +find_path(GMP_INCLUDE_DIR gmp.h) + +find_library(GMP_LIBRARY gmp + HINTS ${GMP_DIR} $ENV{GMP_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The GMP library.") +find_library(GMP_LIBRARY gmp) -message("GMP_INCLUDES=${GMP_INCLUDES}") -if(GMP_INCLUDES) - # Since the GMP version macros may be in a file included by gmp.h of the form - # gmp-.*[_]?.*.h (e.g., gmp-x86_64.h), we search each of them. - file(GLOB GMP_HEADERS "${GMP_INCLUDES}/gmp.h" "${GMP_INCLUDES}/gmp-*.h") - foreach(gmp_header_filename ${GMP_HEADERS}) - file(READ "${gmp_header_filename}" _gmp_version_header) - string(REGEX MATCH - "define[ \t]+__GNU_MP_VERSION[ \t]+([0-9]+)" _gmp_major_version_match - "${_gmp_version_header}") - if(_gmp_major_version_match) - set(GMP_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_MINOR[ \t]+([0-9]+)" - _gmp_minor_version_match "${_gmp_version_header}") - set(GMP_MINOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+__GNU_MP_VERSION_PATCHLEVEL[ \t]+([0-9]+)" - _gmp_patchlevel_version_match "${_gmp_version_header}") - set(GMP_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") - set(GMP_VERSION - ${GMP_MAJOR_VERSION}.${GMP_MINOR_VERSION}.${GMP_PATCHLEVEL_VERSION}) - endif() - endforeach() +if (GMP_LIBRARY AND GMP_INCLUDE_DIR) + + set(GMP_VERSION_CODE " +#include +#include \"gmp.h\" +int main(void) +{ + gmp_randstate_t randState; + gmp_randinit_default( randState ); + const long seed = 1024; + gmp_randseed_ui( randState, seed ); - # Check whether found version exists and exceeds the minimum requirement - if(NOT GMP_VERSION) - set(GMP_VERSION_OK FALSE) - message(STATUS "GMP version was not detected") - elseif(${GMP_VERSION} VERSION_LESS ${GMP_FIND_VERSION}) - set(GMP_VERSION_OK FALSE) - message(STATUS "GMP version ${GMP_VERSION} found in ${GMP_INCLUDES}, " - "but at least version ${GMP_FIND_VERSION} is required") - else() - set(GMP_VERSION_OK TRUE) + std::cout << gmp_version; +}") + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" + "${GMP_VERSION_CODE}\n") + + if(NOT GMP_FIND_QUIETLY) + message(STATUS "Performing Test GMP_VERSION_COMPILES") endif() -endif() + + try_run(GMP_VERSION_RUNS GMP_VERSION_COMPILES + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx + LINK_LIBRARIES "${GMP_LIBRARY}" + CMAKE_FLAGS + -DCOMPILE_DEFINITIONS=-DGMP_VERSION_COMPILES + "-DINCLUDE_DIRECTORIES=${GMP_INCLUDE_DIR}" + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} + COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT + RUN_OUTPUT_VARIABLE RUN_OUTPUT) -find_library(GMP_LIBRARIES gmp PATHS $ENV{GMPDIR} ${LIB_INSTALL_DIR}) + if (NOT GMP_VERSION_RUNS STREQUAL "FAILED_TO_RUN") + if (RUN_OUTPUT VERSION_LESS GMP_FIND_VERSION) + set(GMP_VERSION_OK FALSE) + else () + set(GMP_VERSION_FOUND "${RUN_OUTPUT}") + set(GMP_VERSION_OK TRUE) + endif () + else () + + message(WARNING "Found libgmp but could compile with it.") + + endif (NOT GMP_VERSION_RUNS STREQUAL "FAILED_TO_RUN") +endif (GMP_LIBRARY AND GMP_INCLUDE_DIR) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(GMP DEFAULT_MSG - GMP_INCLUDES GMP_LIBRARIES GMP_VERSION_OK) -mark_as_advanced(GMP_INCLUDES GMP_LIBRARIES) + GMP_VERSION_FOUND GMP_LIBRARY GMP_INCLUDE_DIR GMP_VERSION_OK) + +if (GMP_FOUND) + if (NOT TARGET EP::gmp) + add_library(EP::gmp INTERFACE IMPORTED) + + set_property(TARGET EP::gmp + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${GMP_INCLUDE_DIR}") + set_property(TARGET EP::gmp + PROPERTY INTERFACE_LINK_LIBRARIES "${GMP_LIBRARY}") + endif () + + set(GMP_LIBRARIES EP::gmp) + mark_as_advanced(GMP_LIBRARY GMP_INCLUDE_DIR) +endif (GMP_FOUND) diff --git a/cmake/modules/FindHALF.cmake b/cmake/modules/FindHALF.cmake new file mode 100644 index 0000000000..508768c220 --- /dev/null +++ b/cmake/modules/FindHALF.cmake @@ -0,0 +1,61 @@ +# Exports the following variables +# +# HALF_FOUND +# HALF_INCLUDE_PATH +# HALF_LIBRARIES +# +# Also adds the following imported target: +# +# half::half +# + +find_path(HALF_INCLUDE_PATH half.hpp + HINTS ${HALF_DIR} $ENV{HALF_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "The HALF header directory." + ) +find_path(HALF_INCLUDE_PATH half.hpp) + +include(CheckCXXSourceCompiles) +set(_half_verify_code + "#ifndef HALF_ENABLE_F16C_INTRINSICS +#define HALF_ENABLE_F16C_INTRINSICS __F16C__ +#endif + +#include +int main(int, char**) +{ + half_float::half x + = half_float::half_cast(9.0); +}") +set(CMAKE_REQUIRED_INCLUDES ${HALF_INCLUDE_PATH}) +check_cxx_source_compiles( + "${_half_verify_code}" HALF_HEADER_OK) +set(CMAKE_REQUIRED_INCLUDES) + +# Standard handling of the package arguments +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(HALF + DEFAULT_MSG HALF_INCLUDE_PATH HALF_HEADER_OK) + +# Setup the imported target +if (HALF_FOUND) + if (NOT TARGET half::half) + add_library(half::half INTERFACE IMPORTED) + endif (NOT TARGET half::half) + + # Set the include directories for the target + set_property(TARGET half::half + PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${HALF_INCLUDE_PATH}) + + # Set the libraries + set(HALF_LIBRARIES half::half) +endif (HALF_FOUND) + +# +# Cleanup +# + +# Set the include directories +mark_as_advanced(FORCE HALF_INCLUDE_PATH) diff --git a/cmake/modules/FindMETIS.cmake b/cmake/modules/FindMETIS.cmake deleted file mode 100644 index a2727d8d2a..0000000000 --- a/cmake/modules/FindMETIS.cmake +++ /dev/null @@ -1,129 +0,0 @@ -# - Try to find METIS -# Once done this will define -# -# METIS_FOUND - system has METIS -# METIS_INCLUDE_DIRS - include directories for METIS -# METIS_LIBRARIES - libraries for METIS -# -# Variables used by this module. They can change the default behaviour and -# need to be set before calling find_package: -# -# METIS_DIR - Prefix directory of the METIS installation -# METIS_INCLUDE_DIR - Include directory of the METIS installation -# (set only if different from ${METIS_DIR}/include) -# METIS_LIB_DIR - Library directory of the METIS installation -# (set only if different from ${METIS_DIR}/lib) -# METIS_TEST_RUNS - Skip tests building and running a test -# executable linked against METIS libraries -# METIS_LIB_SUFFIX - Also search for non-standard library names with the -# given suffix appended -# -# NOTE: This file was modified from a ParMETIS detection script - -#============================================================================= -# Copyright (C) 2015 Jack Poulson. All rights reserved. -# -# Copyright (C) 2010-2012 Garth N. Wells, Anders Logg, Johannes Ring -# and Florian Rathgeber. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. 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. -# -# 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. -#============================================================================= - -if(NOT METIS_INCLUDE_DIR) - find_path(METIS_INCLUDE_DIR metis.h - HINTS ${METIS_INCLUDE_DIR} ENV METIS_INCLUDE_DIR ${METIS_DIR} ENV METIS_DIR - PATH_SUFFIXES include - DOC "Directory where the METIS header files are located" - ) -endif() - -if(METIS_LIBRARIES) - set(METIS_LIBRARY ${METIS_LIBRARIES}) -endif() -if(NOT METIS_LIBRARY) - find_library(METIS_LIBRARY - NAMES metis metis${METIS_LIB_SUFFIX} - HINTS ${METIS_LIB_DIR} ENV METIS_LIB_DIR ${METIS_DIR} ENV METIS_DIR - PATH_SUFFIXES lib - DOC "Directory where the METIS library is located" - ) -endif() - -# Get METIS version -if(NOT METIS_VERSION_STRING AND METIS_INCLUDE_DIR AND EXISTS "${METIS_INCLUDE_DIR}/metis.h") - set(version_pattern "^#define[\t ]+METIS_(MAJOR|MINOR)_VERSION[\t ]+([0-9\\.]+)$") - file(STRINGS "${METIS_INCLUDE_DIR}/metis.h" metis_version REGEX ${version_pattern}) - - foreach(match ${metis_version}) - if(METIS_VERSION_STRING) - set(METIS_VERSION_STRING "${METIS_VERSION_STRING}.") - endif() - string(REGEX REPLACE ${version_pattern} "${METIS_VERSION_STRING}\\2" METIS_VERSION_STRING ${match}) - set(METIS_VERSION_${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) - endforeach() - unset(metis_version) - unset(version_pattern) -endif() - -# Try compiling and running test program -if(METIS_INCLUDE_DIR AND METIS_LIBRARY) - - # Set flags for building test program - set(CMAKE_REQUIRED_INCLUDES ${METIS_INCLUDE_DIR}) - set(CMAKE_REQUIRED_LIBRARIES ${METIS_LIBRARY}) - - # Build and run test program - include(CheckCSourceRuns) - check_c_source_runs(" -#define METIS_EXPORT -#include \"metis.h\" -int main( int argc, char* argv[] ) -{ - // FIXME: Find a simple but sensible test for METIS - return 0; -} -" METIS_TEST_RUNS) - - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) -endif() - -# Standard package handling -include(FindPackageHandleStandardArgs) -if(CMAKE_VERSION VERSION_GREATER 2.8.2) - find_package_handle_standard_args(METIS - REQUIRED_VARS METIS_LIBRARY METIS_INCLUDE_DIR METIS_TEST_RUNS - VERSION_VAR METIS_VERSION_STRING) -else() - find_package_handle_standard_args(METIS - REQUIRED_VARS METIS_LIBRARY METIS_INCLUDE_DIR METIS_TEST_RUNS) -endif() - -if(METIS_FOUND) - set(METIS_LIBRARIES ${METIS_LIBRARY}) - set(METIS_INCLUDE_DIRS ${METIS_INCLUDE_DIR}) -endif() - -mark_as_advanced(METIS_INCLUDE_DIR METIS_LIBRARY) diff --git a/cmake/modules/FindMPC.cmake b/cmake/modules/FindMPC.cmake index 610a84bb0f..6a319de7aa 100644 --- a/cmake/modules/FindMPC.cmake +++ b/cmake/modules/FindMPC.cmake @@ -1,66 +1,114 @@ -# Try to find the MPC library -# See http://www.multiprecision.org/index.php?prog=mpc&page=home +# Sets the following variables: # -# This module supports requiring a minimum version, e.g. you can do -# find_package(MPC 1.0.3) -# to require version 1.0.3 to newer of MPC. -# -# Once done this will define -# -# MPC_FOUND - system has MPC lib with correct version -# MPC_INCLUDES - the MPC include directory -# MPC_LIBRARIES - the MPC library -# MPC_VERSION - MPC version +# MPC_FOUND +# MPC_VERSION_OK +# MPC_INCLUDE_DIR -- Location of mpfr.h +# MPC_LIBRARIES -- libmpfr library + +if (MPC_FIND_VERSION_COUNT EQUAL 0) + if (MPC_REQUIRED_VERSION) + set(MPC_FIND_VERSION "${MPC_REQUIRED_VERSION}") + else () + set(MPC_FIND_VERSION "1.0.0") + endif () +endif () + +if (MPC_FIND_QUIETLY) + set(__quiet_flag "QUIET") +else () + unset(__quiet_flag) +endif () +find_package(MPFR "${MPFR_REQUIRED_VERSION}" ${__quiet_flag}) -find_path(MPC_INCLUDES NAMES mpc.h PATHS $ENV{GMPDIR} $ENV{MPFRDIR} $ENV{MPCDIR} - ${INCLUDE_INSTALL_DIR}) +if (MPFR_FOUND) + find_path(MPC_INCLUDE_DIR mpc.h + HINTS ${MPC_DIR} $ENV{MPC_DIR} ${MPFR_DIR} $ENV{MPFR_DIR} + ${GMP_DIR} $ENV{GMP_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "Directory with mpc.h header.") + find_path(MPC_INCLUDE_DIR mpc.h) -# Set MPC_FIND_VERSION to 1.0.0 if no minimum version is specified -if(NOT MPC_FIND_VERSION) - if(NOT MPC_FIND_VERSION_MAJOR) - set(MPC_FIND_VERSION_MAJOR 1) - endif() - if(NOT MPC_FIND_VERSION_MINOR) - set(MPC_FIND_VERSION_MINOR 0) - endif() - if(NOT MPC_FIND_VERSION_PATCH) - set(MPC_FIND_VERSION_PATCH 0) - endif() - set(MPC_FIND_VERSION - "${MPC_FIND_VERSION_MAJOR}.${MPC_FIND_VERSION_MINOR}.${MPC_FIND_VERSION_PATCH}") -endif() + find_library(MPC_LIBRARY mpc + HINTS ${MPC_DIR} $ENV{MPC_DIR} ${MPFR_DIR} $ENV{MPFR_DIR} + ${GMP_DIR} $ENV{GMP_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The MPC library.") + find_library(MPC_LIBRARY mpc) -if(MPC_INCLUDES) - # Query MPC_VERSION - file(READ "${MPC_INCLUDES}/mpc.h" _mpc_version_header) + if (MPC_LIBRARY AND MPC_INCLUDE_DIR) + + set(MPC_VERSION_CODE " +#include +#include +#include +#include +int main(void) +{ + mpfr_t a; + mpfr_prec_t prec = 256; + mpfr_init2( a, prec ); - string(REGEX MATCH "define[ \t]+MPC_VERSION_MAJOR[ \t]+([0-9]+)" - _mpc_major_version_match "${_mpc_version_header}") - set(MPC_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+MPC_VERSION_MINOR[ \t]+([0-9]+)" - _mpc_minor_version_match "${_mpc_version_header}") - set(MPC_MINOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+MPC_VERSION_PATCHLEVEL[ \t]+([0-9]+)" - _mpc_patchlevel_version_match "${_mpc_version_header}") - set(MPC_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + mpc_t b; + mpc_init2( b, prec ); - set(MPC_VERSION - ${MPC_MAJOR_VERSION}.${MPC_MINOR_VERSION}.${MPC_PATCHLEVEL_VERSION}) + gmp_randstate_t randState; + gmp_randinit_default( randState ); + const long seed = 1024; + gmp_randseed_ui( randState, seed ); - # Check whether found version exceeds minimum required - if(${MPC_VERSION} VERSION_LESS ${MPC_FIND_VERSION}) - set(MPC_VERSION_OK FALSE) - message(STATUS "MPC version ${MPC_VERSION} found in ${MPC_INCLUDES}, " - "but at least version ${MPC_FIND_VERSION} is required") - else() - set(MPC_VERSION_OK TRUE) - endif() -endif(MPC_INCLUDES) + std::cout << mpc_get_version(); +}") + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" + "${MPC_VERSION_CODE}\n") + + if(NOT MPC_FIND_QUIETLY) + message(STATUS "Performing Test MPC_VERSION_COMPILES") + endif() -find_library(MPC_LIBRARIES mpc - PATHS $ENV{GMPDIR} $ENV{MPFRDIR} $ENV{MPCDIR} ${LIB_INSTALL_DIR}) + set(__include_dirs + "${MPC_INCLUDE_DIR}" "${MPFR_INCLUDE_DIR}" "${GMP_INCLUDE_DIR}") + try_run(MPC_VERSION_RUNS MPC_VERSION_COMPILES + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx + LINK_LIBRARIES "${MPC_LIBRARY}" "${MPFR_LIBRARY}" "${GMP_LIBRARY}" + CMAKE_FLAGS + -DCOMPILE_DEFINITIONS=-DMPC_VERSION_COMPILES + "-DINCLUDE_DIRECTORIES=${__include_dirs}" + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} + COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT + RUN_OUTPUT_VARIABLE RUN_OUTPUT) + + if (NOT MPC_VERSION_RUNS STREQUAL "FAILED_TO_RUN") + if (RUN_OUTPUT VERSION_LESS MPC_FIND_VERSION) + set(MPC_VERSION_OK FALSE) + else () + set(MPC_VERSION_FOUND "${RUN_OUTPUT}") + set(MPC_VERSION_OK TRUE) + endif () + else () + + message(WARNING "Found libmpfr but could compile with it.") + + endif (NOT MPC_VERSION_RUNS STREQUAL "FAILED_TO_RUN") + endif (MPC_LIBRARY AND MPC_INCLUDE_DIR) +endif (MPFR_FOUND) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MPC DEFAULT_MSG - MPC_INCLUDES MPC_LIBRARIES MPC_VERSION_OK) -mark_as_advanced(MPC_INCLUDES MPC_LIBRARIES) + MPC_VERSION_FOUND MPC_LIBRARY MPC_INCLUDE_DIR MPC_VERSION_OK) + +if (MPC_FOUND) + if (NOT TARGET EP::mpc) + add_library(EP::mpc INTERFACE IMPORTED) + + set_property(TARGET EP::mpc + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPC_INCLUDE_DIR}") + set_property(TARGET EP::mpc + PROPERTY INTERFACE_LINK_LIBRARIES "${MPC_LIBRARY}") + endif () + + set(MPC_LIBRARIES EP::mpc ${MPFR_LIBRARIES} ${GMP_LIBRARIES}) + mark_as_advanced(MPC_LIBRARY MPC_INCLUDE_DIR) +endif () diff --git a/cmake/modules/FindMPFR.cmake b/cmake/modules/FindMPFR.cmake index ebdbc55cbc..995fb3d61b 100644 --- a/cmake/modules/FindMPFR.cmake +++ b/cmake/modules/FindMPFR.cmake @@ -1,72 +1,106 @@ -# Try to find the MPFR library -# See http://www.mpfr.org/ +# Sets the following variables: # -# This module supports requiring a minimum version, e.g. you can do -# find_package(MPFR 2.3.0) -# to require version 2.3.0 to newer of MPFR. -# -# Once done this will define -# -# MPFR_FOUND - system has MPFR lib with correct version -# MPFR_INCLUDES - the MPFR include directory -# MPFR_LIBRARIES - the MPFR library -# MPFR_VERSION - MPFR version +# MPFR_FOUND +# MPFR_VERSION_OK +# MPFR_INCLUDE_DIR -- Location of mpfr.h +# MPFR_LIBRARIES -- libmpfr library -# Copyright (c) 2006, 2007 Montel Laurent, -# Copyright (c) 2008, 2009 Gael Guennebaud, -# Copyright (c) 2010 Jitse Niesen, -# Copyright (c) 2015 Jack Poulson, -# Redistribution and use is allowed according to the terms of the BSD license. +if (MPFR_FIND_VERSION_COUNT EQUAL 0) + if (MPFR_REQUIRED_VERSION) + set(MPFR_FIND_VERSION "${MPFR_REQUIRED_VERSION}") + else () + set(MPFR_FIND_VERSION "1.0.0") + endif () +endif () -find_path(MPFR_INCLUDES NAMES mpfr.h PATHS $ENV{GMPDIR} $ENV{MPFRDIR} - ${INCLUDE_INSTALL_DIR}) +if (MPFR_FIND_QUIETLY) + set(__quiet_flag "QUIET") +else () + unset(__quiet_flag) +endif () +find_package(GMP "${GMP_REQUIRED_VERSION}" ${__quiet_flag}) -# Set MPFR_FIND_VERSION to 1.0.0 if no minimum version is specified -if(NOT MPFR_FIND_VERSION) - if(NOT MPFR_FIND_VERSION_MAJOR) - set(MPFR_FIND_VERSION_MAJOR 1) - endif() - if(NOT MPFR_FIND_VERSION_MINOR) - set(MPFR_FIND_VERSION_MINOR 0) - endif() - if(NOT MPFR_FIND_VERSION_PATCH) - set(MPFR_FIND_VERSION_PATCH 0) - endif() - set(MPFR_FIND_VERSION - "${MPFR_FIND_VERSION_MAJOR}.${MPFR_FIND_VERSION_MINOR}.${MPFR_FIND_VERSION_PATCH}") -endif() +if (GMP_FOUND) + find_path(MPFR_INCLUDE_DIR mpfr.h + HINTS ${MPFR_DIR} $ENV{MPFR_DIR} ${GMP_DIR} $ENV{GMP_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "Directory with mpfr.h header.") + find_path(MPFR_INCLUDE_DIR mpfr.h) -if(MPFR_INCLUDES) - # Query MPFR_VERSION - file(READ "${MPFR_INCLUDES}/mpfr.h" _mpfr_version_header) + find_library(MPFR_LIBRARY mpfr + HINTS ${MPFR_DIR} $ENV{MPFR_DIR} ${GMP_DIR} $ENV{GMP_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The MPFR library.") + find_library(MPFR_LIBRARY mpfr) - string(REGEX MATCH "define[ \t]+MPFR_VERSION_MAJOR[ \t]+([0-9]+)" - _mpfr_major_version_match "${_mpfr_version_header}") - set(MPFR_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+MPFR_VERSION_MINOR[ \t]+([0-9]+)" - _mpfr_minor_version_match "${_mpfr_version_header}") - set(MPFR_MINOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+MPFR_VERSION_PATCHLEVEL[ \t]+([0-9]+)" - _mpfr_patchlevel_version_match "${_mpfr_version_header}") - set(MPFR_PATCHLEVEL_VERSION "${CMAKE_MATCH_1}") + if (MPFR_LIBRARY AND MPFR_INCLUDE_DIR) + + set(MPFR_VERSION_CODE " +#include +#include +#include +int main(void) +{ + mpfr_t a; + mpfr_prec_t prec = 256; + mpfr_init2( a, prec ); - set(MPFR_VERSION - ${MPFR_MAJOR_VERSION}.${MPFR_MINOR_VERSION}.${MPFR_PATCHLEVEL_VERSION}) + gmp_randstate_t randState; + gmp_randinit_default( randState ); + const long seed = 1024; + gmp_randseed_ui( randState, seed ); - # Check whether found version exceeds minimum required - if(${MPFR_VERSION} VERSION_LESS ${MPFR_FIND_VERSION}) - set(MPFR_VERSION_OK FALSE) - message(STATUS "MPFR version ${MPFR_VERSION} found in ${MPFR_INCLUDES}, " - "but at least version ${MPFR_FIND_VERSION} is required") - else() - set(MPFR_VERSION_OK TRUE) - endif() -endif() + std::cout << mpfr_get_version(); +}") + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx" + "${MPFR_VERSION_CODE}\n") + + if(NOT MPFR_FIND_QUIETLY) + message(STATUS "Performing Test MPFR_VERSION_COMPILES") + endif() + + try_run(MPFR_VERSION_RUNS MPFR_VERSION_COMPILES + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx + LINK_LIBRARIES "${MPFR_LIBRARY}" "${GMP_LIBRARY}" + CMAKE_FLAGS + -DCOMPILE_DEFINITIONS=-DMPFR_VERSION_COMPILES + "-DINCLUDE_DIRECTORIES=${MPFR_INCLUDE_DIR};${GMP_INCLUDE_DIR}" + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} + COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT + RUN_OUTPUT_VARIABLE RUN_OUTPUT) -find_library(MPFR_LIBRARIES mpfr - PATHS $ENV{GMPDIR} $ENV{MPFRDIR} ${LIB_INSTALL_DIR}) + if (NOT MPFR_VERSION_RUNS STREQUAL "FAILED_TO_RUN") + if (RUN_OUTPUT VERSION_LESS MPFR_FIND_VERSION) + set(MPFR_VERSION_OK FALSE) + else () + set(MPFR_VERSION_FOUND "${RUN_OUTPUT}") + set(MPFR_VERSION_OK TRUE) + endif () + else () + + message(WARNING "Found libmpfr but could compile with it.") + + endif (NOT MPFR_VERSION_RUNS STREQUAL "FAILED_TO_RUN") + endif (MPFR_LIBRARY AND MPFR_INCLUDE_DIR) +endif (GMP_FOUND) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MPFR DEFAULT_MSG - MPFR_INCLUDES MPFR_LIBRARIES MPFR_VERSION_OK) -mark_as_advanced(MPFR_INCLUDES MPFR_LIBRARIES) + MPFR_VERSION_FOUND MPFR_LIBRARY MPFR_INCLUDE_DIR MPFR_VERSION_OK) + +if (MPFR_FOUND) + if (NOT TARGET EP::mpfr) + add_library(EP::mpfr INTERFACE IMPORTED) + + set_property(TARGET EP::mpfr + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPFR_INCLUDE_DIR}") + set_property(TARGET EP::mpfr + PROPERTY INTERFACE_LINK_LIBRARIES "${MPFR_LIBRARY}") + endif () + + set(MPFR_LIBRARIES EP::mpfr ${GMP_LIBRARIES}) + mark_as_advanced(MPFR_LIBRARY MPFR_INCLUDE_DIR) +endif () diff --git a/cmake/modules/FindNVTX.cmake b/cmake/modules/FindNVTX.cmake new file mode 100644 index 0000000000..6fd72f0734 --- /dev/null +++ b/cmake/modules/FindNVTX.cmake @@ -0,0 +1,33 @@ +# Sets the following variables +# +# NVTX_FOUND +# NVTX_LIBRARY +# NVTX_LIBRARIES +# +# Defines the following imported target: +# +# cuda::nvtx +# + +find_library(NVTX_LIBRARY nvToolsExt + HINTS ${NVTX_DIR} $ENV{NVTX_DIR} ${CUDA_TOOLKIT_ROOT_DIR} ${CUDA_SDK_ROOT_DIR} + PATH_SUFFIXES lib64 lib + DOC "The nvtx library." + NO_DEFAULT_PATH) +find_library(NVTX_LIBRARY nvToolsExt) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(NVTX + DEFAULT_MSG NVTX_LIBRARY) + +add_library(cuda::nvtx INTERFACE IMPORTED) + +if (NVTX_FOUND) + set_property(TARGET cuda::nvtx PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${CUDA_INCLUDE_DIRS}") + + set_property(TARGET cuda::nvtx PROPERTY + INTERFACE_LINK_LIBRARIES "${NVTX_LIBRARY}") + + set(NVTX_LIBRARIES cuda::nvtx) +endif (NVTX_FOUND) diff --git a/cmake/modules/FindNumPy.cmake b/cmake/modules/FindNumPy.cmake deleted file mode 100644 index 1ce639e2b6..0000000000 --- a/cmake/modules/FindNumPy.cmake +++ /dev/null @@ -1,101 +0,0 @@ -# - Find the NumPy libraries -# This module finds if NumPy is installed, and sets the following variables -# indicating where it is. -# -# TODO: Update to provide the libraries and paths for linking npymath lib. -# -# NUMPY_FOUND - was NumPy found -# NUMPY_VERSION - the version of NumPy found as a string -# NUMPY_VERSION_MAJOR - the major version number of NumPy -# NUMPY_VERSION_MINOR - the minor version number of NumPy -# NUMPY_VERSION_PATCH - the patch version number of NumPy -# NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601 -# NUMPY_INCLUDE_DIRS - path to the NumPy include files - -#============================================================================ -# Copyright 2012 Continuum Analytics, Inc. -# -# MIT License -# -# Permission is hereby granted, free of charge, to any person obtaining -# a copy of this software and associated documentation files -# (the "Software"), to deal in the Software without restriction, including -# without limitation the rights to use, copy, modify, merge, publish, -# distribute, sublicense, and/or sell copies of the Software, and to permit -# persons to whom the Software is furnished to do so, subject to -# the following conditions: -# -# The above copyright notice and this permission notice shall be included -# in all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR -# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -# OTHER DEALINGS IN THE SOFTWARE. -# -#============================================================================ - -# Finding NumPy involves calling the Python interpreter -if(NumPy_FIND_REQUIRED) -find_package(PythonInterp REQUIRED) -else() -find_package(PythonInterp) -endif() - -if(NOT PYTHONINTERP_FOUND) -set(NUMPY_FOUND FALSE) -return() -endif() - -execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c" -"import numpy as n; print(n.__version__); print(n.get_include());" -RESULT_VARIABLE _NUMPY_SEARCH_SUCCESS -OUTPUT_VARIABLE _NUMPY_VALUES_OUTPUT -ERROR_VARIABLE _NUMPY_ERROR_VALUE -OUTPUT_STRIP_TRAILING_WHITESPACE) - -if(NOT _NUMPY_SEARCH_SUCCESS MATCHES 0) -if(NumPy_FIND_REQUIRED) -message(FATAL_ERROR -"NumPy import failure:\n${_NUMPY_ERROR_VALUE}") -endif() -set(NUMPY_FOUND FALSE) -return() -endif() - -# Convert the process output into a list -string(REGEX REPLACE ";" "\\\\;" _NUMPY_VALUES ${_NUMPY_VALUES_OUTPUT}) -string(REGEX REPLACE "\n" ";" _NUMPY_VALUES ${_NUMPY_VALUES}) -# Just in case there is unexpected output from the Python command. -list(GET _NUMPY_VALUES -2 NUMPY_VERSION) -list(GET _NUMPY_VALUES -1 NUMPY_INCLUDE_DIRS) - -string(REGEX MATCH "^[0-9]+\\.[0-9]+\\.[0-9]+" _VER_CHECK "${NUMPY_VERSION}") -if("${_VER_CHECK}" STREQUAL "") -# The output from Python was unexpected. Raise an error always -# here, because we found NumPy, but it appears to be corrupted somehow. -message(FATAL_ERROR -"Requested version and include path from NumPy, got instead:\n${_NUMPY_VALUES_OUTPUT}\n") -return() -endif() - -# Make sure all directory separators are '/' -string(REGEX REPLACE "\\\\" "/" NUMPY_INCLUDE_DIRS ${NUMPY_INCLUDE_DIRS}) - -# Get the major and minor version numbers -string(REGEX REPLACE "\\." ";" _NUMPY_VERSION_LIST ${NUMPY_VERSION}) -list(GET _NUMPY_VERSION_LIST 0 NUMPY_VERSION_MAJOR) -list(GET _NUMPY_VERSION_LIST 1 NUMPY_VERSION_MINOR) -list(GET _NUMPY_VERSION_LIST 2 NUMPY_VERSION_PATCH) -string(REGEX MATCH "[0-9]*" NUMPY_VERSION_PATCH ${NUMPY_VERSION_PATCH}) -math(EXPR NUMPY_VERSION_DECIMAL -"(${NUMPY_VERSION_MAJOR} * 10000) + (${NUMPY_VERSION_MINOR} * 100) + ${NUMPY_VERSION_PATCH}") - -find_package_message(NUMPY -"Found NumPy: version \"${NUMPY_VERSION}\" ${NUMPY_INCLUDE_DIRS}" -"${NUMPY_INCLUDE_DIRS}${NUMPY_VERSION}") - -set(NUMPY_FOUND TRUE) diff --git a/cmake/modules/FindParMETIS.cmake b/cmake/modules/FindParMETIS.cmake deleted file mode 100644 index 0f930beed0..0000000000 --- a/cmake/modules/FindParMETIS.cmake +++ /dev/null @@ -1,163 +0,0 @@ -# - Try to find ParMETIS -# Once done this will define -# -# PARMETIS_FOUND - system has ParMETIS -# PARMETIS_INCLUDE_DIRS - include directories for ParMETIS -# PARMETIS_LIBRARIES - libraries for ParMETIS -# -# Variables used by this module. They can change the default behaviour and -# need to be set before calling find_package: -# -# PARMETIS_DIR - Prefix directory of the ParMETIS installation -# PARMETIS_INCLUDE_DIR - Include directory of the ParMETIS installation -# (set only if different from ${PARMETIS_DIR}/include) -# PARMETIS_LIB_DIR - Library directory of the ParMETIS installation -# (set only if different from ${PARMETIS_DIR}/lib) -# PARMETIS_TEST_RUNS - Skip tests building and running a test -# executable linked against ParMETIS libraries -# PARMETIS_LIB_SUFFIX - Also search for non-standard library names with the -# given suffix appended - -#============================================================================= -# Copyright (C) 2010-2012 Garth N. Wells, Anders Logg, Johannes Ring -# and Florian Rathgeber. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. 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. -# -# 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. -#============================================================================= - -if(NOT PARMETIS_INCLUDE_DIR) - find_path(PARMETIS_INCLUDE_DIR parmetis.h - HINTS ${PARMETIS_INCLUDE_DIR} ENV PARMETIS_INCLUDE_DIR ${PARMETIS_DIR} ENV PARMETIS_DIR - PATH_SUFFIXES include - DOC "Directory where the ParMETIS header files are located" - ) -endif() - -if(NOT METIS_INCLUDE_DIR) - find_path(METIS_INCLUDE_DIR metis.h - HINTS ${METIS_INCLUDE_DIR} ENV METIS_INCLUDE_DIR ${METIS_DIR} ENV METIS_DIR - PATH_SUFFIXES include - DOC "Directory where the METIS header files are located" - ) -endif() - -if(PARMETIS_LIBRARIES) - set(PARMETIS_LIBRARY ${PARMETIS_LIBRARIES}) -endif() -if(NOT PARMETIS_LIBRARY) - find_library(PARMETIS_LIBRARY - NAMES parmetis parmetis${PARMETIS_LIB_SUFFIX} - HINTS ${PARMETIS_LIB_DIR} ENV PARMETIS_LIB_DIR ${PARMETIS_DIR} ENV PARMETIS_DIR - PATH_SUFFIXES lib - DOC "Directory where the ParMETIS library is located" - ) -endif() - -if(METIS_LIBRARIES) - set(METIS_LIBRARY ${METIS_LIBRARIES}) -endif() -if(NOT METIS_LIBRARY) - find_library(METIS_LIBRARY - NAMES metis metis${PARMETIS_LIB_SUFFIX} - HINTS ${PARMETIS_LIB_DIR} ENV PARMETIS_LIB_DIR ${PARMETIS_DIR} ENV PARMETIS_DIR - PATH_SUFFIXES lib - DOC "Directory where the METIS library is located" - ) -endif() - -# Get ParMETIS version -if(NOT PARMETIS_VERSION_STRING AND PARMETIS_INCLUDE_DIR AND EXISTS "${PARMETIS_INCLUDE_DIR}/parmetis.h") - set(version_pattern "^#define[\t ]+PARMETIS_(MAJOR|MINOR)_VERSION[\t ]+([0-9\\.]+)$") - file(STRINGS "${PARMETIS_INCLUDE_DIR}/parmetis.h" parmetis_version REGEX ${version_pattern}) - - foreach(match ${parmetis_version}) - if(PARMETIS_VERSION_STRING) - set(PARMETIS_VERSION_STRING "${PARMETIS_VERSION_STRING}.") - endif() - string(REGEX REPLACE ${version_pattern} "${PARMETIS_VERSION_STRING}\\2" PARMETIS_VERSION_STRING ${match}) - set(PARMETIS_VERSION_${CMAKE_MATCH_1} ${CMAKE_MATCH_2}) - endforeach() - unset(parmetis_version) - unset(version_pattern) -endif() - -# Try compiling and running test program -if(PARMETIS_INCLUDE_DIR AND METIS_INCLUDE_DIR AND - PARMETIS_LIBRARY AND METIS_LIBRARY) - - # Test requires MPI - find_package(MPI QUIET REQUIRED) - - # Set flags for building test program - set(CMAKE_REQUIRED_FLAGS "${MPI_C_COMPILE_FLAGS}") - # Ideally this would be used, but it unfortunately is not supported - #set(CMAKE_REQUIRED_LINKER_FLAGS "${MPI_C_LINK_FLAGS} ${CMAKE_EXE_LINKER_FLAGS}") - set(CMAKE_REQUIRED_INCLUDES - ${PARMETIS_INCLUDE_DIR} ${METIS_INCLUDE_DIR} ${MPI_C_INCLUDE_PATH}) - set(CMAKE_REQUIRED_LIBRARIES - ${PARMETIS_LIBRARY} ${METIS_LIBRARY} ${MPI_C_LIBRARIES}) - - # Build and run test program - include(CheckCSourceRuns) - check_c_source_runs(" -#include \"mpi.h\" -#define METIS_EXPORT -#include \"parmetis.h\" -int main( int argc, char* argv[] ) -{ - // FIXME: Find a simple but sensible test for ParMETIS - MPI_Init( &argc, &argv ); - MPI_Finalize(); - return 0; -} -" PARMETIS_TEST_RUNS) - - unset(CMAKE_REQUIRED_FLAGS) - #unset(CMAKE_REQUIRED_LINKER_FLAGS) - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) -endif() - -# Standard package handling -include(FindPackageHandleStandardArgs) -if(CMAKE_VERSION VERSION_GREATER 2.8.2) - find_package_handle_standard_args(ParMETIS - REQUIRED_VARS PARMETIS_LIBRARY PARMETIS_INCLUDE_DIR PARMETIS_TEST_RUNS - VERSION_VAR PARMETIS_VERSION_STRING) -else() - find_package_handle_standard_args(ParMETIS - REQUIRED_VARS PARMETIS_LIBRARY PARMETIS_INCLUDE_DIR PARMETIS_TEST_RUNS) -endif() - -if(PARMETIS_FOUND) - set(PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY}) - set(PARMETIS_INCLUDE_DIRS ${PARMETIS_INCLUDE_DIR} ${METIS_INCLUDE_DIR}) -else() - unset(METIS_LIBRARY CACHE) - unset(METIS_INCLUDE_DIR CACHE) -endif() - -mark_as_advanced(PARMETIS_INCLUDE_DIR METIS_INCLUDE_DIR - PARMETIS_LIBRARY METIS_LIBRARY) diff --git a/cmake/modules/FindQD.cmake b/cmake/modules/FindQD.cmake index baf72f4309..8c22bc9c01 100644 --- a/cmake/modules/FindQD.cmake +++ b/cmake/modules/FindQD.cmake @@ -1,29 +1,64 @@ -# Try to find the QD library -# See http://crd-legacy.lbl.gov/~dhbailey/mpdist/index.html +# Sets the following variables: # -# Once done this will define -# -# QD_FOUND - system has QD lib with correct version -# QD_INCLUDES - the QD include directory -# QD_LIBRARIES - the QD library +# QD_FOUND +# QD_INCLUDE_DIR -- Location of qd/dd_real.h and qd/qd_real.h +# QD_LIBRARIES -- QD library + +find_path(QD_INCLUDE_DIR NAMES qd/dd_real.h qd/qd_real.h + HINTS ${QD_DIR} $ENV{QD_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "Directory with qd.h header.") +find_path(QD_INCLUDE_DIRS NAMES qd/dd_real.h qd/qd_real.h) -# Copyright (c) 2016 Jack Poulson, -# Redistribution and use is allowed according to the terms of the BSD license. +find_library(QD_LIBRARY qd + HINTS ${QD_DIR} $ENV{QD_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The Qd library.") +find_library(QD_LIBRARY qd) -# Set QD_INCLUDES -find_path(QD_INCLUDES - NAMES - qd/dd_real.h - qd/qd_real.h - PATHS - $ENV{QDDIR} - ${INCLUDE_INSTALL_DIR} -) +if (QD_LIBRARY AND QD_INCLUDE_DIR) + set(CMAKE_REQUIRED_LIBRARIES ${QD_LIBRARY}) + set(CMAKE_REQUIRED_INCLUDES ${QD_INCLUDE_DIR}) + set(QD_CODE + "#include +#include +int main( int argc, char* argv[] ) +{ + double a1=1., a2=2., b1=3., b2=4.; + dd_real a(a1,a2), b(b1,b2); + dd_real c = a*b; + std::cout << \"c=\" << c << std::endl; + qd_real d(a1,a2,b1,b2); + std::cout << \"d=\" << d << std::endl; +}") + + check_cxx_source_compiles("${QD_CODE}" QD_WORKS) + unset(CMAKE_REQUIRED_LIBRARIES) + unset(CMAKE_REQUIRED_INCLUDES) -# Set QD_LIBRARIES -find_library(QD_LIBRARIES qd PATHS $ENV{QDDIR} ${LIB_INSTALL_DIR}) + if (NOT QD_WORKS) + + message(WARNING "Found QD but could not compile with it") + + endif () +endif () -# Epilogue include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(QD DEFAULT_MSG QD_INCLUDES QD_LIBRARIES) -mark_as_advanced(QD_INCLUDES QD_LIBRARIES) +find_package_handle_standard_args(QD DEFAULT_MSG + QD_LIBRARY QD_INCLUDE_DIR QD_WORKS) + +if (QD_FOUND) + if (NOT TARGET EP::qd) + add_library(EP::qd INTERFACE IMPORTED) + + set_property(TARGET EP::qd + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${QD_INCLUDE_DIR}") + set_property(TARGET EP::qd + PROPERTY INTERFACE_LINK_LIBRARIES "${QD_LIBRARY}") + endif () + + set(QD_LIBRARIES EP::qd) + mark_as_advanced(QD_INCLUDE_DIR QD_LIBRARY) +endif (QD_FOUND) diff --git a/cmake/modules/FindQuadmath.cmake b/cmake/modules/FindQuadmath.cmake new file mode 100644 index 0000000000..043b300284 --- /dev/null +++ b/cmake/modules/FindQuadmath.cmake @@ -0,0 +1,70 @@ +# Sets the following variables: +# +# Quadmath_FOUND +# QUADMATH_INCLUDE_DIR -- Location of quadmath.h +# QUADMATH_LIBRARIES -- libquadmath library + +find_path(QUADMATH_INCLUDE_DIR quadmath.h + HINTS ${QUADMATH_DIR} $ENV{QUADMATH_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "Directory with quadmath.h header.") +find_path(QUADMATH_INCLUDE_DIRS quadmath.h) + +find_library(QUADMATH_LIBRARY quadmath + HINTS ${QUADMATH_DIR} $ENV{QUADMATH_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The QuadMath library.") +find_library(QUADMATH_LIBRARY quadmath) + +# Check that we can compile with quadmath library +if (QUADMATH_LIBRARY AND QUADMATH_INCLUDE_DIR AND NOT QUADMATH_TEST_RUN) + set(CMAKE_REQUIRED_LIBRARIES "${QUADMATH_LIBRARY}") + set(CMAKE_REQUIRED_INCLUDES "${QUADMATH_INCLUDE_DIR}") + set(QUADMATH_CODE " +#include +#include +#include +int main( int argc, char* argv[] ) +{ + __float128 a = 2.0q; + + char aStr[128]; + quadmath_snprintf( aStr, sizeof(aStr), \"%Q\", a ); + std::cout << aStr << std::endl; + + __complex128 y; + std::complex<__float128> z; + + return 0; +}") + + check_cxx_source_compiles("${QUADMATH_CODE}" QUADMATH_WORKS) + set(QUADMATH_TEST_RUN 1 CACHE INTERNAL "Whether the QUADMATH test has run") + unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) + + if (NOT QUADMATH_WORKS) + + set(${PROJECT_NAME}_ENABLE_QUADMATH OFF) + message(WARNING "Found libquadmath but could compile with it.") + + endif () +endif () + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Quadmath DEFAULT_MSG + QUADMATH_LIBRARY QUADMATH_INCLUDE_DIR QUADMATH_WORKS) + +if (NOT TARGET EP::quadmath) + add_library(EP::quadmath INTERFACE IMPORTED) + + set_property(TARGET EP::quadmath + PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${QUADMATH_INCLUDE_DIR}") + set_property(TARGET EP::quadmath + PROPERTY INTERFACE_LINK_LIBRARIES "${QUADMATH_LIBRARY}") +endif () + +set(QUADMATH_LIBRARIES EP::quadmath) +mark_as_advanced(QUADMATH_INCLUDE_DIR QUADMATH_LIBRARY) diff --git a/cmake/modules/FindROCBLAS.cmake b/cmake/modules/FindROCBLAS.cmake new file mode 100644 index 0000000000..a4e939347d --- /dev/null +++ b/cmake/modules/FindROCBLAS.cmake @@ -0,0 +1,46 @@ +# Find rocBLAS library and supporting header +# +# rocBLAS_DIR or ROCBLAS_DIR[in]: The prefix for rocBLAS +# +# ROCBLAS_INCLUDE_PATH[out,cache]: The include path for rocBLAS +# ROCBLAS_LIBRARY[out,cache]: The rocBLAS library +# +# ROCBLAS_LIBRARIES[out]: The thing to link to for rocBLAS +# ROCBLAS_FOUND[out]: Variable indicating whether rocBLAS has been found +# +# rocm::rocblas: Imported library for rocBLAS +# + +find_path(ROCBLAS_INCLUDE_PATH rocblas.h + HINTS ${rocBLAS_DIR} $ENV{rocBLAS_DIR} ${ROCBLAS_DIR} $ENV{ROCBLAS_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "The rocBLAS include path.") +find_path(ROCBLAS_INCLUDE_PATH rocblas.h) + +find_library(ROCBLAS_LIBRARY rocblas + HINTS ${rocBLAS_DIR} $ENV{rocBLAS_DIR} ${ROCBLAS_DIR} $ENV{ROCBLAS_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The rocBLAS library.") +find_library(ROCBLAS_LIBRARY rocblas) + +# Standard handling of the package arguments +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Rocblas + REQUIRED_VARS ROCBLAS_LIBRARY ROCBLAS_INCLUDE_PATH) + +if (NOT TARGET rocblas::rocblas) + add_library(rocblas::rocblas INTERFACE IMPORTED) +endif () + +if (ROCBLAS_INCLUDE_PATH AND ROCBLAS_LIBRARY) + set_target_properties(rocblas::rocblas PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES + "${ROCBLAS_INCLUDE_PATH};/opt/rocm/hsa/include;/opt/rocm/hip/include" + INTERFACE_LINK_LIBRARIES "${ROCBLAS_LIBRARY}") +endif () + +set(ROCBLAS_LIBRARIES rocblas::rocblas) +mark_as_advanced(ROCBLAS_INCLUDE_PATH) +mark_as_advanced(ROCBLAS_LIBRARY) diff --git a/cmake/modules/FindVTUNE.cmake b/cmake/modules/FindVTUNE.cmake new file mode 100644 index 0000000000..3bd44ffccc --- /dev/null +++ b/cmake/modules/FindVTUNE.cmake @@ -0,0 +1,39 @@ +# Exports the following variables +# +# VTUNE_INCLUDE_PATH +# VTUNE_LIBRARY +# VTUNE_LIBRARIES +# +# The following IMPORTED target is also created: +# +# vtune::vtune +# +find_path(VTUNE_INCLUDE_PATH ittnotify.h + HINTS ${VTUNE_DIR} $ENV{VTUNE_DIR} + PATH_SUFFIXES include + NO_DEFAULT_PATH + DOC "The location of VTune headers.") +find_path(VTUNE_INCLUDE_PATH ittnotify.h) + +find_library(VTUNE_LIBRARY NAMES libittnotify.a ittnotify + HINTS ${VTUNE_DIR} $ENV{VTUNE_DIR} + PATH_SUFFIXES lib64 lib + NO_DEFAULT_PATH + DOC "The location of VTune Static lib") +find_library(VTUNE_LIBRARY NAMES libittnotify.a ittnotify) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VTUNE + DEFAULT_MSG VTUNE_LIBRARY VTUNE_INCLUDE_PATH) + +add_library(vtune::vtune INTERFACE IMPORTED) + +if (VTUNE_FOUND) + set_property(TARGET vtune::vtune PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${VTUNE_INCLUDE_PATH}") + + set_property(TARGET vtune::vtune PROPERTY + INTERFACE_LINK_LIBRARIES "${VTUNE_LIBRARY}") + + set(VTUNE_LIBRARIES vtune::vtune) +endif (VTUNE_FOUND) diff --git a/cmake/modules/GetGitRevisionDescription.cmake b/cmake/modules/GetGitRevisionDescription.cmake deleted file mode 100644 index 50065f8b4d..0000000000 --- a/cmake/modules/GetGitRevisionDescription.cmake +++ /dev/null @@ -1,123 +0,0 @@ -# - Returns a version string from Git -# -# These functions force a re-configure on each git commit so that you can -# trust the values of the variables in your build system. -# -# get_git_head_revision( [ ...]) -# -# Returns the refspec and sha hash of the current head revision -# -# git_describe( [ ...]) -# -# Returns the results of git describe on the source tree, and adjusting -# the output so that it tests false if an error occurs. -# -# git_get_exact_tag( [ ...]) -# -# Returns the results of git describe --exact-match on the source tree, -# and adjusting the output so that it tests false if there was no exact -# matching tag. -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -if(__get_git_revision_description) - return() -endif() -set(__get_git_revision_description YES) - -# We must run the following at "include" time, not at function call time, -# to find the path to this module rather than the path to a calling list file -get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) - -function(get_git_head_revision _refspecvar _hashvar) - set(GIT_PARENT_DIR "${CMAKE_SOURCE_DIR}") - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories - set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") - get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) - if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) - # We have reached the root directory, we are not in git - set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) - return() - endif() - set(GIT_DIR "${GIT_PARENT_DIR}/.git") - endwhile() - set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") - if(NOT EXISTS "${GIT_DATA}") - file(MAKE_DIRECTORY "${GIT_DATA}") - endif() - - if(NOT EXISTS "${GIT_DIR}/HEAD") - return() - endif() - set(HEAD_FILE "${GIT_DATA}/HEAD") - configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) - - configure_file( - "${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" - "${GIT_DATA}/grabRef.cmake" @ONLY) - include("${GIT_DATA}/grabRef.cmake") - - set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) - set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) -endfunction() - -function(git_describe _var) - if(NOT GIT_FOUND) - find_package(Git QUIET) - endif() - get_git_head_revision(refspec hash) - if(NOT GIT_FOUND) - set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) - return() - endif() - if(NOT hash) - set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) - return() - endif() - -# TODO sanitize -#if((${ARGN}" MATCHES "&&") OR -# (ARGN MATCHES "||") OR -# (ARGN MATCHES "\\;")) -# message("Please report the following error to the project!") -# message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") -#endif() - -#message(STATUS "Arguments to execute_process: ${ARGN}") - - execute_process(COMMAND - "${GIT_EXECUTABLE}" - describe - ${hash} - ${ARGN} - WORKING_DIRECTORY - "${CMAKE_SOURCE_DIR}" - RESULT_VARIABLE - res - OUTPUT_VARIABLE - out - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE) - if(NOT res EQUAL 0) - set(out "${out}-${res}-NOTFOUND") - endif() - - set(${_var} "${out}" PARENT_SCOPE) -endfunction() - -function(git_get_exact_tag _var) - git_describe(out --exact-match ${ARGN}) - set(${_var} "${out}" PARENT_SCOPE) -endfunction() diff --git a/cmake/modules/GetGitRevisionDescription.cmake.in b/cmake/modules/GetGitRevisionDescription.cmake.in deleted file mode 100644 index bffdbd765b..0000000000 --- a/cmake/modules/GetGitRevisionDescription.cmake.in +++ /dev/null @@ -1,38 +0,0 @@ -# -# Internal file for GetGitRevisionDescription.cmake -# -# Requires CMake 2.6 or newer (uses the 'function' command) -# -# Original Author: -# 2009-2010 Ryan Pavlik -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -set(HEAD_HASH) - -file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) - -string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) -if(HEAD_CONTENTS MATCHES "ref") - # named branch - string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") - if(EXISTS "@GIT_DIR@/${HEAD_REF}") - configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") - configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) - set(HEAD_HASH "${HEAD_REF}") - endif() -else() - # detached HEAD - configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) -endif() - -if(NOT HEAD_HASH) - file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) - string(STRIP "${HEAD_HASH}" HEAD_HASH) -endif() diff --git a/cmake/modules/HydrogenETIGeneration.cmake b/cmake/modules/HydrogenETIGeneration.cmake new file mode 100644 index 0000000000..1ec1f99d6b --- /dev/null +++ b/cmake/modules/HydrogenETIGeneration.cmake @@ -0,0 +1,31 @@ +# This function sets the _ARG# variable and recurs through the parameters. +function (h_gtpe_recur OUTVAR EXPRESSION_TEMPLATE THIS_EPARAM_ID THIS_EPARAM) + foreach (_VAL IN LISTS ${THIS_EPARAM}) + set(_ARG${THIS_EPARAM_ID} "${_VAL}") + if (ARGN) + math(EXPR _NEXT_ID "${THIS_EPARAM_ID} + 1") + h_gtpe_recur(${OUTVAR} "${EXPRESSION_TEMPLATE}" ${_NEXT_ID} ${ARGN}) + else () + string(CONFIGURE "${EXPRESSION_TEMPLATE}" _THIS_EXPRESSION @ONLY) + list(APPEND ${OUTVAR} "${_THIS_EXPRESSION}") + endif () + endforeach () + set(${OUTVAR} "${${OUTVAR}}" PARENT_SCOPE) +endfunction () + +# This function calls the recursive function above to generate each +# function instance. +# +# DO NOT ADD A SEMICOLON TO THE EXPRESSION_TEMPLATE PARAMETER!!!!!!! +function (h_generate_tensor_product_expression OUTVAR EXPRESSION_TEMPLATE) + h_gtpe_recur(_ALL_EXPRESSIONS "${EXPRESSION_TEMPLATE}" 0 ${ARGN}) + set(${OUTVAR} ${_ALL_EXPRESSIONS} PARENT_SCOPE) +endfunction () + +# This function adds a semicolon to each function instance in the list +# and joins them into a string with each function instance on its own +# line. +function (h_func_list_to_string OUTVAR INLIST) + list(JOIN ${INLIST} ";\n" _TMP) + set(${OUTVAR} "${_TMP};" PARENT_SCOPE) +endfunction () diff --git a/cmake/modules/PrintHydrogenSummary.cmake b/cmake/modules/PrintHydrogenSummary.cmake new file mode 100644 index 0000000000..86c8751575 --- /dev/null +++ b/cmake/modules/PrintHydrogenSummary.cmake @@ -0,0 +1,112 @@ +function (print_full_hydrogen_summary) + set(_OPTIONS ONLY_PRINT_TRUE_BOOLS PRINT_EMPTY_VARIABLES) + set(_ONE_VALUE_PARAMS TIMESTAMP) + set(_MULTI_VALUE_PARAMS + VERSION_VARIABLES PATH_VARIABLES STRING_VARIABLES BOOLEAN_VARIABLES) + + cmake_parse_arguments(__ARGS + "${_OPTIONS}" "${_ONE_VALUE_PARAMS}" "${_MULTI_VALUE_PARAMS}" + ${ARGN}) + + + set(__max_var_name_length 0) + foreach (__var ${__ARGS_VERSION_VARIABLES} ${__ARGS_PATH_VARIABLES} + ${__ARGS_STRING_VARIABLES} ${__ARGS_BOOLEAN_VARIABLES}) + string(LENGTH "${__var}" __var_name_length) + + if (__var_name_length GREATER __max_var_name_length) + set(__max_var_name_length ${__var_name_length}) + endif () + endforeach () + math(EXPR __max_var_name_length "${__max_var_name_length} + 2") + + set(__STAR_STR + "********************************************************************************") + set(__DOTS_STR + "......................................................................") + set(__SPACE_STR + " ") + set(__SUMMARY_STR "\n${__STAR_STR}\n") + string(APPEND __SUMMARY_STR "* ${PROJECT_NAME} Build\n") + if (__ARGS_TIMESTAMP) + string(APPEND __SUMMARY_STR "* ${__ARGS_TIMESTAMP}\n") + endif () + string(APPEND __SUMMARY_STR "*\n* Version information:\n") + + # Print the version variables + foreach (__var ${__ARGS_VERSION_VARIABLES}) + string(LENGTH "${__var}" __var_name_length) + math(EXPR __num_spaces "${__max_var_name_length} - ${__var_name_length}") + string(SUBSTRING "${__SPACE_STR}" 0 ${__num_spaces} __spaces) + + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}${${__var}}\n") + endforeach () + + string(APPEND __SUMMARY_STR "*\n* Important paths:\n") + + foreach (__var ${__ARGS_PATH_VARIABLES}) + if (NOT ${__var} AND NOT __ARGS_PRINT_EMPTY_VARIABLES) + continue() + endif () + + string(LENGTH "${__var}" __var_name_length) + math(EXPR __num_spaces "${__max_var_name_length} - ${__var_name_length}") + string(SUBSTRING "${__SPACE_STR}" 0 ${__num_spaces} __spaces) + + if (__ARGS_PRINT_EMPTY_VARIABLES AND NOT ${__var}) + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}\n") + else () + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}${${__var}}\n") + endif () + endforeach () + + string(APPEND __SUMMARY_STR "*\n* Important strings:\n") + + foreach (__var ${__ARGS_STRING_VARIABLES}) + if (NOT ${__var} AND NOT __ARGS_PRINT_EMPTY_VARIABLES) + continue() + endif () + + string(LENGTH "${__var}" __var_name_length) + math(EXPR __num_spaces "${__max_var_name_length} - ${__var_name_length}") + string(SUBSTRING "${__SPACE_STR}" 0 ${__num_spaces} __spaces) + + if (__ARGS_PRINT_EMPTY_VARIABLES AND NOT ${__var}) + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}\"\"\n") + else () + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}\"${${__var}}\"\n") + endif () + endforeach () + + if (NOT __ARGS_ONLY_PRINT_TRUE_BOOLS) + string(APPEND __SUMMARY_STR "*\n* The following switches are set:\n") + + foreach (__var ${__ARGS_BOOLEAN_VARIABLES}) + + string(LENGTH "${__var}" __var_name_length) + math(EXPR __num_spaces "${__max_var_name_length} - ${__var_name_length}") + string(SUBSTRING "${__SPACE_STR}" 0 ${__num_spaces} __spaces) + + if (NOT ${__var}) + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}OFF\n") + else () + string(APPEND __SUMMARY_STR "* ${__var}${__spaces}ON\n") + endif () + endforeach () + + else () + + string(APPEND __SUMMARY_STR "*\n* The following switches are ON:\n") + + foreach (__var ${__ARGS_BOOLEAN_VARIABLES}) + if (${__var}) + string(APPEND __SUMMARY_STR "* ${__var}\n") + endif () + endforeach () + endif () + + string(APPEND __SUMMARY_STR "*\n${__STAR_STR}\n") + + # Get the message to STDOUT + execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${__SUMMARY_STR}") +endfunction () diff --git a/cmake/modules/language_support_v2.cmake b/cmake/modules/language_support_v2.cmake deleted file mode 100644 index d8218d5cd3..0000000000 --- a/cmake/modules/language_support_v2.cmake +++ /dev/null @@ -1,59 +0,0 @@ -# cmake/modules/language_support.cmake -# -# Temporary additional general language support is contained within this -# file. - -# This additional function definition is needed to provide a workaround for -# CMake bug 9220. - -# On debian testing (cmake 2.6.2), I get return code zero when calling -# cmake the first time, but cmake crashes when running a second time -# as follows: -# -# -- The Fortran compiler identification is unknown -# CMake Error at /usr/share/cmake-2.6/Modules/CMakeFortranInformation.cmake:7 (GET_FILENAME_COMPONENT): -# get_filename_component called with incorrect number of arguments -# Call Stack (most recent call first): -# CMakeLists.txt:3 (enable_language) -# -# My workaround is to invoke cmake twice. If both return codes are zero, -# it is safe to invoke ENABLE_LANGUAGE(Fortran OPTIONAL) - -function(workaround_9220 language language_works) - set(text - "project(test NONE) -cmake_minimum_required(VERSION 2.6.0) -set(CMAKE_${language}_COMPILER ${CMAKE_${language}_COMPILER}) -enable_language(${language} OPTIONAL) -" - ) - file(REMOVE_RECURSE ${CMAKE_BINARY_DIR}/language_tests/${language}) - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language}) - file(WRITE ${CMAKE_BINARY_DIR}/language_tests/${language}/CMakeLists.txt - ${text}) - execute_process( - COMMAND ${CMAKE_COMMAND} . - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language} - RESULT_VARIABLE return_code - OUTPUT_QUIET - ERROR_QUIET - ) - - if(return_code EQUAL 0) - # Second run - execute_process ( - COMMAND ${CMAKE_COMMAND} . - WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/language_tests/${language} - RESULT_VARIABLE return_code - OUTPUT_QUIET - ERROR_QUIET - ) - if(return_code EQUAL 0) - set(${language_works} ON PARENT_SCOPE) - else(return_code EQUAL 0) - set(${language_works} OFF PARENT_SCOPE) - endif(return_code EQUAL 0) - else(return_code EQUAL 0) - set(${language_works} OFF PARENT_SCOPE) - endif(return_code EQUAL 0) -endfunction(workaround_9220) diff --git a/cmake/toolchains/BGQ-JUQUEEN-clang-essl.cmake b/cmake/toolchains/BGQ-JUQUEEN-clang-essl.cmake deleted file mode 100644 index 33f5f0b89e..0000000000 --- a/cmake/toolchains/BGQ-JUQUEEN-clang-essl.cmake +++ /dev/null @@ -1,45 +0,0 @@ -# Set the system name so CMake uses the appropriate platform settings. -# NOTE: The platforms settings for BlueGeneP are the same for BlueGeneQ -set(CMAKE_SYSTEM_NAME BlueGeneP-static) - -set(GCC_ROOT "/bgsys/local/gcc/4.8.1") -set(GCC_NAME "powerpc64-bgq-linux") -set(CLANG_ROOT "/bgsys/local/clang/nightly") -set(CLANG_MPI_ROOT "${CLANG_ROOT}/mpi/bgclang") -set(IBMCMP_ROOT "/opt/ibmcmp") - -set(BLAS_LIB "/bgsys/local/lib") -set(LAPACK_LIB "/bgsys/local/lapack/3.4.2/lib") -set(SCALAPACK_LIB "/bgsys/local/scalapack/2.0.2/lib") -set(ESSL_LIB "/bgsys/local/lib") - -set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm/gcc") -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") - -# The serial compilers -set(CMAKE_C_COMPILER "${CLANG_ROOT}/bin/bgclang") -set(CMAKE_CXX_COMPILER "${CLANG_ROOT}/bin/bgclang++11") -set(CMAKE_Fortran_COMPILER "${GCC_ROOT}/bin/${GCC_NAME}-gfortran") - -# The MPI wrappers for the C and C++ compilers -set(MPI_C_COMPILER "${CLANG_MPI_ROOT}/bin/mpicc") -set(MPI_CXX_COMPILER "${CLANG_MPI_ROOT}/bin/mpic++11") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(XLF_LIB "${IBMCMP_ROOT}/xlf/bg/14.1/bglib64") -set(XLSMP_LIB "${IBMCMP_ROOT}/xlsmp/bg/3.1/bglib64") - -if(EL_HYBRID) - set(MATH_LIBS "-L${SCALAPACK_LIB} -lscalapack -L${ESSL_LIB} -lesslsmpbg -L${LAPACK_LIB} -llapack -L${ESSL_LIB} -lesslsmpbg -L${XLF_LIB} -lxlf90_r -L${XLSMP_LIB} -lxlsmp -lxlopt -lxlfmath -lxl -lpthread -ldl -Wl,--allow-multiple-definition") -else() - set(MATH_LIBS "-L${SCALAPACK_LIB} -lscalapack -L${ESSL_LIB} -lesslbg -L${LAPACK_LIB} -llapack -L${ESSL_LIB} -lesslbg -L${XLF_LIB} -lxlf90_r -L${XLSMP_LIB} -lxlomp_ser -lxlopt -lxlfmath -lxl -lpthread -ldl -Wl,--allow-multiple-definition") -endif() diff --git a/cmake/toolchains/BGQ-Mira-clang-essl.cmake b/cmake/toolchains/BGQ-Mira-clang-essl.cmake deleted file mode 100644 index b5cb0470ec..0000000000 --- a/cmake/toolchains/BGQ-Mira-clang-essl.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Set the system name so CMake uses the appropriate platform settings. -# NOTE: The platforms settings for BlueGeneP are the same for BlueGeneQ -set(CMAKE_SYSTEM_NAME BlueGeneP-static) - -set(GCC_ROOT "/bgsys/drivers/ppcfloor/gnu-linux-4.7.2") -set(GCC_NAME "powerpc64-bgq-linux") -set(CLANG_ROOT "/soft/compilers/bgclang") -set(CLANG_MPI_ROOT "${CLANG_ROOT}/mpi/bgclang") -set(IBMCMP_ROOT "$ENV{IBM_MAIN_DIR}") - -set(BLAS_LIB "/soft/libraries/alcf/current/xl/BLAS/lib") -set(LAPACK_LIB "/soft/libraries/alcf/current/xl/LAPACK/lib") -set(ESSL_LIB "/soft/libraries/essl/current/essl/5.1/lib64") - -set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm/gcc") -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") - -# The serial compilers -set(CMAKE_C_COMPILER "${CLANG_ROOT}/wbin/bgclang") -set(CMAKE_CXX_COMPILER "${CLANG_ROOT}/wbin/bgclang++11") -set(CMAKE_Fortran_COMPILER "${GCC_ROOT}/bin/${GCC_NAME}-gfortran") - -# The MPI wrappers for the C and C++ compilers -set(MPI_C_COMPILER "${CLANG_MPI_ROOT}/bin/mpicc") -set(MPI_CXX_COMPILER "${CLANG_MPI_ROOT}/bin/mpic++11") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(XLF_LIB "${IBMCMP_ROOT}/xlf/bg/14.1/bglib64") -set(XLSMP_LIB "${IBMCMP_ROOT}/xlsmp/bg/3.1/bglib64") - -if(EL_HYBRID) - set(MATH_LIBS "-L${ESSL_LIB} -lesslsmpbg -L${LAPACK_LIB} -llapack -L${ESSL_LIB} -lesslsmpbg -L${XLF_LIB} -lxlf90_r -L${XLSMP_LIB} -lxlsmp -lxlopt -lxlfmath -lxl -lpthread -ldl -Wl,--allow-multiple-definition") -else() - set(MATH_LIBS "-L${ESSL_LIB} -lesslbg -L${LAPACK_LIB} -llapack -L${ESSL_LIB} -lesslbg -L${XLF_LIB} -lxlf90_r -L${XLSMP_LIB} -lxlomp_ser -lxlopt -lxlfmath -lxl -lpthread -ldl -Wl,--allow-multiple-definition") -endif() diff --git a/cmake/toolchains/BGQ-Mira-gnu-essl.cmake b/cmake/toolchains/BGQ-Mira-gnu-essl.cmake deleted file mode 100644 index 33a6a71856..0000000000 --- a/cmake/toolchains/BGQ-Mira-gnu-essl.cmake +++ /dev/null @@ -1,49 +0,0 @@ -# Set the system name so CMake uses the appropriate platform settings. -# NOTE: The platforms settings for BlueGeneP are the same for BlueGeneQ -set(CMAKE_SYSTEM_NAME BlueGeneP-static) - -# The serial compilers are typically set here, but, at least at some point, -# it was easier to set them to the MPI compilers. -set(GCC_DIR "/bgsys/drivers/ppcfloor/gnu-linux-4.7.2") -set(MPI_DIR "/bgsys/drivers/ppcfloor/comm/gcc") - -set(CMAKE_C_COMPILER ${GCC_DIR}/bin/powerpc64-bgq-linux-gcc) -set(CMAKE_CXX_COMPILER ${GCC_DIR}/bin/powerpc64-bgq-linux-g++) -set(CMAKE_Fortran_COMPILER ${GCC_DIR}/bin/powerpc64-bgq-linux-gfortran) - -# The MPI wrappers for the C and C++ compilers -set(MPI_C_COMPILER ${MPI_DIR}/bin/mpicc) -set(MPI_CXX_COMPILER ${MPI_DIR}/bin/mpicxx) - -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-g -O3") -endif() - -set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(LAPACK_LIB "/soft/libraries/alcf/current/gcc/LAPACK/lib") -set(ESSL_LIB "/soft/libraries/essl/current/essl/5.1/lib64") -set(IBMCMP_ROOT "/soft/compilers/ibmcmp-nov2012") -set(XLF_LIB "${IBMCMP_ROOT}/xlf/bg/14.1/bglib64") -set(XLSMP_LIB "${IBMCMP_ROOT}/xlsmp/bg/3.1/bglib64") - -set(LAPACK_FLAGS "-L${LAPACK_LIB} -llapack") -set(XLF_FLAGS "-L${XLF_LIB} -lxlf90_r") - -if(EL_HYBRID) - set(ESSL_FLAGS "-L${ESSL_LIB} -lesslsmpbg") - set(XL_FLAGS "-L${XLSMP_LIB} -lxlsmp") -else() - set(ESSL_FLAGS "-L${ESSL_LIB} -lesslbg") - set(XL_FLAGS "-L${XLSMP_LIB} -lxlomp_ser") -endif() - -#set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -#set(CMAKE_EXE_LINKER_FLAGS "-static") -set(MATH_LIBS "-L/soft/libraries/alcf/current/gcc/SCALAPACK/lib -lscalapack ${LAPACK_FLAGS} ${ESSL_FLAGS} ${XLF_FLAGS} ${XL_FLAGS} -lxlopt -lxlfmath -lxl -lgfortran -lm -lpthread -ldl -Wl,--allow-multiple-definition") diff --git a/cmake/toolchains/BGQ-Vesta-clang-essl.cmake b/cmake/toolchains/BGQ-Vesta-clang-essl.cmake deleted file mode 100644 index ff5266dbbd..0000000000 --- a/cmake/toolchains/BGQ-Vesta-clang-essl.cmake +++ /dev/null @@ -1,100 +0,0 @@ -#set(CMAKE_SYSTEM_NAME BlueGeneQ-static) - -set(GCC_ROOT "/bgsys/drivers/ppcfloor/gnu-linux") -set(GCC_NAME "powerpc64-bgq-linux") -set(CLANG_ROOT "/home/projects/llvm") -set(CLANG_MPI_ROOT "/home/projects/llvm/mpi/bgclang") -set(IBMCMP_ROOT "$ENV{IBM_MAIN_DIR}") - -set(MATH_ROOT "/soft/libraries/alcf/current/xl") -set(ESSL_ROOT "/soft/libraries/essl/current/essl/5.1") -set(BLAS_LIB "${MATH_ROOT}/BLAS/lib") -set(LAPACK_LIB "${MATH_ROOT}/LAPACK/lib") -set(ESSL_LIB "${ESSL_ROOT}/lib64") -set(MASS_LIB "${IBMCMP_ROOT}/xlmass/bg/7.3/bglib64") -set(XLF_LIB "${IBMCMP_ROOT}/xlf/bg/14.1/bglib64") -set(XLSMP_LIB "${IBMCMP_ROOT}/xlsmp/bg/3.1/bglib64") - -# V1R2M0 -#set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm/gcc") -#set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -# V1R2M1 -set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm") -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") - -# The serial compilers -set(CMAKE_C_COMPILER "${CLANG_ROOT}/wbin/bgclang") -set(CMAKE_CXX_COMPILER "${CLANG_ROOT}/wbin/bgclang++11") -set(CMAKE_Fortran_COMPILER "${GCC_ROOT}/bin/${GCC_NAME}-gfortran") - -# The MPI wrappers for the C and C++ compilers -set(MPI_C_COMPILER "${CLANG_MPI_ROOT}/bin/mpiclang") -set(MPI_CXX_COMPILER "${CLANG_MPI_ROOT}/bin/mpiclang++11") - -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_CXX_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_C_LINK_FLAGS "-L${MPI_ROOT}/lib -L${PAMI_ROOT}/lib -L${SPI_ROOT}/lib") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") - -# V1R2M0 -#set(MPI_C_LIBRARIES "-lmpich -lopa -lmpl -ldl -lpami -lSPI -lSPI_cnk -lpthread -lrt -lstdc++") -#set(MPI_CXX_LIBRARIES "-lcxxmpich ${MPI_C_LIBRARIES}") -# V1R2M1 -set(MPI_C_LIBRARIES "${MPI_C_LINK_FLAGS} -lmpich-xl -lopa-xl -lmpl-xl -lpami-gcc -lSPI -lSPI_cnk -lrt -lpthread -lstdc++ -lpthread") -set(MPI_CXX_LIBRARIES "${MPI_CXX_LINK_FLAGS} -lmpichcxx-xl ${MPI_C_LIBRARIES}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-g -O3") -endif() - -set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -set(OpenMP_CXX_FLAGS "-fopenmp") - -############################################################## - -# set the search path for the environment coming with the compiler -# and a directory where you can install your own compiled software -set(CMAKE_FIND_ROOT_PATH - /bgsys/drivers/ppcfloor/ - ${MPI_ROOT} - ${PAMI_ROOT} - ${SPI_ROOT} - ${GCC_ROOT} - ${IBMCMP_ROOT} - ${MATH_ROOT} - ${ESSL_ROOT}) - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -############################################################## - -set(LAPACK_FLAGS "-L${LAPACK_LIB} -llapack") -set(XLF_FLAGS "-L${XLF_LIB} -lxlf90_r") -set(MASS_FLAGS "-L${MASS_LIB} -lmassv -lmass") - -if(EL_HYBRID) - set(ESSL_FLAGS "-L${ESSL_LIB} -lesslsmpbg") - set(XL_FLAGS "-L${XLSMP_LIB} -lxlsmp") -else() - set(ESSL_FLAGS "-L${ESSL_LIB} -lesslbg") - set(XL_FLAGS "-L${XLSMP_LIB} -lxlomp_ser") -endif() - -#set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -#set(CMAKE_EXE_LINKER_FLAGS "-static") -#set(MATH_LIBS "${LAPACK_FLAGS} ${ESSL_FLAGS} ${XLF_FLAGS} ${XL_FLAGS} -lxlopt -lxlfmath -lxl -lgfortran -lm -lpthread -ldl -Wl,--allow-multiple-definition") - -# NOTE: It is apparently important that MATH_LIBS not begin with a full path -# to a particular file, e.g., /path/to/libname.a, as CMake is -# prepending -L for some reason. -set(MATH_LIBS "-L/soft/libraries/alcf/current/xl/SCALAPACK/lib -lscalapack ${LAPACK_FLAGS} ${ESSL_FLAGS} ${MASS_FLAGS} ${XLF_FLAGS} ${XL_FLAGS} -lxlopt -lxlfmath -lxl -lpthread -ldl -Wl,--allow-multiple-definition") diff --git a/cmake/toolchains/BGQ-Vesta-clang-netlib.cmake b/cmake/toolchains/BGQ-Vesta-clang-netlib.cmake deleted file mode 100644 index 521cbe408b..0000000000 --- a/cmake/toolchains/BGQ-Vesta-clang-netlib.cmake +++ /dev/null @@ -1,55 +0,0 @@ -#set(CMAKE_SYSTEM_NAME BlueGeneQ-static) - -# The serial compilers -set(GCC_ROOT "/bgsys/drivers/ppcfloor/gnu-linux") -set(GCC_NAME "powerpc64-bgq-linux") -set(CLANG_ROOT "/home/projects/llvm") -set(CMAKE_C_COMPILER "${CLANG_ROOT}/bin/bgclang") -set(CMAKE_CXX_COMPILER "${CLANG_ROOT}/bin/bgclang++") -set(CMAKE_Fortran_COMPILER "${GCC_ROOT}/bin/${GCC_NAME}-gfortran") - -# The MPI wrappers for the C and C++ compilers -set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm/gcc") -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_CXX_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_C_LINK_FLAGS "-L${MPI_ROOT}/lib -L${PAMI_ROOT}/lib -L${SPI_ROOT}/lib") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") -set(MPI_C_LIBRARIES "-lmpich -lopa -lmpl -ldl -lpami -lSPI -lSPI_cnk -lpthread -lrt -lstdc++") -set(MPI_CXX_LIBRARIES "-lcxxmpich ${MPI_C_LIBRARIES}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-g -O3") -endif() - -#set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -#set(OpenMP_CXX_FLAGS "-fopenmp") - -############################################################## - -# set the search path for the environment coming with the compiler -# and a directory where you can install your own compiled software -set(CMAKE_FIND_ROOT_PATH - /bgsys/drivers/ppcfloor/ - /bgsys/drivers/ppcfloor/gnu-linux/powerpc64-bgq-linux - /bgsys/drivers/ppcfloor/comm/gcc - /bgsys/drivers/ppcfloor/comm/sys/ - /bgsys/drivers/ppcfloor/spi/) - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -############################################################## - -#set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -#set(CMAKE_EXE_LINKER_FLAGS "-static") -set(MATH_LIBS "-L/soft/libraries/alcf/current/gcc/SCALAPACK/lib -lscalapack -L/soft/libraries/alcf/current/gcc/LAPACK/lib -llapack -L/soft/libraries/alcf/current/gcc/BLAS/lib -lblas -lgfortran -lm") diff --git a/cmake/toolchains/BGQ-Vesta-gnu-essl.cmake b/cmake/toolchains/BGQ-Vesta-gnu-essl.cmake deleted file mode 100644 index fe9522aeac..0000000000 --- a/cmake/toolchains/BGQ-Vesta-gnu-essl.cmake +++ /dev/null @@ -1,73 +0,0 @@ -#set(CMAKE_SYSTEM_NAME BlueGeneQ-static) - -# The serial compilers are typically set here, but, at least at some point, -# it was easier to set them to the MPI compilers. -set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm/gcc") -set(CMAKE_C_COMPILER ${MPI_ROOT}/bin/mpicc) -set(CMAKE_CXX_COMPILER ${MPI_ROOT}/bin/mpicxx) -set(CMAKE_Fortran_COMPILER ${MPI_ROOT}/bin/mpif77) - -# The MPI wrappers for the C and C++ compilers -set(MPI_C_COMPILER ${MPI_ROOT}/bin/mpicc) -set(MPI_CXX_COMPILER ${MPI_ROOT}/bin/mpicxx) - -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_CXX_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_C_LINK_FLAGS "-L${MPI_ROOT}/lib -L${PAMI_ROOT}/lib -L${SPI_ROOT}/lib") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") -set(MPI_C_LIBRARIES "-lmpich -lopa -lmpl -ldl -lpami -lSPI -lSPI_cnk -lpthread -lrt -lstdc++") -set(MPI_CXX_LIBRARIES "-lcxxmpich ${MPI_C_LIBRARIES}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-g -O3") -endif() - -set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -set(OpenMP_CXX_FLAGS "-fopenmp") - -############################################################## - -# set the search path for the environment coming with the compiler -# and a directory where you can install your own compiled software -set(CMAKE_FIND_ROOT_PATH - /bgsys/drivers/ppcfloor/ - /bgsys/drivers/ppcfloor/gnu-linux/powerpc64-bgq-linux - /bgsys/drivers/ppcfloor/comm/gcc - /bgsys/drivers/ppcfloor/comm/sys/ - /bgsys/drivers/ppcfloor/spi/) - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -############################################################## - -set(LAPACK_LIB "/soft/libraries/alcf/current/gcc/LAPACK/lib") -set(ESSL_LIB "/soft/libraries/essl/current/essl/5.1/lib64") -set(IBMCMP_ROOT "/soft/compilers/ibmcmp-nov2012") -set(XLF_LIB "${IBMCMP_ROOT}/xlf/bg/14.1/bglib64") -set(XLSMP_LIB "${IBMCMP_ROOT}/xlsmp/bg/3.1/bglib64") - -set(LAPACK_FLAGS "-L${LAPACK_LIB} -llapack") -set(XLF_FLAGS "-L${XLF_LIB} -lxlf90_r") - -if(EL_HYBRID) - set(ESSL_FLAGS "-L${ESSL_LIB} -lesslsmpbg") - set(XL_FLAGS "-L${XLSMP_LIB} -lxlsmp") -else() - set(ESSL_FLAGS "-L${ESSL_LIB} -lesslbg") - set(XL_FLAGS "-L${XLSMP_LIB} -lxlomp_ser") -endif() - -#set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -#set(CMAKE_EXE_LINKER_FLAGS "-static") -set(MATH_LIBS "-L/soft/libraries/alcf/current/gcc/SCALAPACK/lib -lscalapack ${LAPACK_FLAGS} ${ESSL_FLAGS} ${XLF_FLAGS} ${XL_FLAGS} -lxlopt -lxlfmath -lxl -lgfortran -lm -lpthread -ldl -Wl,--allow-multiple-definition") diff --git a/cmake/toolchains/BGQ-Vesta-gnu-netlib.cmake b/cmake/toolchains/BGQ-Vesta-gnu-netlib.cmake deleted file mode 100644 index a2b771b53b..0000000000 --- a/cmake/toolchains/BGQ-Vesta-gnu-netlib.cmake +++ /dev/null @@ -1,56 +0,0 @@ -#set(CMAKE_SYSTEM_NAME BlueGeneQ-static) - -# The serial compilers are typically set here, but, at least at some point, -# it was easier to set them to the MPI compilers. -set(MPI_ROOT "/bgsys/drivers/ppcfloor/comm/gcc") -set(CMAKE_C_COMPILER ${MPI_ROOT}/bin/mpicc) -set(CMAKE_CXX_COMPILER ${MPI_ROOT}/bin/mpicxx) -set(CMAKE_Fortran_COMPILER ${MPI_ROOT}/bin/mpif77) - -# The MPI wrappers for the C and C++ compilers -set(MPI_C_COMPILER ${MPI_ROOT}/bin/mpicc) -set(MPI_CXX_COMPILER ${MPI_ROOT}/bin/mpicxx) - -set(PAMI_ROOT "/bgsys/drivers/ppcfloor/comm/sys") -set(SPI_ROOT "/bgsys/drivers/ppcfloor/spi") -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_CXX_INCLUDE_PATH "${MPI_ROOT}/include") -set(MPI_C_LINK_FLAGS "-L${MPI_ROOT}/lib -L${PAMI_ROOT}/lib -L${SPI_ROOT}/lib") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") -set(MPI_C_LIBRARIES "-lmpich -lopa -lmpl -ldl -lpami -lSPI -lSPI_cnk -lpthread -lrt -lstdc++") -set(MPI_CXX_LIBRARIES "-lcxxmpich ${MPI_C_LIBRARIES}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-g -O3") -endif() - -set(CMAKE_THREAD_LIBS_INIT "-fopenmp") -set(OpenMP_CXX_FLAGS "-fopenmp") - -############################################################## - -# set the search path for the environment coming with the compiler -# and a directory where you can install your own compiled software -set(CMAKE_FIND_ROOT_PATH - /bgsys/drivers/ppcfloor/ - /bgsys/drivers/ppcfloor/gnu-linux/powerpc64-bgq-linux - /bgsys/drivers/ppcfloor/comm/gcc - /bgsys/drivers/ppcfloor/comm/sys/ - /bgsys/drivers/ppcfloor/spi/) - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -############################################################## - -#set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -#set(CMAKE_EXE_LINKER_FLAGS "-static") -set(MATH_LIBS "-L/soft/libraries/alcf/current/gcc/SCALAPACK/lib -lscalapack -L/soft/libraries/alcf/current/gcc/LAPACK/lib -llapack -L/soft/libraries/alcf/current/gcc/BLAS/lib -lblas -lgfortran -lm") diff --git a/cmake/toolchains/Edison-gnu-mpich-libsci.cmake b/cmake/toolchains/Edison-gnu-mpich-libsci.cmake deleted file mode 100644 index 75b7fc6e0c..0000000000 --- a/cmake/toolchains/Edison-gnu-mpich-libsci.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# NOTE: You will need to have the GNU environment loaded, e.g., via the command -# -# module swap PrgEnv-intel PrgEnv-gnu -# - -# The Cray wrappers -set(COMPILER_DIR $ENV{CRAYPE_DIR}/bin) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/cc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/CC) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/ftn) - -# This is just a hack, as this machine always uses the above wrappers -set(MPI_C_COMPILER ${CMAKE_C_COMPILER}) -set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER}) -set(MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER}) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(C_FLAGS "-g -static -Wl,-Bstatic") - set(CXX_FLAGS "-g -static -Wl,-Bstatic") -else() - set(C_FLAGS "-O3 -static -Wl,-Bstatic") - set(CXX_FLAGS "-O3 -static -Wl,-Bstatic") -endif() - -set(OpenMP_CXX_FLAGS "-fopenmp") - -string(REPLACE " " ";" GNU_VERSIONS $ENV{PE_LIBSCI_GENCOMPS_GNU_x86_64}) -list(GET GNU_VERSIONS 0 GNU_VERSION_NUMBER) -set(MATH_LIBS "/opt/cray/libsci/default/GNU/${GNU_VERSION_NUMBER}/sandybridge/lib/libsci_gnu.a") -set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -set(BUILD_SHARED_LIBS OFF) -set(CMAKE_EXE_LINKER_FLAGS "-static") diff --git a/cmake/toolchains/Edison-intel-mpich-mkl.cmake b/cmake/toolchains/Edison-intel-mpich-mkl.cmake deleted file mode 100644 index 1313bbff34..0000000000 --- a/cmake/toolchains/Edison-intel-mpich-mkl.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# In your environment: -# export CRAY_LINK_TYPE=static -# module load cmake (must use patched version) -# module load cray-mpich/7* (any 7+ version is ok) -# module load gcc/4.9.2 && module load PrgEnv-intel -# module unload darshan (causes more trouble than it is worth) -# -# You must invoke CMake with "-DBUILD_SHARED_LIBS=OFF", which will disable Python. -# -# Here is an example: -# -# cd /tmp/build-elemental && export CRAY_LINK_TYPE=static ; module load cmake ; module load gcc ; module unload darshan ; rm -rf * && cmake /global/project/projectdirs/m1907/Elemental/ -DCMAKE_TOOLCHAIN_FILE=/global/project/projectdirs/m1907/Elemental/cmake/toolchains/Edison-intel-mpich-mkl.cmake -DCMAKE_INSTALL_PREFIX=/global/project/projectdirs/m1907/Elemental/install-intel-mpich-mkl -DBUILD_SHARED_LIBS=OFF -# - -# The Cray wrappers -set(COMPILER_DIR $ENV{CRAYPE_DIR}/bin) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/cc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/CC) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/ftn) - -# This is just a hack, as this machine always uses the above wrappers -set(MPI_C_COMPILER ${CMAKE_C_COMPILER}) -set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER}) -set(MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER}) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(C_FLAGS "-g -static -Wl,-Bstatic") - set(CXX_FLAGS "-g -static -Wl,-Bstatic") -else() - set(C_FLAGS "-O3 -static -Wl,-Bstatic") - set(CXX_FLAGS "-O3 -static -Wl,-Bstatic") -endif() - -set(OpenMP_CXX_FLAGS "-openmp") - -# We are using ScaLAPACK from MKL, which is compiled against Intel MPI. -# We leverage ABI compatibility (http://www.mpich.org/abi/) between -# Intel MPI 5 and Cray MPI 7 and hope for the best. -# A more robust solution will be available in the future. -set(MATH_LIBS "-mkl=cluster") -set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -set(BUILD_SHARED_LIBS OFF) -set(CMAKE_EXE_LINKER_FLAGS "-static") - -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS " ") -set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS " ") -set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS " ") diff --git a/cmake/toolchains/Hopper-gnu-mpich2-libsci.cmake b/cmake/toolchains/Hopper-gnu-mpich2-libsci.cmake deleted file mode 100644 index 53998bb8a8..0000000000 --- a/cmake/toolchains/Hopper-gnu-mpich2-libsci.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# NOTE: You will need to have the GNU environment loaded, e.g., via the command -# -# module swap PrgEnv-pgi PrgEnv-gnu -# - -# The Cray wrappers -set(COMPILER_DIR /opt/cray/xt-asyncpe/5.10/bin) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/cc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/CC) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/ftn) - -# This is just a hack, as this machine always uses the above wrappers -set(MPI_C_COMPILER ${CMAKE_C_COMPILER}) -set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER}) -set(MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER}) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3 -ffast-math") -endif() - -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(MATH_LIBS "/opt/xt-libsci/11.0.06/gnu/46/mc12/lib/libsci_gnu.a;/opt/gcc/4.7.1/snos/lib64/libgfortran.a;-lm") diff --git a/cmake/toolchains/Lonestar-intel-mvapich2-mkl.cmake b/cmake/toolchains/Lonestar-intel-mvapich2-mkl.cmake deleted file mode 100644 index 1c84ee25ad..0000000000 --- a/cmake/toolchains/Lonestar-intel-mvapich2-mkl.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# The serial Intel compilers -set(COMPILER_DIR /opt/apps/intel/11.1/bin/intel64) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/icc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/icpc) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/ifort) - -# The MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/intel11_1/mvapich2/1.6/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_Fortran_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH /opt/apps/intel11_1/mvapich2/1.6/include) -set(MPI_CXX_INCLUDE_PATH ${MPI_C_INCLUDE_PATH}) -set(MPI_Fortran_INCLUDE_PATH ${MPI_C_INCLUDE_PATH}) -set(MPI_C_LINK_FLAGS "-Wl,-rpath,/opt/apps/intel/11.1/lib/intel64 -L/opt/apps/intel/11.1/lib/intel64 -Wl,-rpath,/opt/apps/limic2/0.5.4/lib -L/opt/apps/limic2/0.5.4/lib -L/opt/apps/intel11_1/mvapich2/1.6/lib -L/opt/ofed/lib64/") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") -set(MPI_BASE_LIBS - "-lmpich -lopa -llimic2 -lpthread -lrdmacm -libverbs -libumad -ldl -lrt") -set(MPI_C_LIBRARIES "-limf ${MPI_BASE_LIBS}") -set(MPI_CXX_LIBRARIES "-limf -lmpichcxx ${MPI_BASE_LIBS}") -set(MPI_Fortran_LIBRARIES "-limf -lmpichf90 ${MPI_BASE_LIBS}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-openmp") - -if(EL_HYBRID) - set(MATH_LIBS "-L/opt/apps/intel/11.1/mkl/lib/em64t -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -lpthread /opt/apps/intel/11.1/lib/intel64/libifcore.a /opt/apps/intel/11.1/lib/intel64/libsvml.a") -else() - set(MATH_LIBS "-L/opt/apps/intel/11.1/mkl/lib/em64t -lmkl_intel_lp64 -lmkl_sequential -lmkl_core /opt/apps/intel/11.1/lib/intel64/libifcore.a /opt/apps/intel/11.1/lib/intel64/libsvml.a") -endif() diff --git a/cmake/toolchains/Longhorn-intel-mvapich2-mkl.cmake b/cmake/toolchains/Longhorn-intel-mvapich2-mkl.cmake deleted file mode 100644 index b518d5a30b..0000000000 --- a/cmake/toolchains/Longhorn-intel-mvapich2-mkl.cmake +++ /dev/null @@ -1,37 +0,0 @@ -# The serial Intel compilers -set(COMPILER_DIR /opt/apps/intel/11.1/bin/intel64) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/icc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/icpc) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/ifort) - -# The MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/intel11_1/mvapich2/1.4/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_Fortran_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH /opt/apps/intel11_1/mvapich2/1.4/include) -set(MPI_CXX_INCLUDE_PATH ${MPI_C_INCLUDE_PATH}) -set(MPI_Fortran_INCLUDE_PATH ${MPI_C_INCLUDE_PATH}) -set(MPI_C_LINK_FLAGS "-Wl,-rpath,/opt/apps/intel/11.1/lib/intel64 -Wl,-rpath,/opt/apps/intel/11.1/lib/intel64 -Wl,-rpath -L/opt/apps/intel11_1/mvapich2/1.4/lib -L/opt/ofed/lib64/") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") -set(MPI_BASE_LIBS "-lmpich -lpthread -lrdmacm -libverbs -libumad -ldl -lrt") -set(MPI_C_LIBRARIES "-limf ${MPI_BASE_LIBS}") -set(MPI_CXX_LIBRARIES "-limf -lmpichcxx ${MPI_BASE_LIBS}") -set(MPI_Fortran_LIBRARIES "-limf -lmpichf90 ${MPI_BASE_LIBS}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-openmp") - -if(EL_HYBRID) - set(MATH_LIBS "-L/opt/apps/intel/11.1/mkl/lib/em64t -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -lguide -lpthread -lm") -else() - set(MATH_LIBS "-L/opt/apps/intel/mkl/10.2.2.025/lib/em64t -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lm") -endif() diff --git a/cmake/toolchains/Mac-MPI-Accelerate.cmake b/cmake/toolchains/Mac-MPI-Accelerate.cmake deleted file mode 100644 index c7f7f5bf94..0000000000 --- a/cmake/toolchains/Mac-MPI-Accelerate.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# MPI wrappers assumed to be in path -set(COMPILER_DIR ) -set(CMAKE_C_COMPILER ${COMPILER_DIR}mpicc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}mpicxx) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}mpif90) - -set(MPI_C_COMPILER ${CMAKE_C_COMPILER}) -set(MPI_CXX_COMPILER ${CMAKE_CXX_COMPILER}) -set(MPI_Fortran_COMPILER ${CMAKE_Fortran_COMPILER}) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(C_FLAGS "-g") - set(CXX_FLAGS "-g") -else() - set(C_FLAGS "-O3") - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(MATH_LIBS "-framework Accelerate") -set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) -set(BUILD_SHARED_LIBS ON) -set(CMAKE_EXE_LINKER_FLAGS "") diff --git a/cmake/toolchains/README.md b/cmake/toolchains/README.md deleted file mode 100644 index a34ec542c2..0000000000 --- a/cmake/toolchains/README.md +++ /dev/null @@ -1,5 +0,0 @@ -### `cmake/toolchains/` - -This folder contains a variety of toolchain files (several user-contributed) -which are in different states of repair. They are provided in the hopes that -they might be useful but it is likely that at least one is non-functional. diff --git a/cmake/toolchains/Ranger-gnu-mvapich-mkl.cmake b/cmake/toolchains/Ranger-gnu-mvapich-mkl.cmake deleted file mode 100644 index de1df4f838..0000000000 --- a/cmake/toolchains/Ranger-gnu-mvapich-mkl.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Set the serial GCC compilers -set(COMPILER_DIR /opt/apps/gcc_amd/4.4.5/bin) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/gcc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/g++) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/gfortran) - -# Set the MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/gcc4_4/mvapich/1.0.1/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(MATH_LIBS - "-L/opt/apps/intel/mkl/10.0.1.014/lib/em64t -lmkl_em64t -lmkl -lguide -lpthread /opt/apps/gcc_amd/4.4.5/lib64/libgfortran.a -lm") - diff --git a/cmake/toolchains/Ranger-gnu-mvapich2-mkl.cmake b/cmake/toolchains/Ranger-gnu-mvapich2-mkl.cmake deleted file mode 100644 index 8bbcc7ddf3..0000000000 --- a/cmake/toolchains/Ranger-gnu-mvapich2-mkl.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Set the serial GCC compilers -set(COMPILER_DIR /opt/apps/gcc_amd/4.4.5/bin) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/gcc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/g++) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/gfortran) - -# Set the MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/gcc4_4/mvapich2/1.2/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(MATH_LIBS - "-L/opt/apps/intel/mkl/10.0.1.014/lib/em64t -lmkl_em64t -lmkl -lguide -lpthread /opt/apps/gcc_amd/4.4.5/lib64/libgfortran.a -lm") - diff --git a/cmake/toolchains/Ranger-intel-mvapich-mkl.cmake b/cmake/toolchains/Ranger-intel-mvapich-mkl.cmake deleted file mode 100644 index 5dce9e5274..0000000000 --- a/cmake/toolchains/Ranger-intel-mvapich-mkl.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# Set the serial Intel compilers -set(COMPILER_DIR /opt/apps/intel/10.1) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/cc/bin/icc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/cc/bin/icpc) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/fc/bin/ifort) - -# Set the MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/intel10_1/mvapich/1.0.1/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -set(MPI_C_COMPILE_FLAGS "") -set(MPI_CXX_COMPILE_FLAGS "") -set(MPI_Fortran_COMPILE_FLAGS "") -set(MPI_C_INCLUDE_PATH /opt/apps/intel10_1/mvapich/1.0.1/include) -set(MPI_CXX_INCLUDE_PATH ${MPI_C_INCLUDE_PATH}) -set(MPI_Fortran_INCLUDE_PATH ${MPI_C_INCLUDE_PATH}) -set(MPI_C_LINK_FLAGS "-Wl,-rpath,/opt/apps/intel10_1/mvapich/1.0.1/lib/shared -Wl,-rpath,/opt/apps/intel10_1/mvapich/1.0.1/lib -i-dynamic -Wl,-rpath,/opt/apps/intel/10.1/fc/lib -Wl,-rpath,/opt/apps/intel/10.1/cc/lib -i-dynamic -L/opt/apps/intel10_1/mvapich/1.0.1/lib -L/opt/apps/intel10_1/mvapich/1.0.1/lib/shared -L/usr/lib64 -L/opt/ofed/lib64") -set(MPI_CXX_LINK_FLAGS "${MPI_C_LINK_FLAGS}") -set(MPI_BASE_LIBS "-lmpich -libverbs -libumad -lpthread -lrt") -set(MPI_C_LIBRARIES "${MPI_BASE_LIBS}") -set(MPI_CXX_LIBRARIES "-lpmpich++ ${MPI_BASE_LIBS}") -set(MPI_Fortran_LIBRARIES "-lmpichf90nc -lmpichfarg ${MPI_BASE_LIBS}") - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-openmp") - -set(MATH_LIBS - "-L/opt/apps/intel/mkl/10.0.1.014/lib/em64t -lmkl_em64t -lmkl -lguide -lpthread /opt/apps/intel/10.1/fc/lib/libifcore.a /opt/apps/intel/10.1/fc/lib/libsvml.a -lm") diff --git a/cmake/toolchains/Ranger-intel-mvapich2-mkl.cmake b/cmake/toolchains/Ranger-intel-mvapich2-mkl.cmake deleted file mode 100644 index 6d8cbe256e..0000000000 --- a/cmake/toolchains/Ranger-intel-mvapich2-mkl.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Set the serial Intel compilers -set(COMPILER_DIR /opt/apps/intel/10.1) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/cc/bin/icc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/cc/bin/icpc) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/fc/bin/ifort) - -# Set the MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/intel10_1/mvapich2/1.2/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-openmp") - -set(MATH_LIBS - "-L/opt/apps/intel/mkl/10.0.1.014/lib/em64t -lmkl_em64t -lmkl -lguide -lpthread /opt/apps/intel/10.1/fc/lib/libifcore.a /opt/apps/intel/10.1/fc/lib/libsvml.a -lm") - diff --git a/cmake/toolchains/Stampede-gnu-mvapich2-mkl.cmake b/cmake/toolchains/Stampede-gnu-mvapich2-mkl.cmake deleted file mode 100644 index ab4d752d8a..0000000000 --- a/cmake/toolchains/Stampede-gnu-mvapich2-mkl.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# The serial GNU compilers -set(COMPILER_DIR /opt/apps/gcc/4.9.1/bin) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/gcc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/g++) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/gfortran) - -# The MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/gcc4_9/mvapich2/2.1/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-fopenmp") - -set(MATH_LIBS "-L/opt/apps/intel/15/composer_xe_2015.2.164/mkl/lib/intel64 -lmkl_intel_lp64 -lmkl_core -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_sequential -lpthread -lgfortran /opt/apps/intel/15/composer_xe_2015.2.164/compiler/lib/intel64/libimf.a /opt/apps/intel/15/composer_xe_2015.2.164/compiler/lib/intel64/libirc.a -lm") diff --git a/cmake/toolchains/Stampede-intel-mvapich2-mkl.cmake b/cmake/toolchains/Stampede-intel-mvapich2-mkl.cmake deleted file mode 100644 index 020db45583..0000000000 --- a/cmake/toolchains/Stampede-intel-mvapich2-mkl.cmake +++ /dev/null @@ -1,21 +0,0 @@ -# The serial Intel compilers -set(COMPILER_DIR /opt/apps/intel/15/composer_xe_2015.2.164/bin/intel64) -set(CMAKE_C_COMPILER ${COMPILER_DIR}/icc) -set(CMAKE_CXX_COMPILER ${COMPILER_DIR}/icpc) -set(CMAKE_Fortran_COMPILER ${COMPILER_DIR}/ifort) - -# The MPI wrappers for the C and C++ compilers -set(MPI_COMPILER_DIR /opt/apps/intel15/mvapich2/2.1/bin) -set(MPI_C_COMPILER ${MPI_COMPILER_DIR}/mpicc) -set(MPI_CXX_COMPILER ${MPI_COMPILER_DIR}/mpicxx) -set(MPI_Fortran_COMPILER ${MPI_COMPILER_DIR}/mpif90) - -if(CMAKE_BUILD_TYPE MATCHES Debug) - set(CXX_FLAGS "-g") -else() - set(CXX_FLAGS "-O3") -endif() - -set(OpenMP_CXX_FLAGS "-openmp") - -set(MATH_LIBS "-L/opt/apps/intel/15/composer_xe_2015.2.164/mkl/lib/intel64 -L/opt/apps/intel/15/composer_xe_2015.2.164/compiler/lib/intel64 -lmkl_rt") diff --git a/doxy/Doxyfile.in b/doxy/Doxyfile.in new file mode 100644 index 0000000000..13165db570 --- /dev/null +++ b/doxy/Doxyfile.in @@ -0,0 +1,2352 @@ +# Doxyfile 1.8.8 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all text +# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv +# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv +# for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "Hydrogen" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is included in +# the documentation. The maximum height of the logo should not exceed 55 pixels +# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo +# to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a +# new page for each member. If set to NO, the documentation of a member will be +# part of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines. + +ALIASES = + +# This tag can be used to specify a number of word-keyword mappings (TCL only). +# A mapping has the form "name=value". For example adding "class=itcl::class" +# will allow you to use the command class in the itcl::class meaning. + +TCL_SUBST = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, Javascript, +# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: +# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: +# Fortran. In the later case the parser tries to guess whether the code is fixed +# or free formatted code, this is the default for Fortran type files), VHDL. For +# instance to make doxygen treat .inc files as Fortran files (default is PHP), +# and .f files as C (default is Fortran), use: inc=Fortran f=C. +# +# Note For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See http://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by by putting a % sign in front of the word +# or globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO these classes will be included in the various overviews. This option has +# no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the +# todo list. This list is created by putting \todo commands in the +# documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the +# test list. This list is created by putting \test commands in the +# documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES the list +# will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO doxygen will only warn about wrong or incomplete parameter +# documentation, but not about the absence of documentation. +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. +# Note: If this tag is empty the current directory is searched. + +INPUT = @CMAKE_SOURCE_DIR@/include @CMAKE_SOURCE_DIR@/src + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: http://www.gnu.org/software/libiconv) for the list of +# possible encodings. +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank the +# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii, +# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, +# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, +# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, +# *.qsf, *.as and *.js. + +FILE_PATTERNS = + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = @CMAKE_SOURCE_DIR@/include/El/core/DistMatrix/Block @CMAKE_SOURCE_DIR@/include/El/core/DistMatrix/Block.hpp @CMAKE_SOURCE_DIR@/src/core/DistMatrix/Block @CMAKE_SOURCE_DIR@/src/core/DistMatrix/Block.cpp + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER ) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# function all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES, then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see http://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the config file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the +# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the +# cost of reduced performance. This can be particularly helpful with template +# rich C++ code for which doxygen's built-in parser lacks the necessary type +# information. +# Note: The availability of this option depends on whether or not doxygen was +# compiled with the --with-libclang option. +# The default value is: NO. + +CLANG_ASSISTED_PARSING = NO + +# If clang assisted parsing is enabled you can provide the compiler with command +# line options that you would normally use when invoking the compiler. Note that +# the include paths will already be set by doxygen for the files and directories +# specified with INPUT and INCLUDE_PATH. +# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES. + +CLANG_OPTIONS = + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +COLS_IN_ALPHA_INDEX = 2 + +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefor more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra stylesheet files is of importance (e.g. the last +# stylesheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the stylesheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# http://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting this +# to NO can help when comparing the output of multiple runs. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_TIMESTAMP = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: http://developer.apple.com/tools/xcode/), introduced with +# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler ( hhc.exe). If non-empty +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated ( +# YES) or that it should be included in the master .chm file ( NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated ( +# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# http://www.mathjax.org) which uses client side Javascript for the rendering +# instead of using prerendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from http://www.mathjax.org before deployment. +# The default value is: http://cdn.mathjax.org/mathjax/latest. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /