#!/bin/bash TARGET=TNL INSTALL_PREFIX=${HOME}/local WITH_CUDA=no WITH_CUSPARSE=no CUDA_ARCHITECTURE=2.0 TEMPLATE_EXPLICIT_INSTANTIATION=yes #VERBOSE="VERBOSE=1" CMAKE="cmake" CPUS=`grep -c processor /proc/cpuinfo` #CPUS="1" echo "Building $TARGET using $CPUS processors." if [ ! -d Debug ]; then mkdir Debug fi if [ ! -d Release ]; then mkdir Release fi cd Debug ${CMAKE} .. -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_INSTALL_PREFIX=${HOME}/local \ -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} \ -DWITH_CUDA=${WITH_CUDA} \ -DWITH_CUSPARSE=${WITH_CUSPARSE} \ -DPETSC_DIR=${PETSC_DIR} \ -DWITH_TEMPLATE_EXPLICIT_INSTANTIATION=${TEMPLATE_EXPLICIT_INSTANTIATION} make -j${CPUS} ${VERBOSE} make -j${CPUS} test make -j${CPUS} install cd ../Release ${CMAKE} .. -DCMAKE_INSTALL_PREFIX=${HOME}/local \ -DCUDA_ARCHITECTURE=${CUDA_ARCHITECTURE} \ -DWITH_CUDA=${WITH_CUDA} \ -DWITH_CUSPARSE=${WITH_CUSPARSE} \ -DPETSC_DIR=${PETSC_DIR} \ -DWITH_TEMPLATE_EXPLICIT_INSTANTIATION=${TEMPLATE_EXPLICIT_INSTANTIATION} make -j${CPUS} ${VERBOSE} make -j${CPUS} test make -j${CPUS} install