<commit_before>
set(APP_GRAPH500 ../graph500)
set(APP_BFS "${APP_GRAPH500}/grappa")

set(SOURCES
  "${APP_GRAPH500}/prng.c"
  Tuple.hpp
  Tuple.cpp
  relation_io.hpp
  relation_io.cpp
  utils.h
  MatchesDHT.hpp
  Hypercube.hpp
  Hypercube.cpp
  local_graph.cpp
  local_graph.hpp
  utility.hpp
  utility.cpp
  "${APP_BFS}/oned_csr.h"
  "${APP_BFS}/oned_csr.cpp"
  "${APP_BFS}/timer.h"
  "${APP_BFS}/common.h"
  "${APP_BFS}/graph.hpp"
  "${APP_BFS}/graph.cpp"
)
set(INCLUDE_DIRS
  "${APP_GRAPH500}"
)

#TODO: encapsulate graph500/grappa sources

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
add_definitions(-Drestrict=__restrict__ -DGRAPH_GENERATOR_GRAPPA)

set(QUERIES_MAIN
  Query
)

set(QUERIES_IND 
  triangles
  triangles_partition
  twohop
  grappa_select
  grappa_select_then_join
  grappa_three_path
)

set(QUERIES_SOURCES
  squares.cpp
  squares.hpp
  squares_partition.cpp
  squares_partition.hpp
  squares_bushy.cpp
  squares_bushy.hpp
  squares_partition_bushy.cpp
  squares_partition_bushy.hpp
  Query.hpp
)

set(TEST_SOURCES
  Local_graph_tests.cpp
  Hypercube_tests.cpp
)
  
include_directories(${INCLUDE_DIRS})


foreach(query ${QUERIES_IND})
  add_grappa_application(${query}.exe ${SOURCES} ${query}.cpp)
  target_link_libraries(${query}.exe generator)
endforeach()

foreach(query ${QUERIES_MAIN})
  add_grappa_application(${query}.exe ${SOURCES} ${QUERIES_SOURCES} ${query}.cpp)
  target_link_libraries(${query}.exe generator)
endforeach()


foreach(test_cpp ${TEST_SOURCES})
  get_filename_component(test_name ${test_cpp} NAME_WE) # name without extension
  set(test "${test_name}.test")
  add_grappa_test(${test} 2 2 ${SOURCES} ${test_cpp})
  target_link_libraries(${test} generator)
endforeach()


<commit_msg>glob the generated files<commit_after>
set(APP_GRAPH500 ../graph500)
set(APP_BFS "${APP_GRAPH500}/grappa")

set(SOURCES
  "${APP_GRAPH500}/prng.c"
  Tuple.hpp
  Tuple.cpp
  relation_io.hpp
  relation_io.cpp
  utils.h
  MatchesDHT.hpp
  Hypercube.hpp
  Hypercube.cpp
  local_graph.cpp
  local_graph.hpp
  utility.hpp
  utility.cpp
  "${APP_BFS}/oned_csr.h"
  "${APP_BFS}/oned_csr.cpp"
  "${APP_BFS}/timer.h"
  "${APP_BFS}/common.h"
  "${APP_BFS}/graph.hpp"
  "${APP_BFS}/graph.cpp"
)
set(INCLUDE_DIRS
  "${APP_GRAPH500}"
)

#TODO: encapsulate graph500/grappa sources

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
add_definitions(-Drestrict=__restrict__ -DGRAPH_GENERATOR_GRAPPA)

set(QUERIES_MAIN
  Query
)

FILE(GLOB GENERATED_SOURCES "grappa_*.cpp")

set(QUERIES_IND 
  triangles.cpp
  triangles_partition.cpp
  twohop.cpp
  ${GENERATED_SOURCES}
)

set(QUERIES_SOURCES
  squares.cpp
  squares.hpp
  squares_partition.cpp
  squares_partition.hpp
  squares_bushy.cpp
  squares_bushy.hpp
  squares_partition_bushy.cpp
  squares_partition_bushy.hpp
  Query.hpp
)

set(TEST_SOURCES
  Local_graph_tests.cpp
  Hypercube_tests.cpp
)
  
include_directories(${INCLUDE_DIRS})


foreach(query ${QUERIES_IND})
  get_filename_component(query_name ${query}, NAME_WE)
  add_grappa_application(${query_name}.exe ${SOURCES} ${query})
  target_link_libraries(${query_name}.exe generator)
endforeach()

foreach(query ${QUERIES_MAIN})
  add_grappa_application(${query}.exe ${SOURCES} ${QUERIES_SOURCES} ${query}.cpp)
  target_link_libraries(${query}.exe generator)
endforeach()


foreach(test_cpp ${TEST_SOURCES})
  get_filename_component(test_name ${test_cpp} NAME_WE) # name without extension
  set(test "${test_name}.test")
  add_grappa_test(${test} 2 2 ${SOURCES} ${test_cpp})
  target_link_libraries(${test} generator)
endforeach()



{'fraction_non_alphanumeric': 0.12759394279304542, 'fraction_numerical': 0.011217049915872126, 'mean_word_length': 5.630111524163569, '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': '4716780', 'n_tokens_mistral': 1545, 'n_tokens_neox': 1429, 'n_words': 195}