<commit_before>project(pyGATB)

cmake_minimum_required( VERSION 3.1.0 )

# Compiler cache support with ccache
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
    set(ENABLE_CCACHE ON CACHE BOOL "Enable ccache")
    if(${ENABLE_CCACHE})
        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
        set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
    endif()
endif(CCACHE_FOUND)

FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python3.4 python3)

################################################################################
# Global compiler option
################################################################################
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--as-needed -Wl,--allow-shlib-undefined")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fvisibility-inlines-hidden")


set(ENABLE_LTO OFF CACHE BOOL "Enable Link Time Optimizations")
if(${ENABLE_LTO} AND CMAKE_BUILD_TYPE STREQUAL "Release")
message("LTO ENABLED!!!")
    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
        find_program (AR_FOUND NAMES gcc-ar)

        set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto")
        set(LIKER_FLAGS "${LIKER_FLAGS} -fuse-linker-plugin")

    elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
        find_program (AR_FOUND NAMES llvm-ar)

        if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.9)
            set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto=thin")
        else()
            set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto")
        endif()
    endif()

    set(CMAKE_C_ARCHIVE_CREATE "${AR_FOUND} qcs <TARGET> <OBJECTS>")
    set(CMAKE_C_ARCHIVE_FINISH "")
    set(CMAKE_CXX_ARCHIVE_CREATE "${AR_FOUND} qcs <TARGET> <OBJECTS>")
    set(CMAKE_CXX_ARCHIVE_FINISH "")
endif()


# Apply configuration to CMake variables
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LIKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LIKER_FLAGS}")

################################################################################
# Define cmake modules directory
################################################################################
SET (GATB_CORE_HOME  ${PROJECT_SOURCE_DIR}/thirdparty/gatb-core)
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake ${GATB_CORE_HOME}/gatb-core/cmake)


################################################################################
# SUPPORTED KMER SIZES
################################################################################

# One can uncomment this line and set the wanted valuesFunction missing ending ")".  End of file
set (KSIZE_LIST "32" CACHE STRING "Supported kmer sizes")

################################################################################
# THIRD PARTIES
################################################################################

# We don't want to install some GATB-CORE artifacts
SET (GATB_CORE_EXCLUDE_TOOLS     1)
SET (GATB_CORE_EXCLUDE_TESTS     1)
SET (GATB_CORE_EXCLUDE_EXAMPLES  1)
SET (GATB_CORE_INSTALL_EXCLUDE   1)

# GATB CORE
include (GatbCore)
foreach(TARGET_NAME gatbcore-static hdf5)
    target_compile_options(${TARGET_NAME} PRIVATE -fvisibility=hidden)
endforeach()
<commit_msg>set KSIZE_LIST to GATB-Core defaults<commit_after>project(pyGATB)

cmake_minimum_required( VERSION 3.1.0 )

# Compiler cache support with ccache
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
    set(ENABLE_CCACHE ON CACHE BOOL "Enable ccache")
    if(${ENABLE_CCACHE})
        set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
        set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
    endif()
endif(CCACHE_FOUND)

FIND_PROGRAM(PYTHON_EXECUTABLE NAMES python3.4 python3)

################################################################################
# Global compiler option
################################################################################
set(LINKER_FLAGS "${LINKER_FLAGS} -Wl,--as-needed -Wl,--allow-shlib-undefined")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fvisibility-inlines-hidden")


set(ENABLE_LTO OFF CACHE BOOL "Enable Link Time Optimizations")
if(${ENABLE_LTO} AND CMAKE_BUILD_TYPE STREQUAL "Release")
    if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
        find_program (AR_FOUND NAMES gcc-ar)

        set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto")
        set(LIKER_FLAGS "${LIKER_FLAGS} -fuse-linker-plugin")

    elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
        find_program (AR_FOUND NAMES llvm-ar)

        if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.9)
            set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto=thin")
        else()
            set(COMPILER_FLAGS "${COMPILER_FLAGS} -flto")
        endif()
    endif()

    set(CMAKE_C_ARCHIVE_CREATE "${AR_FOUND} qcs <TARGET> <OBJECTS>")
    set(CMAKE_C_ARCHIVE_FINISH "")
    set(CMAKE_CXX_ARCHIVE_CREATE "${AR_FOUND} qcs <TARGET> <OBJECTS>")
    set(CMAKE_CXX_ARCHIVE_FINISH "")
endif()


# Apply configuration to CMake variables
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${LIKER_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${LIKER_FLAGS}")

################################################################################
# Define cmake modules directory
################################################################################
SET (GATB_CORE_HOME  ${PROJECT_SOURCE_DIR}/thirdparty/gatb-core)
SET (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR}/cmake ${GATB_CORE_HOME}/gatb-core/cmake)


################################################################################
# SUPPORTED KMER SIZES
################################################################################
# Use GATB-Core defaults: 32   64   96  128
#   (as defined in gatb-core/gatb-core/src/CMakeLists.txt)
# You can uncomment the following SET line and set the wanted values. 
# You can also pass values to cmake from cmd-line using: 
#   -DKSIZE_LIST="32 64 96 128"
#set (KSIZE_LIST "32" CACHE STRING "Supported kmer sizes")

################################################################################
# THIRD PARTIES
################################################################################

# We don't want to install some GATB-CORE artifacts
SET (GATB_CORE_EXCLUDE_TOOLS     1)
SET (GATB_CORE_EXCLUDE_TESTS     1)
SET (GATB_CORE_EXCLUDE_EXAMPLES  1)
SET (GATB_CORE_INSTALL_EXCLUDE   1)

# GATB CORE
include (GatbCore)
foreach(TARGET_NAME gatbcore-static hdf5)
    target_compile_options(${TARGET_NAME} PRIVATE -fvisibility=hidden)
endforeach()

{'fraction_non_alphanumeric': 0.27489687684148495, 'fraction_numerical': 0.007071302298173247, 'mean_word_length': 6.585474860335196, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5123866', 'n_tokens_mistral': 2318, 'n_tokens_neox': 2151, 'n_words': 416}