<commit_before># search for and configure dependencies

# deprecated. TODO will rewrite to proper CMake packages



if("${TARGET_PLATFORM}" STREQUAL "w64")
#	set(MINIUPNPC_LS /usr/x86_64-w64-mingw32/lib/libminiupnpc.a)
	set(LEVELDB_LS leveldb)
	set(CRYPTOPP_LS cryptopp)
	set(CRYPTOPP_ID /usr/x86_64-w64-mingw32/include/cryptopp)
else()
	# Look for available Crypto++ version and if it is >= 5.6.2
	find_path(ID cryptlib.h
		../cryptopp/src
		../../cryptopp/src
		/usr/include/cryptopp
		/usr/include/crypto++
		/usr/local/include/cryptopp
		/usr/local/include/crypto++
		/opt/local/include/cryptopp
		/opt/local/include/crypto++
		)
	find_library(LS NAMES cryptoppeth cryptopp
		../cryptopp/src/../target/build/release
		../../cryptopp/src/../target/build/release
		PATHS
		/usr/lib
		/usr/local/lib
		/opt/local/lib
		)

	if (ID AND LS)
		message(STATUS "Found Crypto++: ${ID}, ${LS}")
		set(_CRYPTOPP_VERSION_HEADER ${ID}/config.h)
		if(EXISTS ${_CRYPTOPP_VERSION_HEADER})
			file(STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION REGEX "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$")
			string(REGEX REPLACE "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION ${_CRYPTOPP_VERSION})
			if(${_CRYPTOPP_VERSION} LESS 562)
				message(FATAL_ERROR "Crypto++ version found is smaller than 5.6.2.")
			else()
				set(CRYPTOPP_ID ${ID} CACHE FILEPATH "")
				set(CRYPTOPP_LS ${LS} CACHE FILEPATH "")
				message(STATUS "Crypto++ found and version greater or equal to 5.6.2")
			endif()
		endif()
  else()
    message(STATUS "Crypto++ Not Found: ${CRYPTOPP_ID}, ${CRYPTOPP_LS}")
	endif()

	find_path( LEVELDB_ID leveldb/db.h
		/usr/include
		/usr/local/include
		)
	if ( LEVELDB_ID STREQUAL "LEVELDB_ID-NOTFOUND" )
		message(FATAL_ERROR "Failed to find the LevelDB headers")
	else ()
		message(STATUS "Found LevelDB Headers")

		# Check for accessory dev libraries leveldb and miniupnpc
		find_library( LEVELDB_LS NAMES leveldb
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( LEVELDB_LS STREQUAL "LEVELDB_LS-NOTFOUND" )
			message(FATAL_ERROR "Failed to find the LevelDB Library!")
		else ()
			message(STATUS "Found LevelDB Library: ${LEVELDB_LS}")
			add_definitions(-DETH_LEVELDB)
		endif ()
	endif ()

	find_path( PYTHON_ID pyconfig.h
		${PYTHON_INCLUDE_DIR}
		/usr/include/python2.7
		/usr/local/include/python2.7
		)
	if ( PYTHON_ID STREQUAL "PYTHON_ID-NOTFOUND" )
		message(STATUS "Failed to find the Python-2.7 headers")
	else ()
		message(STATUS "Found Python-2.7 Headers: ${PYTHON_ID}")

		# Check for accessory dev libraries leveldb and miniupnpc
		find_library( PYTHON_LS NAMES python2.7
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( PYTHON_LS STREQUAL "PYTHON_LS-NOTFOUND" )
			message(STATUS "Failed to find the Python-2.7 Library!")
			set(PYTHON_ID)
			set(PYTHON_LS)
		else ()
			message(STATUS "Found Python-2.7 Library: ${PYTHON_LS}")
			add_definitions(-DETH_PYTHON)
		endif ()
	endif ()

	find_path( MINIUPNPC_ID miniupnpc/miniwget.h
		/usr/include
		/usr/local/include
		)
	if ( MINIUPNPC_ID ) 
		message(STATUS "Found miniupnpc headers")

		find_library( MINIUPNPC_LS NAMES miniupnpc
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( MINIUPNPC_LS )
			message(STATUS "Found miniupnpc library: ${MINIUPNPC_LS}")
			add_definitions(-DETH_MINIUPNPC)
		else ()
			message(STATUS "Failed to find the miniupnpc library!")
		endif ()
	else ()
		message(STATUS "Failed to find the miniupnpc headers!")
	endif ()

	find_path( JSONRPC_ID jsonrpc/rpc.h
		/usr/include
		/usr/local/include
		)
	if ( JSONRPC_ID )
		message(STATUS "Found jsonrpc headers")
		find_library( JSONRPC_LS NAMES jsonrpc
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( JSONRPC_LS )
			message(STATUS "Found jsonrpc library: ${JSONRPC_LS}")
		add_definitions(-DETH_JSONRPC)<commit_msg>Fix: Search for jsonrpc locally.<commit_after># search for and configure dependencies

# deprecated. TODO will rewrite to proper CMake packages



if("${TARGET_PLATFORM}" STREQUAL "w64")
#	set(MINIUPNPC_LS /usr/x86_64-w64-mingw32/lib/libminiupnpc.a)
	set(LEVELDB_LS leveldb)
	set(CRYPTOPP_LS cryptopp)
	set(CRYPTOPP_ID /usr/x86_64-w64-mingw32/include/cryptopp)
else()
	# Look for available Crypto++ version and if it is >= 5.6.2
	find_path(ID cryptlib.h
		../cryptopp/src
		../../cryptopp/src
		/usr/include/cryptopp
		/usr/include/crypto++
		/usr/local/include/cryptopp
		/usr/local/include/crypto++
		/opt/local/include/cryptopp
		/opt/local/include/crypto++
		)
	find_library(LS NAMES cryptoppeth cryptopp
		../cryptopp/src/../target/build/release
		../../cryptopp/src/../target/build/release
		PATHS
		/usr/lib
		/usr/local/lib
		/opt/local/lib
		)

	if (ID AND LS)
		message(STATUS "Found Crypto++: ${ID}, ${LS}")
		set(_CRYPTOPP_VERSION_HEADER ${ID}/config.h)
		if(EXISTS ${_CRYPTOPP_VERSION_HEADER})
			file(STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION REGEX "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$")
			string(REGEX REPLACE "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION ${_CRYPTOPP_VERSION})
			if(${_CRYPTOPP_VERSION} LESS 562)
				message(FATAL_ERROR "Crypto++ version found is smaller than 5.6.2.")
			else()
				set(CRYPTOPP_ID ${ID} CACHE FILEPATH "")
				set(CRYPTOPP_LS ${LS} CACHE FILEPATH "")
				message(STATUS "Crypto++ found and version greater or equal to 5.6.2")
			endif()
		endif()
  else()
    message(STATUS "Crypto++ Not Found: ${CRYPTOPP_ID}, ${CRYPTOPP_LS}")
	endif()

	find_path( LEVELDB_ID leveldb/db.h
		/usr/include
		/usr/local/include
		)
	if ( LEVELDB_ID STREQUAL "LEVELDB_ID-NOTFOUND" )
		message(FATAL_ERROR "Failed to find the LevelDB headers")
	else ()
		message(STATUS "Found LevelDB Headers")

		# Check for accessory dev libraries leveldb and miniupnpc
		find_library( LEVELDB_LS NAMES leveldb
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( LEVELDB_LS STREQUAL "LEVELDB_LS-NOTFOUND" )
			message(FATAL_ERROR "Failed to find the LevelDB Library!")
		else ()
			message(STATUS "Found LevelDB Library: ${LEVELDB_LS}")
			add_definitions(-DETH_LEVELDB)
		endif ()
	endif ()

	find_path( PYTHON_ID pyconfig.h
		${PYTHON_INCLUDE_DIR}
		/usr/include/python2.7
		/usr/local/include/python2.7
		)
	if ( PYTHON_ID STREQUAL "PYTHON_ID-NOTFOUND" )
		message(STATUS "Failed to find the Python-2.7 headers")
	else ()
		message(STATUS "Found Python-2.7 Headers: ${PYTHON_ID}")

		# Check for accessory dev libraries leveldb and miniupnpc
		find_library( PYTHON_LS NAMES python2.7
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( PYTHON_LS STREQUAL "PYTHON_LS-NOTFOUND" )
			message(STATUS "Failed to find the Python-2.7 Library!")
			set(PYTHON_ID)
			set(PYTHON_LS)
		else ()
			message(STATUS "Found Python-2.7 Library: ${PYTHON_LS}")
			add_definitions(-DETH_PYTHON)
		endif ()
	endif ()

	find_path( MINIUPNPC_ID miniupnpc/miniwget.h
		/usr/include
		/usr/local/include
		)
	if ( MINIUPNPC_ID ) 
		message(STATUS "Found miniupnpc headers")

		find_library( MINIUPNPC_LS NAMES miniupnpc
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			)
		if ( MINIUPNPC_LS )
			message(STATUS "Found miniupnpc library: ${MINIUPNPC_LS}")
			add_definitions(-DETH_MINIUPNPC)
		else ()
			message(STATUS "Failed to find the miniupnpc library!")
		endif ()
	else ()
		message(STATUS "Failed to find the miniupnpc headers!")
	endif ()

	find_path( JSONRPC_ID jsonrpc/rpc.h
		/usr/include
		/usr/local/include
                ../libjson-rpc-cpp/src
		)
	if ( JSONRPC_ID )
		message(STATUS "Found jsonrpc headers")
		find_library( JSONRPC_LS NAMES jsonrpc
			PATHS
			/usr/lib
			/usr/local/lib
			/opt/local/lib
			/usr/lib/*/
			../libjson-rpc-cpp/build/out
			)
		if ( JSONRPC_LS )
			message(STATUS "Found jsonrpc library: ${JSONRPC_LS}")
		add_definitions(-DETH_JSONRPC)
{'fraction_non_alphanumeric': 0.13073625819465456, 'fraction_numerical': 0.012355017650025214, 'mean_word_length': 3.5749711649365628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '233172', 'n_tokens_mistral': 3543, 'n_tokens_neox': 3083, 'n_words': 641}