<commit_before># Tensorflow needs version 3 of protobuf, which it bundles via a submodule.
# We start by building that.  Note that we need to compile the binaries to
# run on the HOST, as they are a build dependency, not on the target.
#
# We use a recursive make, since we don't care about anything apart from the
# final executable, the libraries, and the headers.

ifneq ($(PREMAKE),1)

# Macro to build protobuf for a given arch (either host or cross)
#
# $(1) = arch to build for (either $HOSTARCH or $ARCH)
# $(2) = place to install libraries
# $(3) = place to install headers (unused)
# $(4) = place to install binaries

define build_protobuf_for_arch

# sne is string not equal, defined in gmsl
PROTOC_EXTRA_ARGS_$(1):=$(if $(call sne,$(1),$(HOSTARCH)),--with-protoc=$(PWD)/$(HOSTBIN)/protoc --host=$(1)-linux-gnu --target=$(1)-linux-gnu)$(if $(call seq,$(1),$(ARCH)), CC="$(CC)" CXX="$(CXX)")

$(4)/protoc: $(if $(call sne,$(1),$(HOSTARCH)),$(HOSTBIN)/protoc)
	@mkdir -p $(TMP)
	@echo "   $(COLOR_BLUE)[COPY EXTERN]$(COLOR_RESET)                      	protobuf3 $(1)"
	@mkdir -p $(BUILD)/$(1)/tmp/protobuf-build
	@cp -rf mldb/ext/protobuf/* $(BUILD)/$(1)/tmp/protobuf-build
	@ln -sf $(PWD)/mldb/ext/gmock $(BUILD)/$(1)/tmp/protobuf-build/
	@echo " $(COLOR_BLUE)[CONFIG EXTERN]$(COLOR_RESET)                      	protobuf3 $(1)"
	@(cd $(BUILD)/$(1)/tmp/protobuf-build \
	&& ./autogen.sh > configure-log.txt 2>&1 \
	&& TMP=$(PWD)/$(TMP) ./configure \
		--prefix $(PWD)/$(BUILD)/$(1) \
		--libdir=$(PWD)/$(2) \
		--includedir=$(PWD)/$(3) \
		--bindir=$(PWD)/$(4) \<commit_msg>remove wrong comment<commit_after># Tensorflow needs version 3 of protobuf, which it bundles via a submodule.
# We start by building that.  Note that we need to compile the binaries to
# run on the HOST, as they are a build dependency, not on the target.
#
# We use a recursive make, since we don't care about anything apart from the
# final executable, the libraries, and the headers.

ifneq ($(PREMAKE),1)

# Macro to build protobuf for a given arch (either host or cross)
#
# $(1) = arch to build for (either $HOSTARCH or $ARCH)
# $(2) = place to install libraries
# $(3) = place to install headers
# $(4) = place to install binaries

define build_protobuf_for_arch

# sne is string not equal, defined in gmsl
PROTOC_EXTRA_ARGS_$(1):=$(if $(call sne,$(1),$(HOSTARCH)),--with-protoc=$(PWD)/$(HOSTBIN)/protoc --host=$(1)-linux-gnu --target=$(1)-linux-gnu)$(if $(call seq,$(1),$(ARCH)), CC="$(CC)" CXX="$(CXX)")

$(4)/protoc: $(if $(call sne,$(1),$(HOSTARCH)),$(HOSTBIN)/protoc)
	@mkdir -p $(TMP)
	@echo "   $(COLOR_BLUE)[COPY EXTERN]$(COLOR_RESET)                      	protobuf3 $(1)"
	@mkdir -p $(BUILD)/$(1)/tmp/protobuf-build
	@cp -rf mldb/ext/protobuf/* $(BUILD)/$(1)/tmp/protobuf-build
	@ln -sf $(PWD)/mldb/ext/gmock $(BUILD)/$(1)/tmp/protobuf-build/
	@echo " $(COLOR_BLUE)[CONFIG EXTERN]$(COLOR_RESET)                      	protobuf3 $(1)"
	@(cd $(BUILD)/$(1)/tmp/protobuf-build \
	&& ./autogen.sh > configure-log.txt 2>&1 \
	&& TMP=$(PWD)/$(TMP) ./configure \
		--prefix $(PWD)/$(BUILD)/$(1) \
		--libdir=$(PWD)/$(2) \
		--includedir=$(PWD)/$(3) \
		--bindir=$(PWD)/$(4) \
{'fraction_non_alphanumeric': 0.202275600505689, 'fraction_numerical': 0.01706700379266751, 'mean_word_length': 3.780966767371601, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1303204', 'n_tokens_mistral': 1150, 'n_tokens_neox': 1103, 'n_words': 321}