#!/bin/sh

# Modules
module purge
module restore myborg
module load cuda/12.3

# Environment
source /home/bartlett/.bashrc
source /home/bartlett/anaconda3/etc/profile.d/conda.sh
conda deactivate
#conda activate borg_env
#conda activate borg
#conda activate compiler_test
conda activate borg_new

# Kill job if there are any errors
set -e

# Path variables
BORG_DIR=/home/bartlett/borg
BUILD_DIR=/data101/bartlett/build_borg/

cd $BORG_DIR
# git pull
rm -rf $BUILD_DIR
#bash build.sh --c-compiler $(which x86_64-conda_cos6-linux-gnu-gcc) --cxx-compiler $(which x86_64-conda_cos6-linux-gnu-g++) --python --hades-python --build-dir $BUILD_DIR
bash build.sh --c-compiler $(which x86_64-conda_cos6-linux-gnu-gcc) --cxx-compiler $(which x86_64-conda_cos6-linux-gnu-g++) --python=$(which python3) --install-system-python --hades-python --use-system-hdf5 --build-dir /data101/bartlett/build_borg/
cd $BUILD_DIR
make -j 14


exit 0
