<commit_before>cmake_minimum_required(VERSION 2.8)
project(fgm-cpp)

if(CMAKE_COMPILER_IS_GNUCC)
  add_definitions("-fPIC -std=c++11")
endif()

if(WIN32 AND NOT CYGWIN)
  set(Boost_USE_STATIC_LIBS On)
  add_definitions(-DBOOST_PYTHON_STATIC_LIB)
endif()

find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Boost REQUIRED COMPONENTS python)

execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy;print numpy.get_include()"
  OUTPUT_VARIABLE NUMPY_INCLUDE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/bindings/python)
include_directories($ENV{EIGEN_ROOT} /usr/include/eigen3)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR})

list(FIND PYTHON_LIBRARIES optimized PYTHON_OPTIMIZED_INDEX)
if (NOT ${PYTHON_OPTIMIZED_INDEX} EQUAL -1)
  math(EXPR PYTHON_OPTIMIZED_INDEX "${PYTHON_OPTIMIZED_INDEX}+1")
  list(GET PYTHON_LIBRARIES ${PYTHON_OPTIMIZED_INDEX} PYTHON_RELEASE_LIBRARY)<commit_msg>Check if all dependencies are available<commit_after>cmake_minimum_required(VERSION 2.8)
project(fgm-cpp)

if(CMAKE_COMPILER_IS_GNUCC)
  add_definitions("-fPIC -std=c++11")
endif()

if(WIN32 AND NOT CYGWIN)
  set(Boost_USE_STATIC_LIBS On)
  add_definitions(-DBOOST_PYTHON_STATIC_LIB)
endif()

find_package(PythonInterp REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Boost REQUIRED COMPONENTS python)

execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "try: import numpy; print numpy.get_include()\nexcept: pass\n"
  OUTPUT_VARIABLE NUMPY_INCLUDE_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
if (NOT EXISTS ${NUMPY_INCLUDE_DIR})
  message(FATAL_ERROR "Please make sure you have NumPy installed.")
endif()

set(EIGEN_ROOT "$ENV{EIGEN_ROOT}")
if(NOT EIGEN_ROOT)
  set(EIGEN_ROOT /usr/include/eigen3)
endif()
if (NOT EXISTS ${EIGEN_ROOT})
  message(FATAL_ERROR "Please point EIGEN_ROOT to your Eigen3 directory.")
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/bindings/python)
include_directories($ENV{EIGEN_ROOT} /usr/include/eigen3)
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${PYTHON_INCLUDE_DIRS} ${NUMPY_INCLUDE_DIR})

list(FIND PYTHON_LIBRARIES optimized PYTHON_OPTIMIZED_INDEX)
if (NOT ${PYTHON_OPTIMIZED_INDEX} EQUAL -1)
  math(EXPR PYTHON_OPTIMIZED_INDEX "${PYTHON_OPTIMIZED_INDEX}+1")
  list(GET PYTHON_LIBRARIES ${PYTHON_OPTIMIZED_INDEX} PYTHON_RELEASE_LIBRARY)
{'fraction_non_alphanumeric': 0.09915356711003627, 'fraction_numerical': 0.008061265618702136, 'mean_word_length': 9.982300884955752, 'pattern_counts': {'":': 0, '<': 3, '<?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': '452632', 'n_tokens_mistral': 1065, 'n_tokens_neox': 972, 'n_words': 150}