<commit_before>cmake_minimum_required(VERSION 2.8)

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

if(NOT CMAKE_LINK_TYPE)
	set(CMAKE_LINK_TYPE STATIC)
endif()

# force static compilation
if("${CMAKE_LINK_TYPE}" STREQUAL "STATIC")
	set(CMAKE_SKIP_RPATH YES)
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
endif()

# 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")<commit_msg>cmake: compile shared libs using fPIC<commit_after>cmake_minimum_required(VERSION 2.8)

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

if(NOT CMAKE_LINK_TYPE)
	set(CMAKE_LINK_TYPE STATIC)
endif()

# force static compilation
if("${CMAKE_LINK_TYPE}" STREQUAL "STATIC")
	set(CMAKE_SKIP_RPATH YES)
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -static")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static")
else()
	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()

# 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")
{'fraction_non_alphanumeric': 0.11947127605490594, 'fraction_numerical': 0.0071174377224199285, 'mean_word_length': 8.327014218009479, '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': '5165617', 'n_tokens_mistral': 852, 'n_tokens_neox': 771, 'n_words': 137}