<commit_before>#!/bin/bash

#####
# Function to check for error.
#####
CHECKERR () {
    ERRCODE=$?
    if [[ ! $TEST -eq 0 ]]; then
	echo "Error $ERRCODE caught. Exit."
	exit $ERRCODE
    fi
}

#####
# Function to do the building.
#####
DOBUILD () {
    BTYPE="static"
    if [ x$SHARED = "xON" ]; then
	BTYPE="shared"
    fi

    if [ $PLTFRM = "32" ]; then
	CMAKEGEN=$CMAKEGEN32
    else
	CMAKEGEN=$CMAKEGEN64
    fi


    # The packages are built 32 & 64 bit on OSX.
    NAME="$VER"
    if [ "x$NC4" = "xON" ]; then
	NAME="$NAME-NC4"
    else
	NAME="$NAME-NC3"
    fi
    
    if [ x$DAP = "xON" ]; then
	NAME="$NAME-DAP"
    fi		

    NAME="$NAME-$PLTFRM-$BTYPE"
    BDIR=$ALLBUILDS"build_$NAME"
    echo "Building $NAME"

    rm -rf $BDIR
    mkdir -p $BDIR
    cd $BDIR
    CMAKE_PREFIX_PATH=$RESOURCE_DIR cmake $CURDIR -G"$CMAKEGEN" -DCPACK_PACKAGE_FILE_NAME=NetCDF-$NAME -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=$SHARED -DENABLE_DAP=$DAP -DENABLE_NETCDF_4=$NC4
    CHECKERR

    cmake --build .
    CHECKERR

    cmake --build . --target package
    CHECKERR

    for X in zip dmg exe; do
	    TNAME="NetCDF-$NAME.$X"
	    if [ -f $TNAME ]; then<commit_msg>Updated script so that dependencies on windows are included.<commit_after>#!/bin/bash

#####
# Function to check for error.
#####
CHECKERR () {
    ERRCODE=$?
    if [[ ! $TEST -eq 0 ]]; then
	echo "Error $ERRCODE caught. Exit."
	exit $ERRCODE
    fi
}

#####
# Function to do the building.
#####
DOBUILD () {
    BTYPE="static"
    if [ x$SHARED = "xON" ]; then
	BTYPE="shared"
    fi

    if [ $PLTFRM = "32" ]; then
	CMAKEGEN=$CMAKEGEN32
    else
	CMAKEGEN=$CMAKEGEN64
    fi


    # The packages are built 32 & 64 bit on OSX.
    NAME="$VER"
    if [ "x$NC4" = "xON" ]; then
	NAME="$NAME-NC4"
    else
	NAME="$NAME-NC3"
    fi
    
    if [ x$DAP = "xON" ]; then
	NAME="$NAME-DAP"
    fi		

    NAME="$NAME-$PLTFRM-$BTYPE"
    BDIR=$ALLBUILDS"build_$NAME"
    echo "Building $NAME"

    rm -rf $BDIR
    mkdir -p $BDIR
    cd $BDIR
    cmake $CURDIR -G"$CMAKEGEN" -DCPACK_PACKAGE_FILE_NAME=NetCDF-$NAME -DENABLE_TESTS=OFF -DBUILD_SHARED_LIBS=$SHARED -DENABLE_DAP=$DAP -DENABLE_NETCDF_4=$NC4 -DCMAKE_PREFIX_PATH=$RESOURCE_DIR
    CHECKERR

    cmake --build .
    CHECKERR

    cmake --build . --target package
    CHECKERR

    for X in zip dmg exe; do
	    TNAME="NetCDF-$NAME.$X"
	    if [ -f $TNAME ]; then
{'fraction_non_alphanumeric': 0.15313420277660916, 'fraction_numerical': 0.013462347496844763, 'mean_word_length': 2.6084977238239757, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1839315', 'n_tokens_mistral': 1008, 'n_tokens_neox': 949, 'n_words': 225}