| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
trilinos_src_dir=${TRILINOS_DIR:-${PWD}/../Trilinos} |
| 4 |
build_dir=${BUILD_DIR:-${PWD}} |
| 5 |
build_type=${CMAKE_BUILD_TYPE:-release} |
| 6 |
trilinos_install_dir=${TRILINOS_INSTALL_DIR:-${PWD}/../trilinos_install} |
| 7 |
|
| 8 |
yaml_install_dir=${YAML_INSTALL_DIR:-${build_dir}/../../yaml/yaml_install} |
| 9 |
|
| 10 |
enable_yaml=OFF |
| 11 |
if [ -d ${yaml_install_dir} ]; then |
| 12 |
enable_yaml=ON |
| 13 |
fi |
| 14 |
|
| 15 |
printf "\nTRILINOS_DIR=${trilinos_src_dir}\n"; |
| 16 |
printf "BUILD_DIR=${build_dir}\n"; |
| 17 |
printf "CMAKE_BUILD_TYPE=${build_type}\n"; |
| 18 |
printf "TRILINOS_INSTALL_DIR=${trilinos_install_dir}\n"; |
| 19 |
printf "YAML_INSTALL_DIR=${yaml_install_dir}\n"; |
| 20 |
printf "\nTo change these vars, set as env vars or pass to this script like 'VAR=value run_cmake_stk'\n\n"; |
| 21 |
printf "ENABLE_YAML=${enable_yaml}\n"; |
| 22 |
|
| 23 |
if [ ! -d ${trilinos_src_dir}/packages/krino ] && [ ! -L ${trilinos_src_dir}/packages/krino ]; then |
| 24 |
echo "Trilinos dir (${trilinos_src_dir}) doesn't have packages/krino directory. If using a Sierra project, make a soft-link to Sierra's krino directory."; |
| 25 |
exit 1; |
| 26 |
fi |
| 27 |
|
| 28 |
mkdir -p $trilinos_install_dir |
| 29 |
mkdir -p $build_dir |
| 30 |
|
| 31 |
cd ${build_dir} |
| 32 |
|
| 33 |
# Cleanup old cache before we configure |
| 34 |
rm -rf CMakeFiles CMakeCache.txt |
| 35 |
|
| 36 |
cmake \ |
| 37 |
-DCMAKE_INSTALL_PREFIX=$trilinos_install_dir \ |
| 38 |
-DCMAKE_BUILD_TYPE=${build_type^^} \ |
| 39 |
-DBUILD_SHARED_LIBS=OFF \ |
| 40 |
-DTPL_ENABLE_MPI:BOOL=ON \ |
| 41 |
-DTrilinos_ENABLE_Krino:BOOL=ON \ |
| 42 |
-DKrino_ENABLE_TESTS:BOOL=ON \ |
| 43 |
-DTPL_ENABLE_yamlcpp=${enable_yaml} \ |
| 44 |
-Dyamlcpp_INCLUDE_DIRS=${yaml_install_dir}/include \ |
| 45 |
-Dyamlcpp_LIBRARY_DIRS=${yaml_install_dir}/lib \ |
| 46 |
-DTPL_ENABLE_Netcdf:BOOL=ON \ |
| 47 |
-DTPL_ENABLE_HDF5:BOOL=ON \ |
| 48 |
-DTPL_HDF5_LIBRARIES="-lhdf5" \ |
| 49 |
${trilinos_src_dir}/ |
| 50 |
|