<commit_before>#
#  Copyright 2009-2015, <NAME>
#  All rights reserved.
#
#  Copyright 2012, <NAME>
#  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
#
cmake_minimum_required(VERSION 2.8.12)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckFunctionExists)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/cmake/")
include(GetGitRevisionDescription)
include(language_support_v2)

project(Elemental)
set(EL_VERSION_MAJOR 0)
set(EL_VERSION_MINOR 86-dev)

# 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.
#
#   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: Add list of MPI variables here, such as "MPI_CXX_COMPILE_FLAGS"

# TODO: Add discussion of "MATH_LIBS" and "REFERENCE_ROOT"

option(BUILD_SHARED_LIBS "Build shared libraries?" ON)

# 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)
  option(INSTALL_PYTHON_PACKAGE "Install Python interface? (requires Python 2.x)" FALSE)

  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)

# NOTE: This is not yet used within Elemental...
#
# If BUILD_KISSFFT is set to 'OFF', then an external KISSFFT can be
# built by defining:
#   KISSFFT_INCLUDE_DIR: The directory containing kiss_fft.h
#   KISSFFT_LIBS: The list of KISS-FFT libraries to link
option(BUILD_KISSFFT "Build KISS FFT" OFF)

option(EL_EXAMPLES "Build simple examples?" OFF)
option(EL_TESTS "Build performance and correctness tests?" OFF)
option(EL_EXPERIMENTAL "Build experimental code" OFF)

# 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)

# 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)
    set(EL_USE_64BIT_INTS ON)
endif()

option(EL_USE_CUSTOM_ALLTOALLV "Avoid MPI_Alltoallv for performance reasons" ON)
option(EL_BARRIER_IN_ALLTOALLV "Barrier before posting non-blocking recvs" OFF)

# If the version of METIS packaged with Elemental is to be built (the default),
# then no METIS-specific variables need to be specified, but if the user prefers
# to use their own version, then the root path of the installation should be
# passed in via the METIS_ROOT variable.
option(BUILD_METIS "Build METIS" ON)

# ParMETIS cannot yet be legally distributed under an unrestrictive
# license and is currently limited to educational and research purposes.
# (recent versions of METIS can be distributed under the Apache License
# Version 2).
#
# However, if the user is in an educational or government institution, then
# it is possible to re-enable support for ParMETIS by specifying the following
# variables:
#
#   METIS_ROOT: the full path to the root of the MeTiS source tree
#   PARMETIS_ROOT: the full path to the root of the ParMeTiS source tree
#   PARMETIS_LIBS: the list of ParMETIS libraries to link to
#   PARMETIS_TLS_PATCH: defined iff there is a GKlib configure file
#                       (if you have not heard of this, ignore it)
#   GKLIB_INCLUDE_DIR: if PARMETIS_TLS_PATCH is defined, this should point
#                      to the directory containing gklib_tls.h
#
# and adding in a custom ParMETIS routine for performing nodal bisections
# in parallel (which was originally part of Clique and can be easily found).
# Please contact <EMAIL> or <EMAIL> for more details.
#
#option(BUILD_PARMETIS "Build ParMETIS" OFF)

# Advanced options
# ----------------

# 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)

# Handle RPATHs for Mac
# =====================
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 the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# the 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()

# Build logic
# ===========

# 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
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_DEBUG FALSE)
else()
  set(EL_DEBUG TRUE)
endif()
string(TOUPPER ${CMAKE_BUILD_TYPE} UPPER_BUILD_TYPE)

# Set the basic compile flags from the build type
if(NOT WIN32)
  set(LANGUAGES CXX C Fortran)
  foreach(LANG ${LANGUAGES})
    if(NOT ${LANG}_FLAGS)
      if(EL_DEBUG)
        if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
          set(${LANG}_FLAGS "-O2 -g -Wunused-variable -Wunused-but-set-variable -Wunused-local-typedefs" CACHE STRING "${LANG} optimization/debug flags for ${UPPER_BUILD_TYPE} mode")
        else()
          set(${LANG}_FLAGS "-O2 -g" CACHE STRING
            "${LANG} optimization/debug flags for ${UPPER_BUILD_TYPE} mode")
        endif()
      else()
        set(${LANG}_FLAGS "-O3" CACHE STRING
          "${LANG} optimization flags for ${UPPER_BUILD_TYPE} mode")
      endif()
    endif()
  endforeach()
endif()

if(BUILD_PARMETIS)
  message(FATAL_ERROR "ParMETIS cannot be legally distributed with Elemental under a permissive license. A version of Elemental restricted to educational purposes which contains ParMETIS will hopefully soon be available.")
#  add_subdirectory(external/parmetis)
#  set(EL_HAVE_METIS TRUE)
#  set(EL_HAVE_PARMETIS TRUE)
#
#  set(PARMETIS_ROOT ${PROJECT_SOURCE_DIR}/external/parmetis)
#  set(METIS_ROOT ${PROJECT_SOURCE_DIR}/external/parmetis/metis)
#  set(GKLIB_INCLUDE_DIR ${PROJECT_BINARY_DIR}/external/parmetis/include)
#
#  include_directories(${GKLIB_INCLUDE_DIR})
#  include_directories(${METIS_ROOT}/include)
#  include_directories(${PARMETIS_ROOT}/include)
elseif(METIS_ROOT AND PARMETIS_ROOT)
  message(FATAL_ERROR "ParMETIS cannot be legally distributed with Elemental under a permissive license. A version of Elemental restricted to educational purposes which contains ParMETIS will hopefully soon be available.")
#  set(EL_HAVE_METIS TRUE)
#  set(EL_HAVE_PARMETIS TRUE)
#  if(PARMETIS_TLS_PATCH)
#    include_directories(${GKLIB_INCLUDE_DIR})
#  endif()
#
#  include_directories(${METIS_ROOT}/include)<commit_msg>Defining EL_RELEASE instead of EL_DEBUG (which was causing the Debug version to effectively be built default)<commit_after>#
#  Copyright 2009-2015, <NAME>
#  All rights reserved.
#
#  Copyright 2012, <NAME>
#  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
#
cmake_minimum_required(VERSION 2.8.12)
include(CheckCSourceCompiles)
include(CheckCXXSourceCompiles)
include(CheckFunctionExists)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/external/cmake/")
include(GetGitRevisionDescription)
include(language_support_v2)

project(Elemental)
set(EL_VERSION_MAJOR 0)
set(EL_VERSION_MINOR 86-dev)

# 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.
#
#   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: Add list of MPI variables here, such as "MPI_CXX_COMPILE_FLAGS"

# TODO: Add discussion of "MATH_LIBS" and "REFERENCE_ROOT"

option(BUILD_SHARED_LIBS "Build shared libraries?" ON)

# 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)
  option(INSTALL_PYTHON_PACKAGE "Install Python interface? (requires Python 2.x)" FALSE)

  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)

# NOTE: This is not yet used within Elemental...
#
# If BUILD_KISSFFT is set to 'OFF', then an external KISSFFT can be
# built by defining:
#   KISSFFT_INCLUDE_DIR: The directory containing kiss_fft.h
#   KISSFFT_LIBS: The list of KISS-FFT libraries to link
option(BUILD_KISSFFT "Build KISS FFT" OFF)

option(EL_EXAMPLES "Build simple examples?" OFF)
option(EL_TESTS "Build performance and correctness tests?" OFF)
option(EL_EXPERIMENTAL "Build experimental code" OFF)

# 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)

# 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)
    set(EL_USE_64BIT_INTS ON)
endif()

option(EL_USE_CUSTOM_ALLTOALLV "Avoid MPI_Alltoallv for performance reasons" ON)
option(EL_BARRIER_IN_ALLTOALLV "Barrier before posting non-blocking recvs" OFF)

# If the version of METIS packaged with Elemental is to be built (the default),
# then no METIS-specific variables need to be specified, but if the user prefers
# to use their own version, then the root path of the installation should be
# passed in via the METIS_ROOT variable.
option(BUILD_METIS "Build METIS" ON)

# ParMETIS cannot yet be legally distributed under an unrestrictive
# license and is currently limited to educational and research purposes.
# (recent versions of METIS can be distributed under the Apache License
# Version 2).
#
# However, if the user is in an educational or government institution, then
# it is possible to re-enable support for ParMETIS by specifying the following
# variables:
#
#   METIS_ROOT: the full path to the root of the MeTiS source tree
#   PARMETIS_ROOT: the full path to the root of the ParMeTiS source tree
#   PARMETIS_LIBS: the list of ParMETIS libraries to link to
#   PARMETIS_TLS_PATCH: defined iff there is a GKlib configure file
#                       (if you have not heard of this, ignore it)
#   GKLIB_INCLUDE_DIR: if PARMETIS_TLS_PATCH is defined, this should point
#                      to the directory containing gklib_tls.h
#
# and adding in a custom ParMETIS routine for performing nodal bisections
# in parallel (which was originally part of Clique and can be easily found).
# Please contact <EMAIL> or <EMAIL> for more details.
#
#option(BUILD_PARMETIS "Build ParMETIS" OFF)

# Advanced options
# ----------------

# 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)

# Handle RPATHs for Mac
# =====================
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 the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

# the 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()

# Build logic
# ===========

# 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
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
if(NOT WIN32)
  set(LANGUAGES CXX C Fortran)
  foreach(LANG ${LANGUAGES})
    if(NOT ${LANG}_FLAGS)
      if(EL_RELEASE)
        set(${LANG}_FLAGS "-O3" CACHE STRING
          "${LANG} optimization flags for ${UPPER_BUILD_TYPE} mode")
      else()
        if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
          set(${LANG}_FLAGS "-O2 -g -Wunused-variable -Wunused-but-set-variable -Wunused-local-typedefs" CACHE STRING "${LANG} optimization/debug flags for ${UPPER_BUILD_TYPE} mode")
        else()
          set(${LANG}_FLAGS "-O2 -g" CACHE STRING
            "${LANG} optimization/debug flags for ${UPPER_BUILD_TYPE} mode")
        endif()
      endif()
    endif()
  endforeach()
endif()

if(BUILD_PARMETIS)
  message(FATAL_ERROR "ParMETIS cannot be legally distributed with Elemental under a permissive license. A version of Elemental restricted to educational purposes which contains ParMETIS will hopefully soon be available.")
#  add_subdirectory(external/parmetis)
#  set(EL_HAVE_METIS TRUE)
#  set(EL_HAVE_PARMETIS TRUE)
#
#  set(PARMETIS_ROOT ${PROJECT_SOURCE_DIR}/external/parmetis)
#  set(METIS_ROOT ${PROJECT_SOURCE_DIR}/external/parmetis/metis)
#  set(GKLIB_INCLUDE_DIR ${PROJECT_BINARY_DIR}/external/parmetis/include)
#
#  include_directories(${GKLIB_INCLUDE_DIR})
#  include_directories(${METIS_ROOT}/include)
#  include_directories(${PARMETIS_ROOT}/include)
elseif(METIS_ROOT AND PARMETIS_ROOT)
  message(FATAL_ERROR "ParMETIS cannot be legally distributed with Elemental under a permissive license. A version of Elemental restricted to educational purposes which contains ParMETIS will hopefully soon be available.")
#  set(EL_HAVE_METIS TRUE)
#  set(EL_HAVE_PARMETIS TRUE)
#  if(PARMETIS_TLS_PATCH)
#    include_directories(${GKLIB_INCLUDE_DIR})
#  endif()
#
#  include_directories(${METIS_ROOT}/include)
{'fraction_non_alphanumeric': 0.07783082605170705, 'fraction_numerical': 0.005224754526619224, 'mean_word_length': 5.043277082199238, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2302637', 'n_tokens_mistral': 7351, 'n_tokens_neox': 6934, 'n_words': 2444}