<commit_before>macro(use_cyclus _dir _name)
  MESSAGE(STATUS "Starting construction of build files for agent: ${_dir}")

  # output directory
  SET(AGENT_PATH "/cyclus/${_dir}")
  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
    ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}${AGENT_PATH})
  
  # get preprocessor script
  IF(NOT DEFINED CYCPP)
    SET(CYCPP "${CYCLUS_CORE_INCLUDE_DIRS}/../cycpp.py")
  ENDIF(NOT DEFINED CYCPP)

  # make a build directory
  SET(BUILD_DIR ${PROJECT_BINARY_DIR}/${_dir})
  FILE(MAKE_DIRECTORY ${BUILD_DIR})

  # set CPLUS_INCLUDE_PATH to include our include paths
  GET_PROPERTY(DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)  
  SET(INCL_ARG "$ENV{CPLUS_INCLUDE_PATH}")
  FOREACH(DIR ${DIRS})
    SET(INCL_ARG "${INCL_ARG}:${DIR}")
  ENDFOREACH(DIR ${DIRS})
  SET(ENV{CPLUS_INCLUDE_PATH} ${INCL_ARG})

  # process header
  SET(HIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.h")
  SET(HOUT "-o=${BUILD_DIR}/${_name}.h")
  IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.h")
    EXECUTE_PROCESS(COMMAND ${CYCPLUS} ${HIN} ${HOUT})
    MESSAGE(STATUS "Executing ${CYCPLUS} ${HIN} ${HOUT}")
  ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.h")

  # process impl
  SET(CCIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.cc")
  SET(CCOUT "-o=${BUILD_DIR}/${_name}.cc")
  MESSAGE(STATUS "Executing ${CYCPP} ${CCIN} ${CCOUT}")
  EXECUTE_PROCESS(COMMAND ${CYCPP} ${CCIN} ${CCOUT})

  # add library
  ADD_LIBRARY(${_dir} ${BUILD_DIR}/${_name}.cc)
  TARGET_LINK_LIBRARIES(${_dir} dl cycluscore)
  SET(CYCLUS_LIBRARIES ${CYCLUS_LIBRARIES} ${_dir})

  # install library
  install(TARGETS ${_dir}
    LIBRARY DESTINATION lib${_dir}
    COMPONENT ${_dir}
    )<commit_msg>impl uses pass3 orig now, should fix before releasing into wild<commit_after>macro(use_cyclus _dir _name)
  MESSAGE(STATUS "Starting construction of build files for agent: ${_dir}")

  # output directory
  SET(AGENT_PATH "/cyclus/${_dir}")
  SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY
    ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}${AGENT_PATH})
  
  # get preprocessor script
  IF(NOT DEFINED CYCPP)
    SET(CYCPP "${CYCLUS_CORE_INCLUDE_DIRS}/../cycpp.py")
  ENDIF(NOT DEFINED CYCPP)

  # make a build directory
  SET(BUILD_DIR ${PROJECT_BINARY_DIR}/${_dir})
  FILE(MAKE_DIRECTORY ${BUILD_DIR})

  # set CPLUS_INCLUDE_PATH to include our include paths
  GET_PROPERTY(DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)  
  SET(INCL_ARG "$ENV{CPLUS_INCLUDE_PATH}")
  FOREACH(DIR ${DIRS})
    SET(INCL_ARG "${INCL_ARG}:${DIR}")
  ENDFOREACH(DIR ${DIRS})
  SET(ENV{CPLUS_INCLUDE_PATH} ${INCL_ARG})

  # process header
  SET(HIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.h")
  SET(HOUT "-o=${BUILD_DIR}/${_name}.h")
  IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.h")
    EXECUTE_PROCESS(COMMAND ${CYCPLUS} ${HIN} ${HOUT})
    MESSAGE(STATUS "Executing ${CYCPLUS} ${HIN} ${HOUT}")
  ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.h")

  # process impl
  SET(CCIN "${CMAKE_CURRENT_SOURCE_DIR}/${_name}.cc")
  SET(CCOUT "-o=${BUILD_DIR}/${_name}.cc")
  SET(ORIG "--pass3-use-orig")
  MESSAGE(STATUS "Executing ${CYCPP} ${CCIN} ${CCOUT} ${ORIG}")
  EXECUTE_PROCESS(COMMAND ${CYCPP} ${CCIN} ${CCOUT})

  # add library
  ADD_LIBRARY(${_dir} ${BUILD_DIR}/${_name}.cc)
  TARGET_LINK_LIBRARIES(${_dir} dl cycluscore)
  SET(CYCLUS_LIBRARIES ${CYCLUS_LIBRARIES} ${_dir})

  # install library
  install(TARGETS ${_dir}
    LIBRARY DESTINATION lib${_dir}
    COMPONENT ${_dir}
    )
{'fraction_non_alphanumeric': 0.1590974833670813, 'fraction_numerical': 0.0005785363031530228, 'mean_word_length': 5.599236641221374, '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': '879669', 'n_tokens_mistral': 1419, 'n_tokens_neox': 1329, 'n_words': 237}