<commit_before># Copyright (C) 1995-2019, <NAME> and <NAME>.
# All rights reserved.
#
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.

set(ROOT_ARCHITECTURE macosx)
set(ROOT_PLATFORM macosx)

# https://gitlab.kitware.com/cmake/cmake/issues/19222
if(CMAKE_VERSION VERSION_LESS 3.14.4)
  if(CMAKE_GENERATOR STREQUAL "Ninja")
    find_program(NINJAPROG ninja DOC "looking for Ninja to be used")
    if (NINJAPROG)
      execute_process(COMMAND ${NINJAPROG} --version
        OUTPUT_VARIABLE NINJAVERSION
        OUTPUT_STRIP_TRAILING_WHITESPACE
        RESULT_VARIABLE NINJAVERSIONRES)
      if(${NINJAVERSIONRES} EQ 0)
        if(${NINJAVERSION} VERSION_GREATER 1.8.2)
          message(FATAL_ERROR "You have hit https://gitlab.kitware.com/cmake/cmake/issues/19222\n"
            "Your build will be indeterministic, i.e. unreliable for incremental builds."
            "To fix this, please install CMake >= 3.14.4!")
        endif()
      endif()
    endif()
  endif()
endif()

if (CMAKE_SYSTEM_NAME MATCHES Darwin)
  EXECUTE_PROCESS(COMMAND sw_vers "-productVersion"
                  COMMAND cut -d . -f 1-2
                  OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)

  MESSAGE(STATUS "Found a macOS system ${MACOSX_VERSION}")

  if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
    set(libcxx ON CACHE BOOL "Build using libc++" FORCE)
  endif()

  if(MACOSX_VERSION VERSION_GREATER 10.4)
    #TODO: check haveconfig and rpath -> set rpath true
    #TODO: check Thread, define link command
    #TODO: more stuff check configure script
    if(CMAKE_SYSTEM_PROCESSOR MATCHES 64)
       if(CMAKE_SYSTEM_PROCESSOR MATCHES arm64)
          MESSAGE(STATUS "Found an AArch64 system")
          set(ROOT_ARCHITECTURE macosxarm64)
       else()
          MESSAGE(STATUS "Found an x86_64 system")
          set(ROOT_ARCHITECTURE macosx64)
       endif()

       SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
       SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -m64")
       SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -m64")
       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
       SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64")
    else()
       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
       SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32")
    endif()
  endif()

  if(MACOSX_VERSION VERSION_GREATER 10.6)
    set(MACOSX_SSL_DEPRECATED ON)
  endif()<commit_msg>Fix for Apple Silicon M1 - gfortran does not accept -m64<commit_after># Copyright (C) 1995-2019, <NAME> and <NAME>.
# All rights reserved.
#
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.

set(ROOT_ARCHITECTURE macosx)
set(ROOT_PLATFORM macosx)

# https://gitlab.kitware.com/cmake/cmake/issues/19222
if(CMAKE_VERSION VERSION_LESS 3.14.4)
  if(CMAKE_GENERATOR STREQUAL "Ninja")
    find_program(NINJAPROG ninja DOC "looking for Ninja to be used")
    if (NINJAPROG)
      execute_process(COMMAND ${NINJAPROG} --version
        OUTPUT_VARIABLE NINJAVERSION
        OUTPUT_STRIP_TRAILING_WHITESPACE
        RESULT_VARIABLE NINJAVERSIONRES)
      if(${NINJAVERSIONRES} EQ 0)
        if(${NINJAVERSION} VERSION_GREATER 1.8.2)
          message(FATAL_ERROR "You have hit https://gitlab.kitware.com/cmake/cmake/issues/19222\n"
            "Your build will be indeterministic, i.e. unreliable for incremental builds."
            "To fix this, please install CMake >= 3.14.4!")
        endif()
      endif()
    endif()
  endif()
endif()

if (CMAKE_SYSTEM_NAME MATCHES Darwin)
  EXECUTE_PROCESS(COMMAND sw_vers "-productVersion"
                  COMMAND cut -d . -f 1-2
                  OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)

  MESSAGE(STATUS "Found a macOS system ${MACOSX_VERSION}")

  if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
    set(libcxx ON CACHE BOOL "Build using libc++" FORCE)
  endif()

  if(MACOSX_VERSION VERSION_GREATER 10.4)
    #TODO: check haveconfig and rpath -> set rpath true
    #TODO: check Thread, define link command
    #TODO: more stuff check configure script
    if(CMAKE_SYSTEM_PROCESSOR MATCHES 64)
       if(CMAKE_SYSTEM_PROCESSOR MATCHES arm64)
          MESSAGE(STATUS "Found an AArch64 system")
          set(ROOT_ARCHITECTURE macosxarm64)
       else()
          MESSAGE(STATUS "Found an x86_64 system")
          set(ROOT_ARCHITECTURE macosx64)
          SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m64")
       endif()

       SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
       SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -m64")
       SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -m64")
       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
    else()
       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
       SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32")
    endif()
  endif()

  if(MACOSX_VERSION VERSION_GREATER 10.6)
    set(MACOSX_SSL_DEPRECATED ON)
  endif()
{'fraction_non_alphanumeric': 0.09553670232386573, 'fraction_numerical': 0.026742899299151603, 'mean_word_length': 3.557142857142857, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 4, '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': '2950325', 'n_tokens_mistral': 2242, 'n_tokens_neox': 1985, 'n_words': 414}