<commit_before>cmake_minimum_required(VERSION 2.6)

project(GLAM)

set(GLAM_VERSION_MAJOR 0)
set(GLAM_VERSION_MINOR 2)
set(GLAM_VERSION_MICRO 1)
set(GLAM_DEBUG 0)

include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns)
include(CheckIncludeFileCXX)

find_package(CxxTest)
if(CXXTEST_FOUND)
	set(HAS_CXXTEST 1)
	include_directories(${CXXTEST_INCLUDE_DIR})
endif()

if(GLAM_DEBUG)
	set(CMAKE_BUILD_TYPE Debug)
	check_cxx_compiler_flag("-O0 -g" HAS_CXX_OPTION_DEBUG_GCC)
	if (HAS_CXX_OPTION_DEBUG_GCC)
		set(GLAM_DEBUG_FLAGS "-O0 -g")
	else()
		check_cxx_compiler_flag("/Od /Zi /DEBUG" HAS_CXX_OPTION_DEBUG_VC)
		if(HAS_CXX_OPTION_DEBUG_VC)
			set(GLAM_DEBUG_FLAGS "/Od /Zi /DEBUG")
		endif()
	endif()
	if(GLAM_DEBUG_FLAGS)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLAM_DEBUG_FLAGS}")
	else()
		message(WARNING "Unknown compiler. Don't know how to set debug flags.")
	endif()
else()
	set(CMAKE_BUILD_TYPE Release)
	check_cxx_compiler_flag("-Wall -Ofast -ffast-math -ftree-vectorize -ftree-parallelize-loops=4 -g" HAS_CXX_OPTION_OPTIMIZE_GCC)
	if (HAS_CXX_OPTION_OPTIMIZE_GCC)
		set(GLAM_OPTIMIZE_FLAGS "-Wall -Ofast -ffast-math -ftree-vectorize -ftree-parallelize-loops=4 -g")
	else()
		check_cxx_compiler_flag("/O2 /Zi /DEBUG" HAS_CXX_OPTION_OPTIMIZE_VC)
		if(HAS_CXX_OPTION_OPTIMIZE_VC)
			set(GLAM_OPTIMIZE_FLAGS "/O2 /Zi /DEBUG")
		endif()
	endif()
	if(GLAM_OPTIMIZE_FLAGS)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLAM_OPTIMIZE_FLAGS}")
	else()
		message(WARNING "Unknown compiler. Don't know how to set optimize flags.")
	endif()
endif()

check_cxx_compiler_flag("-std=c++11" HAS_CXX_OPTION_CXX11_GCC47)<commit_msg>Added Qpar compiler flag if supported (VC++)<commit_after>cmake_minimum_required(VERSION 2.6)

project(GLAM)

set(GLAM_VERSION_MAJOR 0)
set(GLAM_VERSION_MINOR 2)
set(GLAM_VERSION_MICRO 1)
set(GLAM_DEBUG 0)

include(CheckCXXCompilerFlag)
include(CheckCXXSourceCompiles)
include(CheckCXXSourceRuns)
include(CheckIncludeFileCXX)

find_package(CxxTest)
if(CXXTEST_FOUND)
	set(HAS_CXXTEST 1)
	include_directories(${CXXTEST_INCLUDE_DIR})
endif()

if(GLAM_DEBUG)
	set(CMAKE_BUILD_TYPE Debug)
	check_cxx_compiler_flag("-O0 -g" HAS_CXX_OPTION_DEBUG_GCC)
	if (HAS_CXX_OPTION_DEBUG_GCC)
		set(GLAM_DEBUG_FLAGS "-O0 -g")
	else()
		check_cxx_compiler_flag("/Od /Zi /DEBUG" HAS_CXX_OPTION_DEBUG_VC)
		if(HAS_CXX_OPTION_DEBUG_VC)
			set(GLAM_DEBUG_FLAGS "/Od /Zi /DEBUG")
		endif()
	endif()
	if(GLAM_DEBUG_FLAGS)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLAM_DEBUG_FLAGS}")
	else()
		message(WARNING "Unknown compiler. Don't know how to set debug flags.")
	endif()
else()
	set(CMAKE_BUILD_TYPE Release)
	check_cxx_compiler_flag("-Wall -Ofast -ffast-math -ftree-vectorize -ftree-parallelize-loops=4 -g" HAS_CXX_OPTION_OPTIMIZE_GCC)
	if (HAS_CXX_OPTION_OPTIMIZE_GCC)
		set(GLAM_OPTIMIZE_FLAGS "-Wall -Ofast -ffast-math -ftree-vectorize -ftree-parallelize-loops=4 -g")
	else()
		check_cxx_compiler_flag("/O2 /Qpar /Zi /DEBUG" HAS_CXX_OPTION_OPTIMIZE_VC)
		if(HAS_CXX_OPTION_OPTIMIZE_VC)
			set(GLAM_OPTIMIZE_FLAGS "/O2 /Qpar /Zi /DEBUG")
		endif()
	endif()
	if(GLAM_OPTIMIZE_FLAGS)
		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GLAM_OPTIMIZE_FLAGS}")
	else()
		message(WARNING "Unknown compiler. Don't know how to set optimize flags.")
	endif()
endif()

check_cxx_compiler_flag("-std=c++11" HAS_CXX_OPTION_CXX11_GCC47)
{'fraction_non_alphanumeric': 0.11551056862161357, 'fraction_numerical': 0.011312890741292051, 'mean_word_length': 6.980997624703088, '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': '7169201', 'n_tokens_mistral': 1518, 'n_tokens_neox': 1386, 'n_words': 227}