<commit_before>cmake_minimum_required(VERSION 2.8)

project(numbuf)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

if (UNIX AND NOT APPLE)
   link_libraries(rt)
endif()

set(ARROW_INCLUDE_DIR "" CACHE FILEPATH "Path to arrow includes")

if(NOT ARROW_INCLUDE_DIR/arrow/api.h)
  message(SEND_ERROR "Can't find arrow/api.h in ${ARROW_INCLUDE_DIR})
endif()

include_directories(SYSTEM ${ARROW_INCLUDE_DIR})

add_library(numbuf SHARED src/numbuf/tensor.cc src/numbuf/types.cc src/numbuf/metadata.cc src/numbuf/dict.cc)
target_link_libraries(numbuf arrow)

add_executable(test src/numbuf/test.cc)
target_link_libraries(test arrow)
target_link_libraries(test numbuf)

install(TARGETS numbuf
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib)

install(FILES
  src/numbuf/dict.h
  src/numbuf/tensor.h
  src/numbuf/types.h
  src/numbuf/metadata.h
  DESTINATION include/numbuf/)

install(FILES
  src/numbuf/util/buffer.h
  src/numbuf/util/logging.h
  src/numbuf/util/utils.h
  DESTINATION include/numbuf/util/)<commit_msg>add option to CMakeLists.txt to specify arrow include directory<commit_after>cmake_minimum_required(VERSION 2.8)

project(numbuf)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")

if (UNIX AND NOT APPLE)
   link_libraries(rt)
endif()

set(ARROW_INCLUDE_DIR "" CACHE FILEPATH "Path to arrow includes")

if(NOT ARROW_INCLUDE_DIR/arrow/api.h)
  message(SEND_ERROR "Can't find arrow/api.h in ${ARROW_INCLUDE_DIR}")
endif()

include_directories(SYSTEM ${ARROW_INCLUDE_DIR})

add_library(numbuf SHARED src/numbuf/tensor.cc src/numbuf/types.cc src/numbuf/metadata.cc src/numbuf/dict.cc)
target_link_libraries(numbuf arrow)

add_executable(test src/numbuf/test.cc)
target_link_libraries(test arrow)
target_link_libraries(test numbuf)

install(TARGETS numbuf
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib)

install(FILES
  src/numbuf/dict.h
  src/numbuf/tensor.h
  src/numbuf/types.h
  src/numbuf/metadata.h
  DESTINATION include/numbuf/)

install(FILES
  src/numbuf/util/buffer.h
  src/numbuf/util/logging.h
  src/numbuf/util/utils.h
  DESTINATION include/numbuf/util/)
{'fraction_non_alphanumeric': 0.10797897754419493, 'fraction_numerical': 0.003822264691829909, 'mean_word_length': 5.54375, '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': '1829650', 'n_tokens_mistral': 842, 'n_tokens_neox': 831, 'n_words': 139}