diff --git a/build-ventus.sh b/build-ventus.sh index e9fedf34f8c2..65b4662f8b85 100755 --- a/build-ventus.sh +++ b/build-ventus.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash - +ORIG_ARGC=$# DIR=$(cd "$(dirname "${0}")" &> /dev/null && (pwd -W 2> /dev/null || pwd)) VENTUS_BUILD_DIR=${DIR}/build LIBCLC_BUILD_DIR=${DIR}/build-libclc @@ -174,9 +174,10 @@ build_pocl() { # Build libclc for pocl build_libclc() { - if [ ! -d "${LIBCLC_BUILD_DIR}" ]; then - mkdir ${LIBCLC_BUILD_DIR} + if [ -d "${LIBCLC_BUILD_DIR}" ]; then + rm -rf "${LIBCLC_BUILD_DIR}" fi + mkdir "${LIBCLC_BUILD_DIR}" cd ${LIBCLC_BUILD_DIR} cmake -G Ninja -B ${LIBCLC_BUILD_DIR} ${DIR}/libclc \ -DCMAKE_CLC_COMPILER=clang \ @@ -220,9 +221,14 @@ test_rodinia() { # TODO : More test cases of the pocl will be added test_pocl() { - cd ${POCL_BUILD_DIR}/examples - ./vecadd/vecadd - ./matadd/matadd + cd "${POCL_BUILD_DIR}/examples/vecadd" + mkdir -p test_vecadd + cd test_vecadd + ../vecadd + cd "${POCL_BUILD_DIR}/examples/matadd" + mkdir -p test_matadd + cd test_matadd + ../matadd } # Export needed path and enviroment variables @@ -270,7 +276,17 @@ check_if_ocl_icd_built() { fi } -# Process build options +#In full compilation mode +if [ "$ORIG_ARGC" -eq 0 ]; then + for dir in "${VENTUS_BUILD_DIR}" "${LIBCLC_BUILD_DIR}" "${POCL_BUILD_DIR}" "${DRIVER_BUILD_DIR}" "${SPIKE_BUILD_DIR}" "${OCL_ICD_BUILD_DIR}" "${VENTUS_INSTALL_PREFIX}"; do + if [ -d "$dir" ]; then + rm -rf "$dir" + fi + mkdir -p "$dir" + done +fi + +#In incremental compilation mode, process build options for program in "${PROGRAMS_TOBUILD[@]}" do if [ "${program}" == "llvm" ];then