<commit_before>cmake_minimum_required(VERSION 2.8)

# project config
project(libaroma)
set(CMAKE_BUILD_TYPE Release)

# force static compilation
set(CMAKE_SKIP_RPATH YES)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")

# get architecture
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpmachine COMMAND cut -d- -f1 COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE )

# TMP
set(LIBAROMA_CONFIG_DEBUG "3")
set(LIBAROMA_CONFIG_DEBUG_FILE "0")
set(LIBAROMA_CONFIG_DEBUG_MEMORY "0")
set(LIBAROMA_CONFIG_COMPILER_MESSAGE "1")
set(LIBAROMA_CONFIG_SHMEMFB "0")

# common cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -save-temps")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_DEBUG")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -fPIC -DPIC -Wl,-s -Wall -Wextra -Wshadow -Wno-unused-parameter")
#set(AROMA_CFLAGS "${AROMA_CFLAGS} -Werror")

# forced aroma cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG_TRACE=0")

# openmp cflags
#set(AROMA_CFLAGS "${AROMA_CFLAGS} -fopenmp -DLIBAROMA_CONFIG_OPENMP=1")

# release cflags
if (CMAKE_BUILD_TYPE EQUAL "RELEASE")
	set(AROMA_CFLAGS "${AROMA_CFLAGS} -O3 -ftree-vectorize -fprefetch-loop-arrays -funsafe-math-optimizations")
endif()

# debug cflags
if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
	set(AROMA_CFLAGS "${AROMA_CFLAGS} -ggdb")
endif()

# AROMA cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG=${LIBAROMA_CONFIG_DEBUG}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG_FILE=${LIBAROMA_CONFIG_DEBUG_FILE}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG_MEMORY=${LIBAROMA_CONFIG_DEBUG_MEMORY}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_COMPILER_MESSAGE=${LIBAROMA_CONFIG_COMPILER_MESSAGE}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_SHMEMFB=${LIBAROMA_CONFIG_SHMEMFB}")

# android cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DANDROID=1 -D__ANDROID__")

# ARM cflags
if("${ARCHITECTURE}" STREQUAL "arm")
	# NEON
	set(AROMA_CFLAGS "${AROMA_CFLAGS} -mvectorize-with-neon-quad -mfloat-abi=hard -mfpu=neon -D__ARM_HAVE_NEON")
endif()<commit_msg>cmake: set release&debug flags globally<commit_after>cmake_minimum_required(VERSION 2.8)

# project config
project(libaroma)
set(CMAKE_BUILD_TYPE Release)

# force static compilation
set(CMAKE_SKIP_RPATH YES)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")

# release&debug flags
set(CMAKE_C_FLAGS_RELEASE "-O3 -ftree-vectorize -fprefetch-loop-arrays -funsafe-math-optimizations")
set(CMAKE_C_FLAGS_DEBUG "-ggdb")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")

# get architecture
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpmachine COMMAND cut -d- -f1 COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE )

# TMP
set(LIBAROMA_CONFIG_DEBUG "3")
set(LIBAROMA_CONFIG_DEBUG_FILE "0")
set(LIBAROMA_CONFIG_DEBUG_MEMORY "0")
set(LIBAROMA_CONFIG_COMPILER_MESSAGE "1")
set(LIBAROMA_CONFIG_SHMEMFB "0")

# common cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -save-temps")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -fdata-sections -ffunction-sections -Wl,--gc-sections")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCXX_DEBUG")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -fPIC -DPIC -Wl,-s -Wall -Wextra -Wshadow -Wno-unused-parameter")
#set(AROMA_CFLAGS "${AROMA_CFLAGS} -Werror")

# forced aroma cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG_TRACE=0")

# openmp cflags
#set(AROMA_CFLAGS "${AROMA_CFLAGS} -fopenmp -DLIBAROMA_CONFIG_OPENMP=1")

# AROMA cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG=${LIBAROMA_CONFIG_DEBUG}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG_FILE=${LIBAROMA_CONFIG_DEBUG_FILE}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_DEBUG_MEMORY=${LIBAROMA_CONFIG_DEBUG_MEMORY}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_COMPILER_MESSAGE=${LIBAROMA_CONFIG_COMPILER_MESSAGE}")
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DLIBAROMA_CONFIG_SHMEMFB=${LIBAROMA_CONFIG_SHMEMFB}")

# android cflags
set(AROMA_CFLAGS "${AROMA_CFLAGS} -DANDROID=1 -D__ANDROID__")

# ARM cflags
if("${ARCHITECTURE}" STREQUAL "arm")
	# NEON
	set(AROMA_CFLAGS "${AROMA_CFLAGS} -mvectorize-with-neon-quad -mfloat-abi=hard -mfpu=neon -D__ARM_HAVE_NEON")
endif()
{'fraction_non_alphanumeric': 0.1305826343232827, 'fraction_numerical': 0.005440943096803446, 'mean_word_length': 8.739514348785871, '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': '4495505', 'n_tokens_mistral': 1940, 'n_tokens_neox': 1793, 'n_words': 277}