<commit_before>ifndef CHPL_MAKE_HOME
export CHPL_MAKE_HOME=$(shell pwd)/../..
endif

CHPL_MAKE_HOST_TARGET = --host
include $(CHPL_MAKE_HOME)/make/Makefile.base

#
# set up the directories
#
LLVM_ABS_DIR = $(shell pwd)
LLVM_SRC_DIR = $(LLVM_ABS_DIR)/$(LLVM_SUBDIR)
LLVM_INSTALL_DIR = $(LLVM_ABS_DIR)/$(LLVM_INSTALL_SUBDIR)
LLVM_BUILD_DIR = $(LLVM_ABS_DIR)/$(LLVM_BUILD_SUBDIR)
LLVM_DIR = $(LLVM_ABS_DIR)
BINUTILS_GOLD_DIR = $(LLVM_ABS_DIR)/binutils

# decide whether to do a debug or no-debug build
ifdef CHPL_DEVELOPER
CHPL_LLVM_DEBUG = --enable-debug-runtime --enable-debug-symbols
else
CHPL_LLVM_DEBUG = 
endif

LLVM_FILE := $(LLVM_INSTALL_DIR)/include/llvm/PassSupport.h

default: $(LLVM_FILE)

all: $(LLVM_FILE)

clean: FORCE
	rm -rf $(LLVM_BUILD_DIR)

cleanall: FORCE
	rm -rf build

clobber: FORCE
	rm -rf build install llvm

# -enable-debug-runtime --enable-debug-symbols creates huge binaries
#  so we by default do not include LLVM debugging information.
$(LLVM_FILE):
	if [ ! -d llvm ]; then ./unpack-llvm.sh; fi
	mkdir -p $(LLVM_BUILD_DIR)
	cd $(LLVM_BUILD_DIR) && $(LLVM_SRC_DIR)/configure CC='$(CC)' CXX='$(CXX)' --prefix=$(LLVM_INSTALL_DIR) --enable-optimized $(CHPL_LLVM_DEBUG)
	cd $(LLVM_BUILD_DIR) && $(MAKE)
	cd $(LLVM_BUILD_DIR) && $(MAKE) install
	cd $(LLVM_BUILD_DIR) && cd test && make lit.site.cfg

llvm: $(LLVM_FILE)

llvm-reconfig:
	cd $(LLVM_SRC_DIR) && sh autoconf/AutoRegen.sh

binutils:
	build-gold.sh

FORCE:


<commit_msg>Use available resources to parallelize llvm build.<commit_after>ifndef CHPL_MAKE_HOME
export CHPL_MAKE_HOME=$(shell pwd)/../..
endif

CHPL_MAKE_HOST_TARGET = --host
include $(CHPL_MAKE_HOME)/make/Makefile.base

#
# set up the directories
#
LLVM_ABS_DIR = $(shell pwd)
LLVM_SRC_DIR = $(LLVM_ABS_DIR)/$(LLVM_SUBDIR)
LLVM_INSTALL_DIR = $(LLVM_ABS_DIR)/$(LLVM_INSTALL_SUBDIR)
LLVM_BUILD_DIR = $(LLVM_ABS_DIR)/$(LLVM_BUILD_SUBDIR)
LLVM_DIR = $(LLVM_ABS_DIR)
BINUTILS_GOLD_DIR = $(LLVM_ABS_DIR)/binutils

# decide whether to do a debug or no-debug build
ifdef CHPL_DEVELOPER
CHPL_LLVM_DEBUG = --enable-debug-runtime --enable-debug-symbols
else
CHPL_LLVM_DEBUG = 
endif

LLVM_FILE := $(LLVM_INSTALL_DIR)/include/llvm/PassSupport.h

default: $(LLVM_FILE)

all: $(LLVM_FILE)

clean: FORCE
	rm -rf $(LLVM_BUILD_DIR)

cleanall: FORCE
	rm -rf build

clobber: FORCE
	rm -rf build install llvm

# Determine the number of available cpus on the system. Used as the -j argument
# when calling make below. This can be overridden at the command line with
# NPROCS=<int>.
NPROCS := $(shell python -c 'import multiprocessing ; print multiprocessing.cpu_count()')

# -enable-debug-runtime --enable-debug-symbols creates huge binaries
#  so we by default do not include LLVM debugging information.
$(LLVM_FILE):
	if [ ! -d llvm ]; then ./unpack-llvm.sh; fi
	mkdir -p $(LLVM_BUILD_DIR)
	cd $(LLVM_BUILD_DIR) && $(LLVM_SRC_DIR)/configure CC='$(CC)' CXX='$(CXX)' --prefix=$(LLVM_INSTALL_DIR) --enable-optimized $(CHPL_LLVM_DEBUG)
	cd $(LLVM_BUILD_DIR) && $(MAKE) -j$(NPROCS)
	cd $(LLVM_BUILD_DIR) && $(MAKE) install
	cd $(LLVM_BUILD_DIR) && cd test && make lit.site.cfg

llvm: $(LLVM_FILE)

llvm-reconfig:
	cd $(LLVM_SRC_DIR) && sh autoconf/AutoRegen.sh

binutils:
	build-gold.sh

FORCE:



{'fraction_non_alphanumeric': 0.13459745104134285, 'fraction_numerical': 0.0, 'mean_word_length': 5.09469696969697, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '4861099', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1272, 'n_words': 289}