<commit_before>include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

cmake_minimum_required(VERSION 2.6)

SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_CXX_COMPILER g++)

project(HERMES)

execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GXX_VERSION)

if(GCC_VERSION VERSION_LESS 4.8)
  message(FATAL_ERROR "gcc version < 4.8")
endif()

if(GXX_VERSION VERSION_LESS 4.8)
  message(FATAL_ERROR "g++ version < 4.8")
endif()

enable_language(Fortran)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")

macro(c_compiler_flag_test flag_name flag fallback_flag)
  check_c_compiler_flag(${flag} ${flag_name})
  if(${flag_name})
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
  elseif(${fallback_flag})
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${fallback_flag}")
  endif()
endmacro(c_compiler_flag_test)

macro(cxx_compiler_flag_test flag_name flag fallback_flag)
  check_cxx_compiler_flag(${flag} ${flag_name})
  if(${flag_name})
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
  elseif(${fallback_flag})
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${fallback_flag}")
  endif()
endmacro(cxx_compiler_flag_test)

c_compiler_flag_test(C_STD_GNU99 "-std=gnu99" "")
c_compiler_flag_test(C_PEDANTIC "-pedantic" "")
c_compiler_flag_test(C_FUNROLL_LOOPS "-funroll-loops" "")
c_compiler_flag_test(C_WALL "-Wall" "")
c_compiler_flag_test(C_WEXTRA "-Wextra" "")
c_compiler_flag_test(C_OFAST "-Ofast" "-O3")
c_compiler_flag_test(C_MARCH "-march=native" "")
c_compiler_flag_test(C_CLANG_ASSEMBLER "-Wa,-q" "")

cxx_compiler_flag_test(CXX_STD_CXX11 "-std=c++11" "")
cxx_compiler_flag_test(CXX_PEDANTIC "-pedantic" "")<commit_msg>Adding support for command line additional paths.<commit_after>include(CheckCCompilerFlag)
include(CheckCXXCompilerFlag)

cmake_minimum_required(VERSION 2.6)

SET(CMAKE_C_COMPILER gcc)
SET(CMAKE_CXX_COMPILER g++)

project(HERMES)

execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GXX_VERSION)

if(GCC_VERSION VERSION_LESS 4.8)
  message(FATAL_ERROR "gcc version < 4.8")
endif()

if(GXX_VERSION VERSION_LESS 4.8)
  message(FATAL_ERROR "g++ version < 4.8")
endif()

enable_language(Fortran)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake_modules")

foreach(include_path ${ADDITIONAL_INCLUDE_PATHS})
  message(STATUS "Adding include path: ${include_path}")
  include_directories(${include_path})
endforeach(include_path ${ADDITIONAL_INCLUDE_PATHS})

foreach(library_path ${ADDITIONAL_LIBRARY_PATHS})
  message(STATUS "Adding library path: ${library_path}")
  link_directories(${library_path})
endforeach(library_path ${ADDITIONAL_LIBRARY_PATHS})

macro(c_compiler_flag_test flag_name flag fallback_flag)
  check_c_compiler_flag(${flag} ${flag_name})
  if(${flag_name})
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}")
  elseif(${fallback_flag})
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${fallback_flag}")
  endif()
endmacro(c_compiler_flag_test)

macro(cxx_compiler_flag_test flag_name flag fallback_flag)
  check_cxx_compiler_flag(${flag} ${flag_name})
  if(${flag_name})
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
  elseif(${fallback_flag})
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${fallback_flag}")
  endif()
endmacro(cxx_compiler_flag_test)

c_compiler_flag_test(C_STD_GNU99 "-std=gnu99" "")
c_compiler_flag_test(C_PEDANTIC "-pedantic" "")
c_compiler_flag_test(C_FUNROLL_LOOPS "-funroll-loops" "")
c_compiler_flag_test(C_WALL "-Wall" "")
c_compiler_flag_test(C_WEXTRA "-Wextra" "")
c_compiler_flag_test(C_OFAST "-Ofast" "-O3")
c_compiler_flag_test(C_MARCH "-march=native" "")
c_compiler_flag_test(C_CLANG_ASSEMBLER "-Wa,-q" "")

cxx_compiler_flag_test(CXX_STD_CXX11 "-std=c++11" "")
cxx_compiler_flag_test(CXX_PEDANTIC "-pedantic" "")
{'fraction_non_alphanumeric': 0.13074384361513075, 'fraction_numerical': 0.009647118558009647, 'mean_word_length': 9.368421052631579, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '2041871', 'n_tokens_mistral': 1646, 'n_tokens_neox': 1552, 'n_words': 210}