<commit_before>#!/bin/bash

if [ -f /etc/lsb-release ]; then
    . /etc/lsb-release
    OS=$DISTRIB_ID
    VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
    OS=Debian  # XXX or Ubuntu??
    VER=$(cat /etc/debian_version)
elif [ -f /etc/redhat-release ]; then
    # TODO: add code for Red Hat and CentOS here
    ...
else
    OS=$(uname -s)
    VER=$(uname -r)
fi

if [[ $OS != "Ubuntu" ]]; then
	echo 'Unsupported OS: '$OS
	exit 1
fi

# Get super user privileges
if [[ $EUID != 0 ]]; then
    sudo "$0" "$@"
    exit $?
fi

# boost installation 
if [[ -z $(ldconfig -p | grep libboost) ]]; then
	echo 'libboost not found! installing...'

	wget https://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz/download
	tar -xf download
	cd boost_1_60_0/
	./b2
	sudo ./b2 install

	cd ..
	rm -rf boost_1_60_0/
	sudo ldconfig
fi

# librabbitmq installation 
pkg-config --exists librabbitmq # exit code ($?) = 0 if successful  

if [[ $? != 0 ]]; then 
	echo 'librabbitmq not found! installing...'

	sudo apt-get install libssl-dev
	
	git clone https://github.com/alanxz/rabbitmq-c
	cd rabbitmq-c
	mkdir build
	cd build
	cmake ..

	make -j4
	sudo make install
	
	LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu<commit_msg>added cmake, boost version check<commit_after>#!/bin/bash

if [ -f /etc/lsb-release ]; then
    . /etc/lsb-release
    OS=$DISTRIB_ID
    VER=$DISTRIB_RELEASE
elif [ -f /etc/debian_version ]; then
    OS=Debian  # XXX or Ubuntu??
    VER=$(cat /etc/debian_version)
elif [ -f /etc/redhat-release ]; then
    # TODO: add code for Red Hat and CentOS here
    ...
else
    OS=$(uname -s)
    VER=$(uname -r)
fi

if [[ $OS != "Ubuntu" ]]; then
	echo 'Unsupported OS: '$OS
	exit 1
fi

# Get super user privileges
if [[ $EUID != 0 ]]; then
    sudo "$0" "$@"
    exit $?
fi

sudo apt-get install -y cmake

BOOST_VERSION=`ldconfig -p | grep -Eo 'libboost_[a-z]+.so.1.[0-9]+' | head -n 1 | cut -d . -f 4`

# boost installation 
if (("$BOOST_VERSION" < 58)); then
	echo 'libboost not found! installing...'

	wget https://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz/download
	tar -xf download
	cd boost_1_60_0/
	./b2
	sudo ./b2 install

	cd ..
	rm -rf boost_1_60_0/
	sudo ldconfig
fi

# librabbitmq installation 
pkg-config --exists librabbitmq # exit code ($?) = 0 if successful  

if [[ $? != 0 ]]; then 
	echo 'librabbitmq not found! installing...'

	sudo apt-get install libssl-dev -y
	
	git clone https://github.com/alanxz/rabbitmq-c
	cd rabbitmq-c
	mkdir build
	cd build
	cmake ..

	make -j4
	sudo make install
	
	LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu
{'fraction_non_alphanumeric': 0.14731633041492195, 'fraction_numerical': 0.02398172820708032, 'mean_word_length': 2.8421052631578947, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1616165', 'n_tokens_mistral': 1114, 'n_tokens_neox': 997, 'n_words': 278}