<commit_before>#!/usr/bin/env bash

usage="./$(basename "$0") [-h] [-o outdir] [-u url] [-l local] [-U url-translator] [-c CC] [-p CXX] -- install Berkeley UPC

where:
	-h	show this help message
	-o	set the output directory. Default: \$HOME/.upcc
	-u	URL to the source code of BUPC. Default: http://upc.lbl.gov/download/release/berkeley_upc-2.24.0.tar.gz
	-l	build the translator locally instead of the default HTTP-based Berkeley UPC-to-C (BUPC) translator.
	-U	URL to the source code of BUPC-translator. Default: http://upc.lbl.gov/download/release/berkeley_upc_translator-2.24.0.tar.gz
	-c	CC. Default: cc
	-p	CXX. Default: c++"

# getopts ######################################################################

gnumake() {
    if hash gmake 2>/dev/null; then
        gmake "$@"
    else
        make "$@"
    fi
}

# reset getopts
OPTIND=1

# Initialize parameters
outdir="$HOME/.upcc"
url="http://upc.lbl.gov/download/release/berkeley_upc-2.24.0.tar.gz"
urlTranslator="http://upc.lbl.gov/download/release/berkeley_upc_translator-2.24.0.tar.gz"
CC="cc"
CXX="c++"

# get the options
while getopts "o:u:lU:c:p:h" opt; do
	case "$opt" in
	o)	outdir="$OPTARG"
		;;
	u)	url="$OPTARG"
		;;
	l)	local=true
		;;
	U)	urlTranslator="$OPTARG"
		;;
	c)	CC="$OPTARG"
		;;
	p)	CXX="$OPTARG"
		;;
	h)	printf "%s\n" "$usage"
		exit 0
		;;
	*)	printf "%s\n" "$usage"
		exit 1
		;;
	esac
done

# get the filename from the url
filename="${url##*/}"
folderName="${filename%.tar.gz}"
<commit_msg>bupc-install.sh: get absolute path of outdir<commit_after>#!/usr/bin/env bash

usage="./$(basename "$0") [-h] [-o outdir] [-u url] [-l local] [-U url-translator] [-c CC] [-p CXX] -- install Berkeley UPC

where:
	-h	show this help message
	-o	set the output directory. Default: \$HOME/.upcc
	-u	URL to the source code of BUPC. Default: http://upc.lbl.gov/download/release/berkeley_upc-2.24.0.tar.gz
	-l	build the translator locally instead of the default HTTP-based Berkeley UPC-to-C (BUPC) translator.
	-U	URL to the source code of BUPC-translator. Default: http://upc.lbl.gov/download/release/berkeley_upc_translator-2.24.0.tar.gz
	-c	CC. Default: cc
	-p	CXX. Default: c++"

# getopts ######################################################################

gnumake() {
    if hash gmake 2>/dev/null; then
        gmake "$@"
    else
        make "$@"
    fi
}

# reset getopts
OPTIND=1

# Initialize parameters
outdir="$HOME/.upcc"
url="http://upc.lbl.gov/download/release/berkeley_upc-2.24.0.tar.gz"
urlTranslator="http://upc.lbl.gov/download/release/berkeley_upc_translator-2.24.0.tar.gz"
CC="cc"
CXX="c++"

# get the options
while getopts "o:u:lU:c:p:h" opt; do
	case "$opt" in
	o)	outdir="$OPTARG"
		;;
	u)	url="$OPTARG"
		;;
	l)	local=true
		;;
	U)	urlTranslator="$OPTARG"
		;;
	c)	CC="$OPTARG"
		;;
	p)	CXX="$OPTARG"
		;;
	h)	printf "%s\n" "$usage"
		exit 0
		;;
	*)	printf "%s\n" "$usage"
		exit 1
		;;
	esac
done

# get the absolute path of outdir
outdir=$(realpath outdir)

# get the filename from the url
filename="${url##*/}"
folderName="${filename%.tar.gz}"

{'fraction_non_alphanumeric': 0.21770491803278688, 'fraction_numerical': 0.01377049180327869, 'mean_word_length': 3.567365269461078, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '864466', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1202, 'n_words': 293}