Commit 6fd71d1e authored by cianciosa's avatar cianciosa
Browse files

Add setup script to configure library.

parent ad90707e
Loading
Loading
Loading
Loading

setup_cmake

0 → 100755
+59 −0
Original line number Diff line number Diff line
#!/bin/bash
#
#  setup_cmake Choses the correct cmake build command for a machine.
#
#-------------------------------------------------------------------------------

MACHINE_ID=`uname -n`

echo Building ml_model_embber for machin $MACHINE_ID
echo

#  Create a build directory if it doesn't already exist.
mkdir -p build
cd build

#  Setup perlmutter login nodes.
if [ $MACHINE_ID == "login1" ]  || \
   [ $MACHINE_ID == "login2" ]  || \
   [ $MACHINE_ID == "login3" ]  || \
   [ $MACHINE_ID == "login4" ]  || \
   [ $MACHINE_ID == "login5" ]  || \
   [ $MACHINE_ID == "login6" ]  || \
   [ $MACHINE_ID == "login7" ]  || \
   [ $MACHINE_ID == "login8" ]  || \
   [ $MACHINE_ID == "login9" ]  || \
   [ $MACHINE_ID == "login10" ] || \
   [ $MACHINE_ID == "login11" ] || \
   [ $MACHINE_ID == "login12" ] || \
   [ $MACHINE_ID == "login13" ] || \
   [ $MACHINE_ID == "login14" ] || \
   [ $MACHINE_ID == "login15" ] || \
   [ $MACHINE_ID == "login16" ] || \
   [ $MACHINE_ID == "login17" ] || \
   [ $MACHINE_ID == "login18" ] || \
   [ $MACHINE_ID == "login19" ] || \
   [ $MACHINE_ID == "login20" ] || \
   [ $MACHINE_ID == "login21" ] || \
   [ $MACHINE_ID == "login22" ] || \
   [ $MACHINE_ID == "login23" ]
then
    module load cmake
    module load cray-hdf5
    cmake -DCMAKE_C_COMPILER=gcc            \
          -DCMAKE_CXX_COMPILER=g++          \
          -DCMAKE_Fortran_COMPILER=gfortran \
          -DBUILD_C_BINDING=ON              \
          -DBUILD_Fortran_BINDING=ON        \
          -DMLX_BUILD_BLAS_FROM_SOURCE=ON   \
          -DBUILD_SHARED_LIBS=ON
else
#  MACHINE_ID is new and known. Inform the user how to add support for this new
#  machine.
    echo $MACHINE_ID is not supportted by this script.
    echo To add support for this machine, ad a new elif statement of the form
    echo
    echo elif [ \$MACHINE_ID == \"$MACHINE_ID\" ]
    echo then
    echo "   " cmake -DVARIABLE=value ... ../
fi