<commit_before>#!/bin/bash

CURR_DIR=${PWD}
TMP_BUILD_DIR=${CURR_DIR}/tmp_build

OS_NAME=`uname`
SUPPORTED_OS=`echo "Darwin Linux" | grep ${OS_NAME}`

if [[ -z ${SUPPORTED_OS} ]]; then
  echo "${OS_NAME} is not supported!!!"
  exit 2
fi

HAS_WGET=`which wget`
HAS_CURL=`which curl`

if [[ -z ${HAS_WGET} && -z ${HAS_CURL} ]]; then
  echo "Please install wget or curl!!!"
  exit 2
fi

mkdir ${TMP_BUILD_DIR}

cd ${TMP_BUILD_DIR}

if [[ -n ${HAS_WGET} ]]; then
  wget http://www.kaymgee.com/Kevin_Greenan/Software_files/gf-complete.tar.gz
else
  curl -O http://www.kaymgee.com/Kevin_Greenan/Software_files/gf-complete.tar.gz
fi

tar xvf gf-complete.tar.gz

if [[ -n ${HAS_WGET} ]]; then
  wget http://www.kaymgee.com/Kevin_Greenan/Software_files/jerasure.tar.gz
else
  curl -O http://www.kaymgee.com/Kevin_Greenan/Software_files/jerasure.tar.gz
fi

tar xvf jerasure.tar.gz

cd gf-complete

./configure

make

make install

cd ../jerasure

./configure

make

make install

cd ..

#GF_COMPLETE_LIBS=${TMP_BUILD_DIR}/gf-complete/src/.libs
#GF_COMPLETE_INCL=${TMP_BUILD_DIR}/gf-complete/include
#
#if [[ ${OS_NAME} == "Linux" ]]; then
#  export LD_LIBRARY_PATH=${GF_COMPLETE_LIBS}
#else
#  export DYLD_LIBRARY_PATH=${GF_COMPLETE_LIBS}
#fi
#
#./configure LDFLAGS=-L$GFP/src/.libs/ CPPFLAGS=-I$GFP/include
<commit_msg>Make the build_jerasure script a bit more robust...<commit_after>#!/bin/bash

CURR_DIR=${PWD}
TMP_BUILD_DIR=${CURR_DIR}/tmp_build

OS_NAME=`uname`
SUPPORTED_OS=`echo "Darwin Linux" | grep ${OS_NAME}`

if [[ -z ${SUPPORTED_OS} ]]; then
  echo "${OS_NAME} is not supported!!!"
  exit 2
fi

HAS_WGET=`which wget`
HAS_CURL=`which curl`

if [[ -z ${HAS_WGET} && -z ${HAS_CURL} ]]; then
  echo "Please install wget or curl!!!"
  exit 2
fi

mkdir ${TMP_BUILD_DIR}

cd ${TMP_BUILD_DIR}

if [[ -n ${HAS_WGET} ]]; then
  wget http://www.kaymgee.com/Kevin_Greenan/Software_files/gf-complete.tar.gz
else
  curl -O http://www.kaymgee.com/Kevin_Greenan/Software_files/gf-complete.tar.gz
fi

tar xvf gf-complete.tar.gz

if [[ -n ${HAS_WGET} ]]; then
  wget http://www.kaymgee.com/Kevin_Greenan/Software_files/jerasure.tar.gz
else
  curl -O http://www.kaymgee.com/Kevin_Greenan/Software_files/jerasure.tar.gz
fi

tar xvf jerasure.tar.gz

cd gf-complete && ./configure && make && make install

if [[ $? != 0 ]]; then
  cd ..
  exit 2
fi

cd ../jerasure && ./configure && make && make install

if [[ $? != 0 ]]; then
  cd ..
  exit 2
fi

cd ..

#GF_COMPLETE_LIBS=${TMP_BUILD_DIR}/gf-complete/src/.libs
#GF_COMPLETE_INCL=${TMP_BUILD_DIR}/gf-complete/include
#
#if [[ ${OS_NAME} == "Linux" ]]; then
#  export LD_LIBRARY_PATH=${GF_COMPLETE_LIBS}
#else
#  export DYLD_LIBRARY_PATH=${GF_COMPLETE_LIBS}
#fi
#
#./configure LDFLAGS=-L$GFP/src/.libs/ CPPFLAGS=-I$GFP/include

{'fraction_non_alphanumeric': 0.16787527193618565, 'fraction_numerical': 0.0029006526468455403, 'mean_word_length': 4.275334608030593, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '493065', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1153, 'n_words': 221}