Updating kokkos lib
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@14918 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -1,190 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
# Additional command-line arguments given to this script will be
|
||||
# passed directly to CMake.
|
||||
#
|
||||
|
||||
#
|
||||
# Force CMake to re-evaluate build options.
|
||||
#
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location of Trilinos source tree:
|
||||
|
||||
CMAKE_PROJECT_DIR="${HOME}/Trilinos"
|
||||
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/projects/kokkos/host/`date +%F`"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE=OFF
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
# CMAKE_BUILD_TYPE=DEBUG
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build for CUDA architecture:
|
||||
|
||||
CUDA_ARCH=""
|
||||
# CUDA_ARCH="20"
|
||||
# CUDA_ARCH="30"
|
||||
# CUDA_ARCH="35"
|
||||
|
||||
# Build with Intel compiler
|
||||
|
||||
INTEL=ON
|
||||
|
||||
# Build for MIC architecture:
|
||||
|
||||
# INTEL_XEON_PHI=ON
|
||||
|
||||
# Build with HWLOC at location:
|
||||
|
||||
HWLOC_BASE_DIR="/home/projects/libraries/host/hwloc/1.6.2"
|
||||
|
||||
# Location for MPI to use in examples:
|
||||
|
||||
MPI_BASE_DIR=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MPI configuation only used for examples:
|
||||
#
|
||||
# Must have the MPI_BASE_DIR so that the
|
||||
# include path can be passed to the Cuda compiler
|
||||
|
||||
if [ -n "${MPI_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread configuation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP configuation:
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure packages for kokkos-only:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality cmake configuration:
|
||||
|
||||
if [ -n "${HWLOC_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda cmake configuration:
|
||||
|
||||
if [ -n "${CUDA_ARCH}" ] ;
|
||||
then
|
||||
|
||||
# Options to CUDA_NVCC_FLAGS must be semi-colon delimited,
|
||||
# this is different than the standard CMAKE_CXX_FLAGS syntax.
|
||||
|
||||
CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}"
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi"
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3"
|
||||
fi
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Cross-compile for Intel Xeon Phi:
|
||||
|
||||
if [ "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread"
|
||||
|
||||
# Cannot cross-compile fortran compatibility checks on the MIC:
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
|
||||
# Tell cmake the answers to compile-and-execute tests
|
||||
# to prevent cmake from executing a cross-compiled program.
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,186 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
# Additional command-line arguments given to this script will be
|
||||
# passed directly to CMake.
|
||||
#
|
||||
|
||||
#
|
||||
# Force CMake to re-evaluate build options.
|
||||
#
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location of Trilinos source tree:
|
||||
|
||||
CMAKE_PROJECT_DIR="${HOME}/Trilinos"
|
||||
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/projects/kokkos/mic/`date +%F`"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE=OFF
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
# CMAKE_BUILD_TYPE=DEBUG
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build for CUDA architecture:
|
||||
|
||||
CUDA_ARCH=""
|
||||
# CUDA_ARCH="20"
|
||||
# CUDA_ARCH="30"
|
||||
# CUDA_ARCH="35"
|
||||
|
||||
# Build for MIC architecture:
|
||||
|
||||
INTEL_XEON_PHI=ON
|
||||
|
||||
# Build with HWLOC at location:
|
||||
|
||||
HWLOC_BASE_DIR="/home/projects/libraries/mic/hwloc/1.6.2"
|
||||
|
||||
# Location for MPI to use in examples:
|
||||
|
||||
MPI_BASE_DIR=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MPI configuation only used for examples:
|
||||
#
|
||||
# Must have the MPI_BASE_DIR so that the
|
||||
# include path can be passed to the Cuda compiler
|
||||
|
||||
if [ -n "${MPI_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread configuation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP configuation:
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure packages for kokkos-only:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality cmake configuration:
|
||||
|
||||
if [ -n "${HWLOC_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda cmake configuration:
|
||||
|
||||
if [ -n "${CUDA_ARCH}" ] ;
|
||||
then
|
||||
|
||||
# Options to CUDA_NVCC_FLAGS must be semi-colon delimited,
|
||||
# this is different than the standard CMAKE_CXX_FLAGS syntax.
|
||||
|
||||
CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}"
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi"
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3"
|
||||
fi
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Cross-compile for Intel Xeon Phi:
|
||||
|
||||
if [ "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread"
|
||||
|
||||
# Cannot cross-compile fortran compatibility checks on the MIC:
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
|
||||
# Tell cmake the answers to compile-and-execute tests
|
||||
# to prevent cmake from executing a cross-compiled program.
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,293 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
# CMAKE_BUILD_TYPE=DEBUG
|
||||
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
USE_CUDA_ARCH=
|
||||
USE_THREAD=
|
||||
USE_OPENMP=
|
||||
USE_INTEL=
|
||||
USE_XEON_PHI=
|
||||
HWLOC_BASE_DIR=
|
||||
MPI_BASE_DIR=
|
||||
BLAS_LIB_DIR=
|
||||
LAPACK_LIB_DIR=
|
||||
|
||||
if [ 1 ] ; then
|
||||
# Platform 'kokkos-dev' with Cuda, OpenMP, hwloc, mpi, gnu
|
||||
USE_CUDA_ARCH="35"
|
||||
USE_OPENMP=ON
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.4.7"
|
||||
MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.4.7"
|
||||
BLAS_LIB_DIR="/home/projects/blas/host/gnu/lib"
|
||||
LAPACK_LIB_DIR="/home/projects/lapack/host/gnu/lib"
|
||||
|
||||
elif [ ] ; then
|
||||
# Platform 'kokkos-dev' with Cuda, Threads, hwloc, mpi, gnu
|
||||
USE_CUDA_ARCH="35"
|
||||
USE_THREAD=ON
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.4.7"
|
||||
MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.4.7"
|
||||
BLAS_LIB_DIR="/home/projects/blas/host/gnu/lib"
|
||||
LAPACK_LIB_DIR="/home/projects/lapack/host/gnu/lib"
|
||||
|
||||
elif [ ] ; then
|
||||
# Platform 'kokkos-dev' with Xeon Phi and hwloc
|
||||
USE_OPENMP=ON
|
||||
USE_INTEL=ON
|
||||
USE_XEON_PHI=ON
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/mic/intel/13.SP1.1.106"
|
||||
|
||||
elif [ ] ; then
|
||||
# Platform 'kokkos-nvidia' with Cuda, OpenMP, hwloc, mpi, gnu
|
||||
USE_CUDA_ARCH="20"
|
||||
USE_OPENMP=ON
|
||||
HWLOC_BASE_DIR="/home/sems/common/hwloc/current"
|
||||
MPI_BASE_DIR="/home/sems/common/openmpi/current"
|
||||
|
||||
elif [ ] ; then
|
||||
# Platform 'kokkos-nvidia' with Cuda, Threads, hwloc, mpi, gnu
|
||||
USE_CUDA_ARCH="20"
|
||||
USE_THREAD=ON
|
||||
HWLOC_BASE_DIR="/home/sems/common/hwloc/current"
|
||||
MPI_BASE_DIR="/home/sems/common/openmpi/current"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure command line options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CXX_FLAGS=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ 1 ] ; then
|
||||
|
||||
# Configure for Tpetra/Kokkos:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${BLAS_LIB_DIR}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_DIRS:FILEPATH=${LAPACK_LIB_DIR}"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Tpetra:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Kokkos:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraClassic:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TeuchosKokkosCompat:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TeuchosKokkosComm:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Tpetra_ENABLE_Kokkos_Refactor:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D KokkosClassic_DefaultNode:STRING=Kokkos::Compat::KokkosOpenMPWrapperNode"
|
||||
|
||||
CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}-DKOKKOS_FAST_COMPILE"
|
||||
|
||||
if [ -n "${USE_CUDA_ARCH}" ] ; then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Cuda:BOOL=ON"
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if [ 1 ] ; then
|
||||
|
||||
# Configure for Stokhos:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Sacado:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Stokhos:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Stokhos_ENABLE_Belos:BOOL=ON"
|
||||
|
||||
fi
|
||||
|
||||
if [ 1 ] ; then
|
||||
|
||||
# Configure for TrilinosCouplings:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TrilinosCouplings:BOOL=ON"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=ON"
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" == "DEBUG" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MPI configuation only used for examples:
|
||||
#
|
||||
# Must have the MPI_BASE_DIR so that the
|
||||
# include path can be passed to the Cuda compiler
|
||||
|
||||
if [ -n "${MPI_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Kokkos use pthread configuation:
|
||||
|
||||
if [ "${USE_THREAD}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=ON"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Kokkos use OpenMP configuation:
|
||||
|
||||
if [ "${USE_OPENMP}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality configuration:
|
||||
|
||||
if [ -n "${HWLOC_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda cmake configuration:
|
||||
|
||||
if [ -n "${USE_CUDA_ARCH}" ] ;
|
||||
then
|
||||
|
||||
# Options to CUDA_NVCC_FLAGS must be semi-colon delimited,
|
||||
# this is different than the standard CMAKE_CXX_FLAGS syntax.
|
||||
|
||||
CUDA_NVCC_FLAGS="-DKOKKOS_HAVE_CUDA_ARCH=${USE_CUDA_ARCH}0;-gencode;arch=compute_${USE_CUDA_ARCH},code=sm_${USE_CUDA_ARCH}"
|
||||
|
||||
if [ "${USE_OPENMP}" = "ON" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi"
|
||||
fi
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3"
|
||||
fi
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ "${USE_INTEL}" = "ON" -o "${USE_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
fi
|
||||
|
||||
# Cross-compile for Intel Xeon Phi:
|
||||
|
||||
if [ "${USE_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
|
||||
CMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS} -mmic"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread"
|
||||
|
||||
# Cannot cross-compile fortran compatibility checks on the MIC:
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
|
||||
# Tell cmake the answers to compile-and-execute tests
|
||||
# to prevent cmake from executing a cross-compiled program.
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ -n "${CMAKE_CXX_FLAGS}" ] ; then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING='${CMAKE_CXX_FLAGS}'"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
# Additional command-line arguments given to this script will be
|
||||
# passed directly to CMake.
|
||||
#
|
||||
|
||||
# to build:
|
||||
# build on bgq-b[1-12]
|
||||
# module load sierra-devel
|
||||
# run this configure file
|
||||
# make
|
||||
|
||||
# to run:
|
||||
# ssh bgq-login
|
||||
# cd /scratch/username/...
|
||||
# export OMP_PROC_BIND and XLSMPOPTS environment variables
|
||||
# run with srun
|
||||
|
||||
# Note: hwloc does not work to get or set cpubindings on bgq.
|
||||
# Use the openmp backend and the openmp environment variables.
|
||||
#
|
||||
# Only the mpi wrappers seem to be setup for cross-compile,
|
||||
# so it is important that this configure enables MPI and uses mpigcc wrappers.
|
||||
|
||||
|
||||
|
||||
#
|
||||
# Force CMake to re-evaluate build options.
|
||||
#
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location of Trilinos source tree:
|
||||
|
||||
CMAKE_PROJECT_DIR="../Trilinos"
|
||||
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=../TrilinosInstall/`date +%F`"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=mpigcc-4.7.2"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=mpig++-4.7.2"
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE=OFF
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
# CMAKE_BUILD_TYPE=DEBUG
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure packages for kokkos-only:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,216 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
# Additional command-line arguments given to this script will be
|
||||
# passed directly to CMake.
|
||||
#
|
||||
|
||||
#
|
||||
# Force CMake to re-evaluate build options.
|
||||
#
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location of Trilinos source tree:
|
||||
|
||||
CMAKE_PROJECT_DIR="${HOME}/Trilinos"
|
||||
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${HOME}/TrilinosInstall/`date +%F`"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE=OFF
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
#CMAKE_BUILD_TYPE=DEBUG
|
||||
#CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build for CUDA architecture:
|
||||
|
||||
#CUDA_ARCH=""
|
||||
#CUDA_ARCH="20"
|
||||
#CUDA_ARCH="30"
|
||||
CUDA_ARCH="35"
|
||||
|
||||
# Build with OpenMP
|
||||
|
||||
OPENMP=ON
|
||||
PTHREADS=ON
|
||||
|
||||
# Build host code with Intel compiler:
|
||||
|
||||
INTEL=OFF
|
||||
|
||||
# Build for MIC architecture:
|
||||
|
||||
INTEL_XEON_PHI=OFF
|
||||
|
||||
# Build with HWLOC at location:
|
||||
|
||||
#HWLOC_BASE_DIR=""
|
||||
#HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.4.7"
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3"
|
||||
|
||||
# Location for MPI to use in examples:
|
||||
|
||||
#MPI_BASE_DIR=""
|
||||
#MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.4.7"
|
||||
MPI_BASE_DIR="/home/projects/mvapich/2.0.0b/gnu/4.7.3"
|
||||
#MPI_BASE_DIR="/home/projects/openmpi/1.7.3/llvm/2013-12-02/"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MPI configuation only used for examples:
|
||||
#
|
||||
# Must have the MPI_BASE_DIR so that the
|
||||
# include path can be passed to the Cuda compiler
|
||||
|
||||
if [ -n "${MPI_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread configuation:
|
||||
|
||||
if [ "${PTHREADS}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP configuation:
|
||||
|
||||
if [ "${OPENMP}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure packages for kokkos-only:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality cmake configuration:
|
||||
|
||||
if [ -n "${HWLOC_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda cmake configuration:
|
||||
|
||||
if [ -n "${CUDA_ARCH}" ] ;
|
||||
then
|
||||
|
||||
# Options to CUDA_NVCC_FLAGS must be semi-colon delimited,
|
||||
# this is different than the standard CMAKE_CXX_FLAGS syntax.
|
||||
|
||||
CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}"
|
||||
|
||||
if [ "${OPENMP}" = "ON" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi"
|
||||
fi
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3"
|
||||
fi
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Cross-compile for Intel Xeon Phi:
|
||||
|
||||
if [ "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread"
|
||||
|
||||
# Cannot cross-compile fortran compatibility checks on the MIC:
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
|
||||
# Tell cmake the answers to compile-and-execute tests
|
||||
# to prevent cmake from executing a cross-compiled program.
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,204 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
# Additional command-line arguments given to this script will be
|
||||
# passed directly to CMake.
|
||||
#
|
||||
|
||||
#
|
||||
# Force CMake to re-evaluate build options.
|
||||
#
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location of Trilinos source tree:
|
||||
|
||||
CMAKE_PROJECT_DIR="${HOME}/Trilinos"
|
||||
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/sems/common/kokkos/`date +%F`"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE=OFF
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
# CMAKE_BUILD_TYPE=DEBUG
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build for CUDA architecture:
|
||||
|
||||
# CUDA_ARCH=""
|
||||
CUDA_ARCH="20"
|
||||
# CUDA_ARCH="30"
|
||||
# CUDA_ARCH="35"
|
||||
|
||||
# Build with OpenMP
|
||||
|
||||
OPENMP=ON
|
||||
|
||||
# Build host code with Intel compiler:
|
||||
|
||||
# INTEL=ON
|
||||
|
||||
# Build for MIC architecture:
|
||||
|
||||
# INTEL_XEON_PHI=ON
|
||||
|
||||
# Build with HWLOC at location:
|
||||
|
||||
HWLOC_BASE_DIR="/home/sems/common/hwloc/current"
|
||||
|
||||
# Location for MPI to use in examples:
|
||||
|
||||
MPI_BASE_DIR="/home/sems/common/openmpi/current"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MPI configuation only used for examples:
|
||||
#
|
||||
# Must have the MPI_BASE_DIR so that the
|
||||
# include path can be passed to the Cuda compiler
|
||||
|
||||
if [ -n "${MPI_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread configuation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP configuation:
|
||||
|
||||
if [ "${OPENMP}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure packages for kokkos-only:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality cmake configuration:
|
||||
|
||||
if [ -n "${HWLOC_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda cmake configuration:
|
||||
|
||||
if [ -n "${CUDA_ARCH}" ] ;
|
||||
then
|
||||
|
||||
# Options to CUDA_NVCC_FLAGS must be semi-colon delimited,
|
||||
# this is different than the standard CMAKE_CXX_FLAGS syntax.
|
||||
|
||||
CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}"
|
||||
|
||||
if [ "${OPENMP}" = "ON" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi"
|
||||
fi
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3"
|
||||
fi
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Cross-compile for Intel Xeon Phi:
|
||||
|
||||
if [ "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread"
|
||||
|
||||
# Cannot cross-compile fortran compatibility checks on the MIC:
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
|
||||
# Tell cmake the answers to compile-and-execute tests
|
||||
# to prevent cmake from executing a cross-compiled program.
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,190 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
# Additional command-line arguments given to this script will be
|
||||
# passed directly to CMake.
|
||||
#
|
||||
|
||||
#
|
||||
# Force CMake to re-evaluate build options.
|
||||
#
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Incrementally construct cmake configure options:
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Location of Trilinos source tree:
|
||||
|
||||
CMAKE_PROJECT_DIR="${HOME}/Trilinos"
|
||||
|
||||
# Location for installation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=/home/projects/kokkos/`date +%F`"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# General build options.
|
||||
# Use a variable so options can be propagated to CUDA compiler.
|
||||
|
||||
CMAKE_VERBOSE_MAKEFILE=OFF
|
||||
CMAKE_BUILD_TYPE=RELEASE
|
||||
# CMAKE_BUILD_TYPE=DEBUG
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Build for CUDA architecture:
|
||||
|
||||
# CUDA_ARCH=""
|
||||
# CUDA_ARCH="20"
|
||||
# CUDA_ARCH="30"
|
||||
CUDA_ARCH="35"
|
||||
|
||||
# Build host code with Intel compiler:
|
||||
|
||||
INTEL=ON
|
||||
|
||||
# Build for MIC architecture:
|
||||
|
||||
# INTEL_XEON_PHI=ON
|
||||
|
||||
# Build with HWLOC at location:
|
||||
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.6.2"
|
||||
|
||||
# Location for MPI to use in examples:
|
||||
|
||||
MPI_BASE_DIR=""
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# MPI configuation only used for examples:
|
||||
#
|
||||
# Must have the MPI_BASE_DIR so that the
|
||||
# include path can be passed to the Cuda compiler
|
||||
|
||||
if [ -n "${MPI_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D MPI_BASE_DIR:PATH=${MPI_BASE_DIR}"
|
||||
else
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_MPI:BOOL=OFF"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread configuation:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP configuation:
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure packages for kokkos-only:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality cmake configuration:
|
||||
|
||||
if [ -n "${HWLOC_BASE_DIR}" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda cmake configuration:
|
||||
|
||||
if [ -n "${CUDA_ARCH}" ] ;
|
||||
then
|
||||
|
||||
# Options to CUDA_NVCC_FLAGS must be semi-colon delimited,
|
||||
# this is different than the standard CMAKE_CXX_FLAGS syntax.
|
||||
|
||||
CUDA_NVCC_FLAGS="-gencode;arch=compute_${CUDA_ARCH},code=sm_${CUDA_ARCH}"
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi"
|
||||
|
||||
if [ "${CMAKE_BUILD_TYPE}" = "DEBUG" ] ;
|
||||
then
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-g"
|
||||
else
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3"
|
||||
fi
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_VERBOSE_BUILD:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS}"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
if [ "${INTEL}" = "ON" -o "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Cross-compile for Intel Xeon Phi:
|
||||
|
||||
if [ "${INTEL_XEON_PHI}" = "ON" ] ;
|
||||
then
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_SYSTEM_NAME=Linux"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_FLAGS:STRING=-mmic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_Fortran_COMPILER:FILEPATH=ifort"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_DIRS:FILEPATH=${MKLROOT}/lib/mic"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BLAS_LIBRARY_NAMES='mkl_intel_lp64;mkl_sequential;mkl_core;pthread;m'"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D BUILD_SHARED_LIBS:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D DART_TESTING_TIMEOUT:STRING=600"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_LIBRARY_NAMES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_LAPACK_LIBRARIES=''"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_BinUtils=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_Pthread_LIBRARIES=pthread"
|
||||
|
||||
# Cannot cross-compile fortran compatibility checks on the MIC:
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
|
||||
# Tell cmake the answers to compile-and-execute tests
|
||||
# to prevent cmake from executing a cross-compiled program.
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_GCC_ABI_DEMANGLE_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HAVE_TEUCHOS_BLASFLOAT_EXITCODE=0"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D LAPACK_SLAPY2_WORKS_EXITCODE=0"
|
||||
|
||||
fi
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_VERBOSE_MAKEFILE:BOOL=${CMAKE_VERBOSE_MAKEFILE}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
echo "cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}"
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${CMAKE_PROJECT_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,140 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This script uses CUDA, OpenMP, and MPI.
|
||||
#
|
||||
# Before invoking this script, set the OMPI_CXX environment variable
|
||||
# to point to nvcc_wrapper, wherever it happens to live. (If you use
|
||||
# an MPI implementation other than OpenMPI, set the corresponding
|
||||
# environment variable instead.)
|
||||
#
|
||||
|
||||
rm -f CMakeCache.txt;
|
||||
rm -rf CMakeFiles
|
||||
EXTRA_ARGS=$@
|
||||
MPI_PATH="/opt/mpi/openmpi/1.8.2/nvcc-gcc/4.8.3-6.5"
|
||||
CUDA_PATH="/opt/nvidia/cuda/6.5.14"
|
||||
|
||||
#
|
||||
# As long as there are any .cu files in Trilinos, we'll need to set
|
||||
# CUDA_NVCC_FLAGS. If Trilinos gets rid of all of its .cu files and
|
||||
# lets nvcc_wrapper handle them as .cpp files, then we won't need to
|
||||
# set CUDA_NVCC_FLAGS. As it is, given that we need to set
|
||||
# CUDA_NVCC_FLAGS, we must make sure that they are the same flags as
|
||||
# nvcc_wrapper passes to nvcc.
|
||||
#
|
||||
CUDA_NVCC_FLAGS="-gencode;arch=compute_35,code=sm_35;-I${MPI_PATH}/include"
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-Xcompiler;-Wall,-ansi,-fopenmp"
|
||||
CUDA_NVCC_FLAGS="${CUDA_NVCC_FLAGS};-O3;-DKOKKOS_USE_CUDA_UVM"
|
||||
|
||||
cmake \
|
||||
-D CMAKE_INSTALL_PREFIX:PATH="$PWD/../install/" \
|
||||
-D CMAKE_BUILD_TYPE:STRING=DEBUG \
|
||||
-D CMAKE_CXX_FLAGS:STRING="-g -Wall" \
|
||||
-D CMAKE_C_FLAGS:STRING="-g -Wall" \
|
||||
-D CMAKE_FORTRAN_FLAGS:STRING="" \
|
||||
-D CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS="" \
|
||||
-D Trilinos_ENABLE_Triutils=OFF \
|
||||
-D Trilinos_ENABLE_INSTALL_CMAKE_CONFIG_FILES:BOOL=OFF \
|
||||
-D Trilinos_ENABLE_DEBUG:BOOL=OFF \
|
||||
-D Trilinos_ENABLE_CHECKED_STL:BOOL=OFF \
|
||||
-D Trilinos_ENABLE_EXPLICIT_INSTANTIATION:BOOL=OFF \
|
||||
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
|
||||
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF \
|
||||
-D Trilinos_ENABLE_ALL_OPTIONAL_PACKAGES:BOOL=OFF \
|
||||
-D BUILD_SHARED_LIBS:BOOL=OFF \
|
||||
-D DART_TESTING_TIMEOUT:STRING=600 \
|
||||
-D CMAKE_VERBOSE_MAKEFILE:BOOL=OFF \
|
||||
\
|
||||
\
|
||||
-D CMAKE_CXX_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicxx" \
|
||||
-D CMAKE_C_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicc" \
|
||||
-D MPI_CXX_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicxx" \
|
||||
-D MPI_C_COMPILER:FILEPATH="${MPI_PATH}/bin/mpicc" \
|
||||
-D CMAKE_Fortran_COMPILER:FILEPATH="${MPI_PATH}/bin/mpif77" \
|
||||
-D MPI_EXEC:FILEPATH="${MPI_PATH}/bin/mpirun" \
|
||||
-D MPI_EXEC_POST_NUMPROCS_FLAGS:STRING="-bind-to;socket;--map-by;socket;env;CUDA_MANAGED_FORCE_DEVICE_ALLOC=1;CUDA_LAUNCH_BLOCKING=1;OMP_NUM_THREADS=2" \
|
||||
\
|
||||
\
|
||||
-D Trilinos_ENABLE_CXX11:BOOL=OFF \
|
||||
-D TPL_ENABLE_MPI:BOOL=ON \
|
||||
-D Trilinos_ENABLE_OpenMP:BOOL=ON \
|
||||
-D Trilinos_ENABLE_ThreadPool:BOOL=ON \
|
||||
\
|
||||
\
|
||||
-D TPL_ENABLE_CUDA:BOOL=ON \
|
||||
-D CUDA_TOOLKIT_ROOT_DIR:FILEPATH="${CUDA_PATH}" \
|
||||
-D CUDA_PROPAGATE_HOST_FLAGS:BOOL=OFF \
|
||||
-D TPL_ENABLE_Thrust:BOOL=OFF \
|
||||
-D Thrust_INCLUDE_DIRS:FILEPATH="${CUDA_PATH}/include" \
|
||||
-D TPL_ENABLE_CUSPARSE:BOOL=OFF \
|
||||
-D TPL_ENABLE_Cusp:BOOL=OFF \
|
||||
-D Cusp_INCLUDE_DIRS="/home/crtrott/Software/cusp" \
|
||||
-D CUDA_VERBOSE_BUILD:BOOL=OFF \
|
||||
-D CUDA_NVCC_FLAGS:STRING=${CUDA_NVCC_FLAGS} \
|
||||
\
|
||||
\
|
||||
-D TPL_ENABLE_HWLOC=OFF \
|
||||
-D HWLOC_INCLUDE_DIRS="/usr/local/software/hwloc/current/include" \
|
||||
-D HWLOC_LIBRARY_DIRS="/usr/local/software/hwloc/current/lib" \
|
||||
-D TPL_ENABLE_BinUtils=OFF \
|
||||
-D TPL_ENABLE_BLAS:STRING=ON \
|
||||
-D TPL_ENABLE_LAPACK:STRING=ON \
|
||||
-D TPL_ENABLE_MKL:STRING=OFF \
|
||||
-D TPL_ENABLE_HWLOC:STRING=OFF \
|
||||
-D TPL_ENABLE_GTEST:STRING=ON \
|
||||
-D TPL_ENABLE_SuperLU=ON \
|
||||
-D TPL_ENABLE_BLAS=ON \
|
||||
-D TPL_ENABLE_LAPACK=ON \
|
||||
-D TPL_SuperLU_LIBRARIES="/home/crtrott/Software/SuperLU_4.3/lib/libsuperlu_4.3.a" \
|
||||
-D TPL_SuperLU_INCLUDE_DIRS="/home/crtrott/Software/SuperLU_4.3/SRC" \
|
||||
\
|
||||
\
|
||||
-D Trilinos_Enable_Kokkos:BOOL=ON \
|
||||
-D Trilinos_ENABLE_KokkosCore:BOOL=ON \
|
||||
-D Trilinos_ENABLE_TeuchosKokkosCompat:BOOL=ON \
|
||||
-D Trilinos_ENABLE_KokkosContainers:BOOL=ON \
|
||||
-D Trilinos_ENABLE_TpetraKernels:BOOL=ON \
|
||||
-D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON \
|
||||
-D Trilinos_ENABLE_TeuchosKokkosComm:BOOL=ON \
|
||||
-D Trilinos_ENABLE_KokkosExample:BOOL=ON \
|
||||
-D Kokkos_ENABLE_EXAMPLES:BOOL=ON \
|
||||
-D Kokkos_ENABLE_TESTS:BOOL=OFF \
|
||||
-D KokkosClassic_DefaultNode:STRING="Kokkos::Compat::KokkosCudaWrapperNode" \
|
||||
-D TpetraClassic_ENABLE_OpenMPNode=OFF \
|
||||
-D TpetraClassic_ENABLE_TPINode=OFF \
|
||||
-D TpetraClassic_ENABLE_MKL=OFF \
|
||||
-D Kokkos_ENABLE_Cuda_UVM=ON \
|
||||
\
|
||||
\
|
||||
-D Trilinos_ENABLE_Teuchos:BOOL=ON \
|
||||
-D Teuchos_ENABLE_COMPLEX:BOOL=OFF \
|
||||
\
|
||||
\
|
||||
-D Trilinos_ENABLE_Tpetra:BOOL=ON \
|
||||
-D Tpetra_ENABLE_KokkosCore=ON \
|
||||
-D Tpetra_ENABLE_Kokkos_DistObject=OFF \
|
||||
-D Tpetra_ENABLE_Kokkos_Refactor=ON \
|
||||
-D Tpetra_ENABLE_TESTS=ON \
|
||||
-D Tpetra_ENABLE_EXAMPLES=ON \
|
||||
-D Tpetra_ENABLE_MPI_CUDA_RDMA:BOOL=ON \
|
||||
\
|
||||
\
|
||||
-D Trilinos_ENABLE_Belos=OFF \
|
||||
-D Trilinos_ENABLE_Amesos=OFF \
|
||||
-D Trilinos_ENABLE_Amesos2=OFF \
|
||||
-D Trilinos_ENABLE_Ifpack=OFF \
|
||||
-D Trilinos_ENABLE_Ifpack2=OFF \
|
||||
-D Trilinos_ENABLE_Epetra=OFF \
|
||||
-D Trilinos_ENABLE_EpetraExt=OFF \
|
||||
-D Trilinos_ENABLE_Zoltan=OFF \
|
||||
-D Trilinos_ENABLE_Zoltan2=OFF \
|
||||
-D Trilinos_ENABLE_MueLu=OFF \
|
||||
-D Belos_ENABLE_TESTS=ON \
|
||||
-D Belos_ENABLE_EXAMPLES=ON \
|
||||
-D MueLu_ENABLE_TESTS=ON \
|
||||
-D MueLu_ENABLE_EXAMPLES=ON \
|
||||
-D Ifpack2_ENABLE_TESTS=ON \
|
||||
-D Ifpack2_ENABLE_EXAMPLES=ON \
|
||||
$EXTRA_ARGS \
|
||||
${HOME}/Trilinos
|
||||
|
||||
@ -1,113 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# Cuda, OpenMP, Threads, Qthread, hwloc
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3 cuda/6.5.14 nvcc-wrapper/gnu
|
||||
#
|
||||
# The 'nvcc-wrapper' module should load a script that matches
|
||||
# kokkos/config/nvcc_wrapper
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda using GNU, use the nvcc_wrapper to build CUDA source
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality configuration:
|
||||
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Qthread
|
||||
|
||||
QTHREAD_BASE_DIR="/home/projects/qthreads/2014-07-08/host/gnu/4.7.3"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_QTHREAD:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D QTHREAD_INCLUDE_DIRS:FILEPATH=${QTHREAD_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D QTHREAD_LIBRARY_DIRS:FILEPATH=${QTHREAD_BASE_DIR}/lib"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,104 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# Cuda, OpenMP, hwloc
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3 cuda/6.5.14 nvcc-wrapper/gnu
|
||||
#
|
||||
# The 'nvcc-wrapper' module should load a script that matches
|
||||
# kokkos/config/nvcc_wrapper
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda using GNU, use the nvcc_wrapper to build CUDA source
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality configuration:
|
||||
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread explicitly OFF so tribits doesn't automatically turn it on
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,88 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# Cuda
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3 cuda/6.5.14 nvcc-wrapper/gnu
|
||||
#
|
||||
# The 'nvcc-wrapper' module should load a script that matches
|
||||
# kokkos/config/nvcc_wrapper
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Cuda using GNU, use the nvcc_wrapper to build CUDA source
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
|
||||
# Pthread explicitly OFF, otherwise tribits will automatically turn it on
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,84 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# C++11, OpenMP
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread explicitly OFF so tribits doesn't automatically activate
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# <none>
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Kokkos Pthread explicitly OFF, TPL Pthread ON for gtest
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,89 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# Intel, OpenMP, Cuda
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 cuda/7.0.4 intel/2015.0.090 nvcc-wrapper/intel
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=nvcc_wrapper"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUDA:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_CUSPARSE:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread explicitly OFF
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,84 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# Intel, OpenMP
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 intel/13.SP1.1.106
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=icc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=icpc"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread explicitly OFF
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,77 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# OpenMP
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# OpenMP
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_OpenMP:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_OpenMP:BOOL=ON"
|
||||
|
||||
# Pthread explicitly OFF, otherwise tribits will automatically turn it on
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=OFF"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,87 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Copy this script, put it outside the Trilinos source directory, and
|
||||
# build there.
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Building on 'kokkos-dev.sandia.gov' with enabled capabilities:
|
||||
#
|
||||
# Threads, hwloc
|
||||
#
|
||||
# module loaded on 'kokkos-dev.sandia.gov' for this build
|
||||
#
|
||||
# module load cmake/2.8.11.2 gcc/4.8.3
|
||||
#
|
||||
#-----------------------------------------------------------------------------
|
||||
# Source and installation directories:
|
||||
|
||||
TRILINOS_SOURCE_DIR=${HOME}/Trilinos
|
||||
TRILINOS_INSTALL_DIR=${HOME}/TrilinosInstall/`date +%F`
|
||||
|
||||
CMAKE_CONFIGURE=""
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_INSTALL_PREFIX=${TRILINOS_INSTALL_DIR}"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Debug/optimized
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=DEBUG"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_BOUNDS_CHECK:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_BUILD_TYPE:STRING=RELEASE"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_FLAGS:STRING=-Wall"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_C_COMPILER=gcc"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D CMAKE_CXX_COMPILER=g++"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Configure for Kokkos subpackages and tests:
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_Fortran:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_ALL_PACKAGES:BOOL=OFF"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_EXAMPLES:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TESTS:BOOL=ON"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosCore:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosContainers:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosAlgorithms:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_TpetraKernels:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_KokkosExample:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Hardware locality configuration:
|
||||
|
||||
HWLOC_BASE_DIR="/home/projects/hwloc/1.7.1/host/gnu/4.7.3"
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_HWLOC:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_INCLUDE_DIRS:FILEPATH=${HWLOC_BASE_DIR}/include"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D HWLOC_LIBRARY_DIRS:FILEPATH=${HWLOC_BASE_DIR}/lib"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# Pthread
|
||||
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D TPL_ENABLE_Pthread:BOOL=ON"
|
||||
CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_Pthread:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# C++11
|
||||
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Trilinos_ENABLE_CXX11:BOOL=ON"
|
||||
# CMAKE_CONFIGURE="${CMAKE_CONFIGURE} -D Kokkos_ENABLE_CXX11:BOOL=ON"
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
#
|
||||
# Remove CMake output files to force reconfigure from scratch.
|
||||
#
|
||||
|
||||
rm -rf CMake* Trilinos* packages Dart* Testing cmake_install.cmake MakeFile*
|
||||
|
||||
#
|
||||
|
||||
echo cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
cmake ${CMAKE_CONFIGURE} ${TRILINOS_SOURCE_DIR}
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
@ -1,257 +0,0 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# This shell script (nvcc_wrapper) wraps both the host compiler and
|
||||
# NVCC, if you are building Trilinos with CUDA enabled. The script
|
||||
# remedies some differences between the interface of NVCC and that of
|
||||
# the host compiler, in particular for linking. It also means that
|
||||
# Trilinos doesn't need separate .cu files; it can just use .cpp
|
||||
# files.
|
||||
#
|
||||
# Hopefully, at some point, NVIDIA may fix NVCC so as to make this
|
||||
# script obsolete. For now, this script exists and if you want to
|
||||
# build Trilinos with CUDA enabled, you must use this script as your
|
||||
# compiler.
|
||||
|
||||
# Default settings: change those according to your machine. For
|
||||
# example, you may have have two different wrappers with either icpc
|
||||
# or g++ as their back-end compiler. The defaults can be overwritten
|
||||
# by using the usual arguments (e.g., -arch=sm_30 -ccbin icpc).
|
||||
|
||||
default_arch="sm_35"
|
||||
#default_arch="sm_50"
|
||||
|
||||
#
|
||||
# The default C++ compiler.
|
||||
#
|
||||
host_compiler=${NVCC_WRAPPER_DEFAULT_COMPILER:-"g++"}
|
||||
#host_compiler="icpc"
|
||||
#host_compiler="/usr/local/gcc/4.8.3/bin/g++"
|
||||
#host_compiler="/usr/local/gcc/4.9.1/bin/g++"
|
||||
|
||||
#
|
||||
# Internal variables
|
||||
#
|
||||
|
||||
# C++ files
|
||||
cpp_files=""
|
||||
|
||||
# Host compiler arguments
|
||||
xcompiler_args=""
|
||||
|
||||
# Cuda (NVCC) only arguments
|
||||
cuda_args=""
|
||||
|
||||
# Arguments for both NVCC and Host compiler
|
||||
shared_args=""
|
||||
|
||||
# Linker arguments
|
||||
xlinker_args=""
|
||||
|
||||
# Object files passable to NVCC
|
||||
object_files=""
|
||||
|
||||
# Link objects for the host linker only
|
||||
object_files_xlinker=""
|
||||
|
||||
# Does the User set the architecture
|
||||
arch_set=0
|
||||
|
||||
# Does the user overwrite the host compiler
|
||||
ccbin_set=0
|
||||
|
||||
#Error code of compilation
|
||||
error_code=0
|
||||
|
||||
# Do a dry run without actually compiling
|
||||
dry_run=0
|
||||
|
||||
# Skip NVCC compilation and use host compiler directly
|
||||
host_only=0
|
||||
|
||||
# Enable workaround for CUDA 6.5 for pragma ident
|
||||
replace_pragma_ident=0
|
||||
|
||||
# Mark first host compiler argument
|
||||
first_xcompiler_arg=1
|
||||
|
||||
temp_dir=${TMPDIR:-/tmp}
|
||||
|
||||
#echo "Arguments: $# $@"
|
||||
|
||||
while [ $# -gt 0 ]
|
||||
do
|
||||
case $1 in
|
||||
#show the executed command
|
||||
--show|--nvcc-wrapper-show)
|
||||
dry_run=1
|
||||
;;
|
||||
#run host compilation only
|
||||
--host-only)
|
||||
host_only=1
|
||||
;;
|
||||
#replace '#pragma ident' with '#ident' this is needed to compile OpenMPI due to a configure script bug and a non standardized behaviour of pragma with macros
|
||||
--replace-pragma-ident)
|
||||
replace_pragma_ident=1
|
||||
;;
|
||||
#handle source files to be compiled as cuda files
|
||||
*.cpp|*.cxx|*.cc|*.C|*.c++|*.cu)
|
||||
cpp_files="$cpp_files $1"
|
||||
;;
|
||||
#Handle shared args (valid for both nvcc and the host compiler)
|
||||
-O*|-D*|-c|-I*|-L*|-l*|-g|--help|--version|-E|-M|-shared)
|
||||
shared_args="$shared_args $1"
|
||||
;;
|
||||
#Handle shared args that have an argument
|
||||
-o)
|
||||
shared_args="$shared_args $1 $2"
|
||||
shift
|
||||
;;
|
||||
#Handle known nvcc args
|
||||
-gencode*|--dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage)
|
||||
cuda_args="$cuda_args $1"
|
||||
;;
|
||||
#Handle known nvcc args that have an argument
|
||||
-rdc|-maxrregcount|--default-stream)
|
||||
cuda_args="$cuda_args $1 $2"
|
||||
shift
|
||||
;;
|
||||
#Handle c++11 setting
|
||||
--std=c++11|-std=c++11)
|
||||
shared_args="$shared_args $1"
|
||||
;;
|
||||
#strip of -std=c++98 due to nvcc warnings and Tribits will place both -std=c++11 and -std=c++98
|
||||
-std=c++98|--std=c++98)
|
||||
;;
|
||||
#strip of pedantic because it produces endless warnings about #LINE added by the preprocessor
|
||||
-pedantic|-Wpedantic|-ansi)
|
||||
;;
|
||||
#strip -Xcompiler because we add it
|
||||
-Xcompiler)
|
||||
;;
|
||||
#strip of "-x cu" because we add that
|
||||
-x)
|
||||
if [[ $2 != "cu" ]]; then
|
||||
if [ $first_xcompiler_arg -eq 1 ]; then
|
||||
xcompiler_args="-x,$2"
|
||||
first_xcompiler_arg=0
|
||||
else
|
||||
xcompiler_args="$xcompiler_args,-x,$2"
|
||||
fi
|
||||
fi
|
||||
shift
|
||||
;;
|
||||
#Handle -ccbin (if its not set we can set it to a default value)
|
||||
-ccbin)
|
||||
cuda_args="$cuda_args $1 $2"
|
||||
ccbin_set=1
|
||||
host_compiler=$2
|
||||
shift
|
||||
;;
|
||||
#Handle -arch argument (if its not set use a default
|
||||
-arch*)
|
||||
cuda_args="$cuda_args $1"
|
||||
arch_set=1
|
||||
;;
|
||||
#Handle -Xcudafe argument
|
||||
-Xcudafe)
|
||||
cuda_args="$cuda_args -Xcudafe $2"
|
||||
shift
|
||||
;;
|
||||
#Handle args that should be sent to the linker
|
||||
-Wl*)
|
||||
xlinker_args="$xlinker_args -Xlinker ${1:4:${#1}}"
|
||||
host_linker_args="$host_linker_args ${1:4:${#1}}"
|
||||
;;
|
||||
#Handle object files: -x cu applies to all input files, so give them to linker, except if only linking
|
||||
*.a|*.so|*.o|*.obj)
|
||||
object_files="$object_files $1"
|
||||
object_files_xlinker="$object_files_xlinker -Xlinker $1"
|
||||
;;
|
||||
#Handle object files which always need to use "-Xlinker": -x cu applies to all input files, so give them to linker, except if only linking
|
||||
*.so.*|*.dylib)
|
||||
object_files="$object_files -Xlinker $1"
|
||||
object_files_xlinker="$object_files_xlinker -Xlinker $1"
|
||||
;;
|
||||
#All other args are sent to the host compiler
|
||||
*)
|
||||
if [ $first_xcompiler_arg -eq 1 ]; then
|
||||
xcompiler_args=$1
|
||||
first_xcompiler_arg=0
|
||||
else
|
||||
xcompiler_args="$xcompiler_args,$1"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
shift
|
||||
done
|
||||
|
||||
#Add default host compiler if necessary
|
||||
if [ $ccbin_set -ne 1 ]; then
|
||||
cuda_args="$cuda_args -ccbin $host_compiler"
|
||||
fi
|
||||
|
||||
#Add architecture command
|
||||
if [ $arch_set -ne 1 ]; then
|
||||
cuda_args="$cuda_args -arch=$default_arch"
|
||||
fi
|
||||
|
||||
#Compose compilation command
|
||||
nvcc_command="nvcc $cuda_args $shared_args $xlinker_args"
|
||||
if [ $first_xcompiler_arg -eq 0 ]; then
|
||||
nvcc_command="$nvcc_command -Xcompiler $xcompiler_args"
|
||||
fi
|
||||
|
||||
#Compose host only command
|
||||
host_command="$host_compiler $shared_args $xcompiler_args $host_linker_args"
|
||||
|
||||
#nvcc does not accept '#pragma ident SOME_MACRO_STRING' but it does accept '#ident SOME_MACRO_STRING'
|
||||
if [ $replace_pragma_ident -eq 1 ]; then
|
||||
cpp_files2=""
|
||||
for file in $cpp_files
|
||||
do
|
||||
var=`grep pragma ${file} | grep ident | grep "#"`
|
||||
if [ "${#var}" -gt 0 ]
|
||||
then
|
||||
sed 's/#[\ \t]*pragma[\ \t]*ident/#ident/g' $file > $temp_dir/nvcc_wrapper_tmp_$file
|
||||
cpp_files2="$cpp_files2 $temp_dir/nvcc_wrapper_tmp_$file"
|
||||
else
|
||||
cpp_files2="$cpp_files2 $file"
|
||||
fi
|
||||
done
|
||||
cpp_files=$cpp_files2
|
||||
#echo $cpp_files
|
||||
fi
|
||||
|
||||
if [ "$cpp_files" ]; then
|
||||
nvcc_command="$nvcc_command $object_files_xlinker -x cu $cpp_files"
|
||||
else
|
||||
nvcc_command="$nvcc_command $object_files"
|
||||
fi
|
||||
|
||||
if [ "$cpp_files" ]; then
|
||||
host_command="$host_command $object_files $cpp_files"
|
||||
else
|
||||
host_command="$host_command $object_files"
|
||||
fi
|
||||
|
||||
#Print command for dryrun
|
||||
if [ $dry_run -eq 1 ]; then
|
||||
if [ $host_only -eq 1 ]; then
|
||||
echo $host_command
|
||||
else
|
||||
echo $nvcc_command
|
||||
fi
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#Run compilation command
|
||||
if [ $host_only -eq 1 ]; then
|
||||
$host_command
|
||||
else
|
||||
$nvcc_command
|
||||
fi
|
||||
error_code=$?
|
||||
|
||||
#Report error code
|
||||
exit $error_code
|
||||
@ -1,279 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
"""
|
||||
Snapshot a project into another project and perform the necessary repo actions
|
||||
to provide a commit message that can be used to trace back to the exact point
|
||||
in the source repository.
|
||||
"""
|
||||
|
||||
#todo:
|
||||
# Support svn
|
||||
# Allow renaming of the source dir in the destination path
|
||||
# Check if a new snapshot is necessary?
|
||||
#
|
||||
|
||||
import sys
|
||||
|
||||
#check the version number so that there is a good error message when argparse is not available.
|
||||
#This checks for exactly 2.7 which is bad, but it is a python 2 script and argparse was introduced
|
||||
#in 2.7 which is also the last version of python 2. If this script is updated for python 3 this
|
||||
#will need to change, but for now it is not safe to allow 3.x to run this.
|
||||
if sys.version_info[:2] != (2, 7):
|
||||
print "Error snapshot requires python 2.7 detected version is %d.%d." % (sys.version_info[0], sys.version_info[1])
|
||||
sys.exit(1)
|
||||
|
||||
import subprocess, argparse, re, doctest, os, datetime, traceback
|
||||
|
||||
def parse_cmdline(description):
|
||||
parser = argparse.ArgumentParser(usage="snapshot.py [options] source destination", description=description)
|
||||
|
||||
parser.add_argument("-n", "--no-comit", action="store_false", dest="create_commit", default=True,
|
||||
help="Do not perform a commit or create a commit message.")
|
||||
parser.add_argument("-v", "--verbose", action="store_true", dest="verbose_mode", default=False,
|
||||
help="Enable verbose mode.")
|
||||
parser.add_argument("-d", "--debug", action="store_true", dest="debug_mode", default=False,
|
||||
help="Enable debugging output.")
|
||||
parser.add_argument("--no-validate-repo", action="store_true", dest="no_validate_repo", default=False,
|
||||
help="Reduce the validation that the source and destination repos are clean to a warning.")
|
||||
parser.add_argument("--source-repo", choices=["git","none"], default="",
|
||||
help="Type of repository of the source, use none to skip all repository operations.")
|
||||
parser.add_argument("--dest-repo", choices=["git","none"], default="",
|
||||
help="Type of repository of the destination, use none to skip all repository operations.")
|
||||
|
||||
parser.add_argument("source", help="Source project to snapshot from.")
|
||||
parser.add_argument("destination", help="Destination to snapshot too.")
|
||||
|
||||
options = parser.parse_args()
|
||||
options = validate_options(options)
|
||||
return options
|
||||
#end parseCmdline
|
||||
|
||||
def validate_options(options):
|
||||
apparent_source_repo_type="none"
|
||||
apparent_dest_repo_type="none"
|
||||
|
||||
#prevent user from accidentally giving us a path that rsync will treat differently than expected.
|
||||
options.source = options.source.rstrip(os.sep)
|
||||
options.destination = options.destination.rstrip(os.sep)
|
||||
|
||||
options.source = os.path.abspath(options.source)
|
||||
options.destination = os.path.abspath(options.destination)
|
||||
|
||||
if os.path.exists(options.source):
|
||||
apparent_source_repo_type, source_root = deterimine_repo_type(options.source)
|
||||
else:
|
||||
raise RuntimeError("Could not find source directory of %s." % options.source)
|
||||
options.source_root = source_root
|
||||
|
||||
if not os.path.exists(options.destination):
|
||||
print "Could not find destination directory of %s so it will be created." % options.destination
|
||||
os.makedirs(options.destination)
|
||||
|
||||
apparent_dest_repo_type, dest_root = deterimine_repo_type(options.destination)
|
||||
options.dest_root = dest_root
|
||||
|
||||
#error on svn repo types for now
|
||||
if apparent_source_repo_type == "svn" or apparent_dest_repo_type == "svn":
|
||||
raise RuntimeError("SVN repositories are not supported at this time.")
|
||||
|
||||
if options.source_repo == "":
|
||||
#source repo type is not specified to just using the apparent type.
|
||||
options.source_repo = apparent_source_repo_type
|
||||
else:
|
||||
if options.source_repo != "none" and options.source_repo != apparent_source_repo_type:
|
||||
raise RuntimeError("Specified source repository type of %s conflicts with determined type of %s" % \
|
||||
(options.source_repo, apparent_source_repo_type))
|
||||
|
||||
if options.dest_repo == "":
|
||||
#destination repo type is not specified to just using the apparent type.
|
||||
options.dest_repo = apparent_dest_repo_type
|
||||
else:
|
||||
if options.dest_repo != "none" and options.dest_repo != apparent_dest_repo_type:
|
||||
raise RuntimeError("Specified destination repository type of %s conflicts with determined type of %s" % \
|
||||
(options.dest_repo, apparent_dest_repo_type))
|
||||
|
||||
return options
|
||||
#end validate_options
|
||||
|
||||
def run_cmd(cmd, options, working_dir="."):
|
||||
cmd_str = " ".join(cmd)
|
||||
if options.verbose_mode:
|
||||
print "Running command '%s' in dir %s." % (cmd_str, working_dir)
|
||||
|
||||
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=working_dir)
|
||||
proc_stdout, proc_stderr = proc.communicate()
|
||||
ret_val = proc.wait()
|
||||
|
||||
if options.debug_mode:
|
||||
print "==== %s stdout start ====" % cmd_str
|
||||
print proc_stdout
|
||||
print "==== %s stdout end ====" % cmd_str
|
||||
print "==== %s stderr ====" % cmd_str
|
||||
print proc_stderr
|
||||
print "==== %s stderr ====" % cmd_str
|
||||
|
||||
if ret_val != 0:
|
||||
raise RuntimeError("Command '%s' failed with error code %d. Error message:%s%s%sstdout:%s" % \
|
||||
(cmd_str, ret_val, os.linesep, proc_stderr, os.linesep, proc_stdout))
|
||||
|
||||
return proc_stdout, proc_stderr
|
||||
#end run_cmd
|
||||
|
||||
def deterimine_repo_type(location):
|
||||
apparent_repo_type = "none"
|
||||
|
||||
while location != "":
|
||||
if os.path.exists(os.path.join(location, ".git")):
|
||||
apparent_repo_type = "git"
|
||||
break
|
||||
elif os.path.exists(os.path.join(location, ".svn")):
|
||||
apparent_repo_type = "svn"
|
||||
break
|
||||
else:
|
||||
location = location[:location.rfind(os.sep)]
|
||||
|
||||
return apparent_repo_type, location
|
||||
|
||||
#end deterimine_repo_type
|
||||
|
||||
def rsync(source, dest, options):
|
||||
rsync_cmd = ["rsync", "-ar", "--delete"]
|
||||
if options.debug_mode:
|
||||
rsync_cmd.append("-v")
|
||||
|
||||
if options.source_repo == "git":
|
||||
rsync_cmd.append("--exclude=.git")
|
||||
|
||||
rsync_cmd.append(options.source)
|
||||
rsync_cmd.append(options.destination)
|
||||
run_cmd(rsync_cmd, options)
|
||||
#end rsync
|
||||
|
||||
def create_commit_message(commit_id, commit_log, project_name, project_location):
|
||||
eol = os.linesep
|
||||
message = "Snapshot of %s from commit %s" % (project_name, commit_id)
|
||||
message += eol * 2
|
||||
message += "From repository at %s" % project_location
|
||||
message += eol * 2
|
||||
message += "At commit:" + eol
|
||||
message += commit_log
|
||||
return message
|
||||
#end create_commit_message
|
||||
|
||||
def find_git_commit_information(options):
|
||||
r"""
|
||||
>>> class fake_options:
|
||||
... source="."
|
||||
... verbose_mode=False
|
||||
... debug_mode=False
|
||||
>>> myoptions = fake_options()
|
||||
>>> find_git_commit_information(myoptions)[2:]
|
||||
('sems', 'software.sandia.gov:/git/sems')
|
||||
"""
|
||||
git_log_cmd = ["git", "log", "-1"]
|
||||
|
||||
output, error = run_cmd(git_log_cmd, options, options.source)
|
||||
|
||||
commit_match = re.match("commit ([0-9a-fA-F]+)", output)
|
||||
commit_id = commit_match.group(1)
|
||||
commit_log = output
|
||||
|
||||
git_remote_cmd = ["git", "remote", "-v"]
|
||||
output, error = run_cmd(git_remote_cmd, options, options.source)
|
||||
|
||||
remote_match = re.search("origin\s([^ ]*/([^ ]+))", output, re.MULTILINE)
|
||||
if not remote_match:
|
||||
raise RuntimeError("Could not find origin of repo at %s. Consider using none for source repo type." % (options.source))
|
||||
|
||||
source_location = remote_match.group(1)
|
||||
source_name = remote_match.group(2).strip()
|
||||
|
||||
if source_name[-1] == "/":
|
||||
source_name = source_name[:-1]
|
||||
|
||||
return commit_id, commit_log, source_name, source_location
|
||||
|
||||
#end find_git_commit_information
|
||||
|
||||
def do_git_commit(message, options):
|
||||
if options.verbose_mode:
|
||||
print "Commiting to destination repository."
|
||||
|
||||
git_add_cmd = ["git", "add", "-A"]
|
||||
run_cmd(git_add_cmd, options, options.destination)
|
||||
|
||||
git_commit_cmd = ["git", "commit", "-m%s" % message]
|
||||
run_cmd(git_commit_cmd, options, options.destination)
|
||||
|
||||
git_log_cmd = ["git", "log", "--format=%h", "-1"]
|
||||
commit_sha1, error = run_cmd(git_log_cmd, options, options.destination)
|
||||
|
||||
print "Commit %s was made to %s." % (commit_sha1.strip(), options.dest_root)
|
||||
#end do_git_commit
|
||||
|
||||
def verify_git_repo_clean(location, options):
|
||||
git_status_cmd = ["git", "status", "--porcelain"]
|
||||
output, error = run_cmd(git_status_cmd, options, location)
|
||||
|
||||
if output != "":
|
||||
if options.no_validate_repo == False:
|
||||
raise RuntimeError("%s is not clean.%sPlease commit or stash all changes before running snapshot."
|
||||
% (location, os.linesep))
|
||||
else:
|
||||
print "WARNING: %s is not clean. Proceeding anyway." % location
|
||||
print "WARNING: This could lead to differences in the source and destination."
|
||||
print "WARNING: It could also lead to extra files being included in the snapshot commit."
|
||||
|
||||
#end verify_git_repo_clean
|
||||
|
||||
def main(options):
|
||||
if options.verbose_mode:
|
||||
print "Snapshotting %s to %s." % (options.source, options.destination)
|
||||
|
||||
if options.source_repo == "git":
|
||||
verify_git_repo_clean(options.source, options)
|
||||
commit_id, commit_log, repo_name, repo_location = find_git_commit_information(options)
|
||||
elif options.source_repo == "none":
|
||||
commit_id = "N/A"
|
||||
commit_log = "Unknown commit from %s snapshotted at: %s" % (options.source, datetime.datetime.now())
|
||||
repo_name = options.source
|
||||
repo_location = options.source
|
||||
|
||||
commit_message = create_commit_message(commit_id, commit_log, repo_name, repo_location) + os.linesep*2
|
||||
|
||||
if options.dest_repo == "git":
|
||||
verify_git_repo_clean(options.destination, options)
|
||||
|
||||
rsync(options.source, options.destination, options)
|
||||
|
||||
if options.dest_repo == "git":
|
||||
do_git_commit(commit_message, options)
|
||||
elif options.dest_repo == "none":
|
||||
file_name = "snapshot_message.txt"
|
||||
message_file = open(file_name, "w")
|
||||
message_file.write(commit_message)
|
||||
message_file.close()
|
||||
cwd = os.getcwd()
|
||||
print "No commit done by request. Please use file at:"
|
||||
print "%s%sif you wish to commit this to a repo later." % (cwd+"/"+file_name, os.linesep)
|
||||
|
||||
|
||||
|
||||
|
||||
#end main
|
||||
|
||||
if (__name__ == "__main__"):
|
||||
if ("--test" in sys.argv):
|
||||
doctest.testmod()
|
||||
sys.exit(0)
|
||||
|
||||
try:
|
||||
options = parse_cmdline(__doc__)
|
||||
main(options)
|
||||
except RuntimeError, e:
|
||||
print "Error occured:", e
|
||||
if "--debug" in sys.argv:
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
else:
|
||||
sys.exit(0)
|
||||
@ -1,437 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
#
|
||||
# Global config
|
||||
#
|
||||
|
||||
set -o pipefail
|
||||
|
||||
GCC_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial"
|
||||
INTEL_BUILD_LIST="OpenMP,Pthread,Serial,OpenMP_Serial,Pthread_Serial"
|
||||
CLANG_BUILD_LIST="Pthread,Serial,Pthread_Serial"
|
||||
CUDA_BUILD_LIST="Cuda_OpenMP,Cuda_Pthread,Cuda_Serial"
|
||||
|
||||
GCC_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wignored-qualifiers,-Wempty-body,-Wclobbered,-Wuninitialized"
|
||||
CLANG_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized"
|
||||
INTEL_WARNING_FLAGS="-Wall,-Wshadow,-pedantic,-Werror,-Wsign-compare,-Wtype-limits,-Wuninitialized"
|
||||
CUDA_WARNING_FLAGS=""
|
||||
|
||||
BASE_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>/base,hwloc/1.10.1/<COMPILER_NAME>/<COMPILER_VERSION>/base"
|
||||
CUDA_MODULE_LIST="<COMPILER_NAME>/<COMPILER_VERSION>,gcc/4.7.2/base"
|
||||
|
||||
export OMP_NUM_THREADS=4
|
||||
|
||||
declare -i NUM_RESULTS_TO_KEEP=7
|
||||
|
||||
RESULT_ROOT_PREFIX=TestAll
|
||||
|
||||
source /projects/modulefiles/utils/sems-modules-init.sh
|
||||
source /projects/modulefiles/utils/kokkos-modules-init.sh
|
||||
|
||||
SCRIPT_KOKKOS_ROOT=$( cd "$( dirname "$0" )" && cd .. && pwd )
|
||||
|
||||
#
|
||||
# Handle arguments
|
||||
#
|
||||
|
||||
DEBUG=False
|
||||
ARGS=""
|
||||
CUSTOM_BUILD_LIST=""
|
||||
DRYRUN=False
|
||||
BUILD_ONLY=False
|
||||
declare -i NUM_JOBS_TO_RUN_IN_PARALLEL=3
|
||||
TEST_SCRIPT=False
|
||||
|
||||
while [[ $# > 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
case $key in
|
||||
--kokkos-path*)
|
||||
KOKKOS_PATH="${key#*=}"
|
||||
;;
|
||||
--build-list*)
|
||||
CUSTOM_BUILD_LIST="${key#*=}"
|
||||
;;
|
||||
--debug*)
|
||||
DEBUG=True
|
||||
;;
|
||||
--build-only*)
|
||||
BUILD_ONLY=True
|
||||
;;
|
||||
--test-script*)
|
||||
TEST_SCRIPT=True
|
||||
;;
|
||||
--num*)
|
||||
NUM_JOBS_TO_RUN_IN_PARALLEL="${key#*=}"
|
||||
;;
|
||||
--dry-run*)
|
||||
DRYRUN=True
|
||||
;;
|
||||
--help)
|
||||
echo "test_all_sandia <ARGS> <OPTIONS>:"
|
||||
echo "--kokkos-path=/Path/To/Kokkos: Path to the Kokkos root directory"
|
||||
echo " Defaults to root repo containing this script"
|
||||
echo "--debug: Run tests in debug. Defaults to False"
|
||||
echo "--test-script: Test this script, not Kokkos"
|
||||
echo "--num=N: Number of jobs to run in parallel "
|
||||
echo "--dry-run: Just print what would be executed"
|
||||
echo "--build-only: Just do builds, don't run anything"
|
||||
echo "--build-list=BUILD,BUILD,BUILD..."
|
||||
echo " Provide a comma-separated list of builds instead of running all builds"
|
||||
echo " Valid items:"
|
||||
echo " OpenMP, Pthread, Serial, OpenMP_Serial, Pthread_Serial"
|
||||
echo " Cuda_OpenMP, Cuda_Pthread, Cuda_Serial"
|
||||
echo ""
|
||||
echo "ARGS: list of expressions matching compilers to test"
|
||||
echo " supported compilers"
|
||||
echo " gcc/4.7.2"
|
||||
echo " gcc/4.8.4"
|
||||
echo " gcc/4.9.2"
|
||||
echo " gcc/5.1.0"
|
||||
echo " intel/14.0.4"
|
||||
echo " intel/15.0.2"
|
||||
echo " clang/3.5.2"
|
||||
echo " clang/3.6.1"
|
||||
echo " cuda/6.5.14"
|
||||
echo " cuda/7.0.28"
|
||||
echo " cuda/7.5.18"
|
||||
echo ""
|
||||
echo "Examples:"
|
||||
echo " Run all tests"
|
||||
echo " % test_all_sandia"
|
||||
echo ""
|
||||
echo " Run all gcc tests"
|
||||
echo " % test_all_sandia gcc"
|
||||
echo ""
|
||||
echo " Run all gcc/4.7.2 and all intel tests"
|
||||
echo " % test_all_sandia gcc/4.7.2 intel"
|
||||
echo ""
|
||||
echo " Run all tests in debug"
|
||||
echo " % test_all_sandia --debug"
|
||||
echo ""
|
||||
echo " Run gcc/4.7.2 and only do OpenMP and OpenMP_Serial builds"
|
||||
echo " % test_all_sandia gcc/4.7.2 --build-list=OpenMP,OpenMP_Serial"
|
||||
echo ""
|
||||
echo "If you want to kill the tests, do:"
|
||||
echo " hit ctrl-z"
|
||||
echo " % kill -9 %1"
|
||||
echo
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
# args, just append
|
||||
ARGS="$ARGS $1"
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# set kokkos path
|
||||
if [ -z "$KOKKOS_PATH" ]; then
|
||||
KOKKOS_PATH=$SCRIPT_KOKKOS_ROOT
|
||||
else
|
||||
# Ensure KOKKOS_PATH is abs path
|
||||
KOKKOS_PATH=$( cd $KOKKOS_PATH && pwd )
|
||||
fi
|
||||
|
||||
# set build type
|
||||
if [ "$DEBUG" = "True" ]; then
|
||||
BUILD_TYPE=debug
|
||||
else
|
||||
BUILD_TYPE=release
|
||||
fi
|
||||
|
||||
# If no args provided, do all compilers
|
||||
if [ -z "$ARGS" ]; then
|
||||
ARGS='?'
|
||||
fi
|
||||
|
||||
# Format: (compiler module-list build-list exe-name warning-flag)
|
||||
COMPILERS=("gcc/4.7.2 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS"
|
||||
"gcc/4.8.4 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS"
|
||||
"gcc/4.9.2 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS"
|
||||
"gcc/5.1.0 $BASE_MODULE_LIST $GCC_BUILD_LIST g++ $GCC_WARNING_FLAGS"
|
||||
"intel/14.0.4 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS"
|
||||
"intel/15.0.2 $BASE_MODULE_LIST $INTEL_BUILD_LIST icpc $INTEL_WARNING_FLAGS"
|
||||
"clang/3.5.2 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS"
|
||||
"clang/3.6.1 $BASE_MODULE_LIST $CLANG_BUILD_LIST clang++ $CLANG_WARNING_FLAGS"
|
||||
"cuda/6.5.14 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/config/nvcc_wrapper $CUDA_WARNING_FLAGS"
|
||||
"cuda/7.0.28 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/config/nvcc_wrapper $CUDA_WARNING_FLAGS"
|
||||
"cuda/7.5.18 $CUDA_MODULE_LIST $CUDA_BUILD_LIST $KOKKOS_PATH/config/nvcc_wrapper $CUDA_WARNING_FLAGS"
|
||||
)
|
||||
|
||||
# Process args to figure out which compilers to test
|
||||
COMPILERS_TO_TEST=""
|
||||
for ARG in $ARGS; do
|
||||
for COMPILER_DATA in "${COMPILERS[@]}"; do
|
||||
ARR=($COMPILER_DATA)
|
||||
COMPILER=${ARR[0]}
|
||||
if [[ "$COMPILER" = $ARG* ]]; then
|
||||
if [[ "$COMPILERS_TO_TEST" != *${COMPILER}* ]]; then
|
||||
COMPILERS_TO_TEST="$COMPILERS_TO_TEST $COMPILER"
|
||||
else
|
||||
echo "Tried to add $COMPILER twice"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
|
||||
#
|
||||
# Functions
|
||||
#
|
||||
|
||||
# get_compiler_name <COMPILER>
|
||||
get_compiler_name() {
|
||||
echo $1 | cut -d/ -f1
|
||||
}
|
||||
|
||||
# get_compiler_version <COMPILER>
|
||||
get_compiler_version() {
|
||||
echo $1 | cut -d/ -f2
|
||||
}
|
||||
|
||||
# Do not call directly
|
||||
get_compiler_data() {
|
||||
local compiler=$1
|
||||
local item=$2
|
||||
local compiler_name=$(get_compiler_name $compiler)
|
||||
local compiler_vers=$(get_compiler_version $compiler)
|
||||
|
||||
local compiler_data
|
||||
for compiler_data in "${COMPILERS[@]}" ; do
|
||||
local arr=($compiler_data)
|
||||
if [ "$compiler" = "${arr[0]}" ]; then
|
||||
echo "${arr[$item]}" | tr , ' ' | sed -e "s/<COMPILER_NAME>/$compiler_name/g" -e "s/<COMPILER_VERSION>/$compiler_vers/g"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Not found
|
||||
echo "Unreconized compiler $compiler" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
#
|
||||
# For all getters, usage: <GETTER> <COMPILER>
|
||||
#
|
||||
|
||||
get_compiler_modules() {
|
||||
get_compiler_data $1 1
|
||||
}
|
||||
|
||||
get_compiler_build_list() {
|
||||
get_compiler_data $1 2
|
||||
}
|
||||
|
||||
get_compiler_exe_name() {
|
||||
get_compiler_data $1 3
|
||||
}
|
||||
|
||||
get_compiler_warning_flags() {
|
||||
get_compiler_data $1 4
|
||||
}
|
||||
|
||||
run_cmd() {
|
||||
echo "RUNNING: $*"
|
||||
if [ "$DRYRUN" != "True" ]; then
|
||||
eval "$* 2>&1"
|
||||
fi
|
||||
}
|
||||
|
||||
# report_and_log_test_results <SUCCESS> <DESC> <PHASE>
|
||||
report_and_log_test_result() {
|
||||
# Use sane var names
|
||||
local success=$1; local desc=$2; local phase=$3;
|
||||
|
||||
if [ "$success" = "0" ]; then
|
||||
echo " PASSED $desc"
|
||||
touch $PASSED_DIR/$desc
|
||||
else
|
||||
echo " FAILED $desc" >&2
|
||||
echo $phase > $FAILED_DIR/$desc
|
||||
cat ${desc}.${phase}.log
|
||||
fi
|
||||
}
|
||||
|
||||
setup_env() {
|
||||
local compiler=$1
|
||||
local compiler_modules=$(get_compiler_modules $compiler)
|
||||
|
||||
module purge
|
||||
|
||||
local mod
|
||||
for mod in $compiler_modules; do
|
||||
module load $mod 2>&1
|
||||
# It is ridiculously hard to check for the success of a loaded
|
||||
# module. Module does not return error codes and piping to grep
|
||||
# causes module to run in a subshell.
|
||||
module list 2>&1 | grep "$mod" >& /dev/null || return 1
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# single_build_and_test <COMPILER> <BUILD> <BUILD_TYPE>
|
||||
single_build_and_test() {
|
||||
# Use sane var names
|
||||
local compiler=$1; local build=$2; local build_type=$3;
|
||||
|
||||
# set up env
|
||||
mkdir -p $ROOT_DIR/$compiler/"${build}-$build_type"
|
||||
cd $ROOT_DIR/$compiler/"${build}-$build_type"
|
||||
local desc=$(echo "${compiler}-${build}-${build_type}" | sed 's:/:-:g')
|
||||
setup_env $compiler >& ${desc}.configure.log || { report_and_log_test_result 1 ${desc} configure && return 0; }
|
||||
|
||||
# Set up flags
|
||||
local compiler_warning_flags=$(get_compiler_warning_flags $compiler)
|
||||
local compiler_exe=$(get_compiler_exe_name $compiler)
|
||||
|
||||
if [[ "$build_type" = hwloc* ]]; then
|
||||
local extra_args=--with-hwloc=$(dirname $(dirname $(which hwloc-info)))
|
||||
fi
|
||||
|
||||
if [[ "$build_type" = *debug* ]]; then
|
||||
local extra_args="$extra_args --debug"
|
||||
local cxxflags="-g $compiler_warning_flags"
|
||||
else
|
||||
local cxxflags="-O3 $compiler_warning_flags"
|
||||
fi
|
||||
|
||||
if [[ "$compiler" == cuda* ]]; then
|
||||
cxxflags="--keep --keep-dir=$(pwd) $cxxflags"
|
||||
export TMPDIR=$(pwd)
|
||||
fi
|
||||
|
||||
# cxxflags="-DKOKKOS_USING_EXPERIMENTAL_VIEW $cxxflags"
|
||||
|
||||
echo " Starting job $desc"
|
||||
|
||||
if [ "$TEST_SCRIPT" = "True" ]; then
|
||||
local rand=$[ 1 + $[ RANDOM % 10 ]]
|
||||
sleep $rand
|
||||
if [ $rand -gt 5 ]; then
|
||||
run_cmd ls fake_problem >& ${desc}.configure.log || { report_and_log_test_result 1 $desc configure && return 0; }
|
||||
fi
|
||||
else
|
||||
run_cmd ${KOKKOS_PATH}/generate_makefile.bash --with-devices=$build --compiler=$(which $compiler_exe) --cxxflags=\"$cxxflags\" $extra_args >& ${desc}.configure.log || { report_and_log_test_result 1 ${desc} configure && return 0; }
|
||||
run_cmd make build-test >& ${desc}.build.log || { report_and_log_test_result 1 ${desc} build && return 0; }
|
||||
if [[ "$BUILD_ONLY" == False ]]; then
|
||||
run_cmd make test >& ${desc}.test.log || { report_and_log_test_result 1 ${desc} test && return 0; }
|
||||
fi
|
||||
fi
|
||||
|
||||
report_and_log_test_result 0 $desc
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
# wait_for_jobs <NUM-JOBS>
|
||||
wait_for_jobs() {
|
||||
local -i max_jobs=$1
|
||||
local -i num_active_jobs=$(jobs | wc -l)
|
||||
while [ $num_active_jobs -ge $max_jobs ]
|
||||
do
|
||||
sleep 1
|
||||
num_active_jobs=$(jobs | wc -l)
|
||||
jobs >& /dev/null
|
||||
done
|
||||
}
|
||||
|
||||
# run_in_background <COMPILER> <BUILD> <BUILD_TYPE>
|
||||
run_in_background() {
|
||||
local compiler=$1
|
||||
|
||||
local -i num_jobs=$NUM_JOBS_TO_RUN_IN_PARALLEL
|
||||
if [[ "$BUILD_ONLY" == True ]]; then
|
||||
num_jobs=8
|
||||
else
|
||||
if [[ "$compiler" == cuda* ]]; then
|
||||
num_jobs=1
|
||||
fi
|
||||
fi
|
||||
wait_for_jobs $num_jobs
|
||||
|
||||
single_build_and_test $* &
|
||||
}
|
||||
|
||||
# build_and_test_all <COMPILER>
|
||||
build_and_test_all() {
|
||||
# Get compiler data
|
||||
local compiler=$1
|
||||
if [ -z "$CUSTOM_BUILD_LIST" ]; then
|
||||
local compiler_build_list=$(get_compiler_build_list $compiler)
|
||||
else
|
||||
local compiler_build_list=$(echo "$CUSTOM_BUILD_LIST" | tr , ' ')
|
||||
fi
|
||||
|
||||
# do builds
|
||||
local build
|
||||
for build in $compiler_build_list
|
||||
do
|
||||
run_in_background $compiler $build $BUILD_TYPE
|
||||
|
||||
# If not cuda, do a hwloc test too
|
||||
if [[ "$compiler" != cuda* ]]; then
|
||||
run_in_background $compiler $build "hwloc-$BUILD_TYPE"
|
||||
fi
|
||||
done
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
get_test_root_dir() {
|
||||
local existing_results=$(find . -maxdepth 1 -name "$RESULT_ROOT_PREFIX*" | sort)
|
||||
local -i num_existing_results=$(echo $existing_results | tr ' ' '\n' | wc -l)
|
||||
local -i num_to_delete=${num_existing_results}-${NUM_RESULTS_TO_KEEP}
|
||||
|
||||
if [ $num_to_delete -gt 0 ]; then
|
||||
/bin/rm -rf $(echo $existing_results | tr ' ' '\n' | head -n $num_to_delete)
|
||||
fi
|
||||
|
||||
echo $(pwd)/${RESULT_ROOT_PREFIX}_$(date +"%Y-%m-%d_%H.%M.%S")
|
||||
}
|
||||
|
||||
wait_summarize_and_exit() {
|
||||
wait_for_jobs 1
|
||||
|
||||
echo "#######################################################"
|
||||
echo "PASSED TESTS"
|
||||
echo "#######################################################"
|
||||
|
||||
\ls -1 $PASSED_DIR | sort
|
||||
|
||||
echo "#######################################################"
|
||||
echo "FAILED TESTS"
|
||||
echo "#######################################################"
|
||||
|
||||
local failed_test
|
||||
local -i rv=0
|
||||
for failed_test in $(\ls -1 $FAILED_DIR)
|
||||
do
|
||||
echo $failed_test "("$(cat $FAILED_DIR/$failed_test)" failed)"
|
||||
rv=$rv+1
|
||||
done
|
||||
|
||||
exit $rv
|
||||
}
|
||||
|
||||
#
|
||||
# Main
|
||||
#
|
||||
|
||||
ROOT_DIR=$(get_test_root_dir)
|
||||
mkdir -p $ROOT_DIR
|
||||
cd $ROOT_DIR
|
||||
|
||||
PASSED_DIR=$ROOT_DIR/results/passed
|
||||
FAILED_DIR=$ROOT_DIR/results/failed
|
||||
mkdir -p $PASSED_DIR
|
||||
mkdir -p $FAILED_DIR
|
||||
|
||||
echo "Going to test compilers: " $COMPILERS_TO_TEST
|
||||
for COMPILER in $COMPILERS_TO_TEST; do
|
||||
echo "Testing compiler $COMPILER"
|
||||
build_and_test_all $COMPILER
|
||||
done
|
||||
|
||||
wait_summarize_and_exit
|
||||
@ -1,5 +0,0 @@
|
||||
jenkins_test_driver is designed to be run through Jenkins as a
|
||||
multiconfiguration job. It relies on a number of environment variables that will
|
||||
only be set when run in that context. It is possible to override these if you
|
||||
know the Jenkins job setup. It is not recommended that a non-expert try to run
|
||||
this script directly.
|
||||
@ -1,83 +0,0 @@
|
||||
#!/bin/bash -x
|
||||
|
||||
echo "Building for BUILD_TYPE = ${BUILD_TYPE}"
|
||||
echo "Building with HOST_COMPILER = ${HOST_COMPILER}"
|
||||
echo "Building in ${WORKSPACE}"
|
||||
|
||||
module use /home/projects/modulefiles
|
||||
|
||||
BUILD_TYPE=`echo $BUILD_TYPE | tr "~" " "`
|
||||
build_options=""
|
||||
for item in ${BUILD_TYPE}; do
|
||||
build_options="$build_options --with-$item"
|
||||
done
|
||||
|
||||
kokkos_path=${WORKSPACE}/kokkos
|
||||
gtest_path=${WORKSPACE}/kokkos/tpls/gtest
|
||||
|
||||
echo ${WORKSPACE}
|
||||
pwd
|
||||
|
||||
#extract information from the provided parameters.
|
||||
host_compiler_brand=`echo $HOST_COMPILER | grep -o "^[a-zA-Z]*"`
|
||||
cuda_compiler=`echo $BUILD_TYPE | grep -o "cuda_[^ ]*"`
|
||||
|
||||
host_compiler_module=`echo $HOST_COMPILER | tr "_" "/"`
|
||||
cuda_compiler_module=`echo $cuda_compiler | tr "_" "/"`
|
||||
build_path=`echo $BUILD_TYPE | tr " " "_"`
|
||||
|
||||
module load $host_compiler_module
|
||||
module load $cuda_compiler_module
|
||||
|
||||
case $host_compiler_brand in
|
||||
gcc)
|
||||
module load nvcc-wrapper/gnu
|
||||
compiler=g++
|
||||
;;
|
||||
intel)
|
||||
module load nvcc-wrapper/intel
|
||||
compiler=icpc
|
||||
;;
|
||||
*)
|
||||
echo "Unrecognized compiler brand."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
#if cuda is on we need to set the host compiler for the
|
||||
#nvcc wrapper and make the wrapper the compiler.
|
||||
if [ $cuda_compiler != "" ]; then
|
||||
export NVCC_WRAPPER_DEFAULT_COMPILER=$compiler
|
||||
compiler=$kokkos_path/config/nvcc_wrapper
|
||||
fi
|
||||
|
||||
if [ $host_compiler_brand == "intel" -a $cuda_compiler != "" ]; then
|
||||
echo "Intel compilers are not supported with cuda at this time."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
rm -rf test-$build_path
|
||||
mkdir test-$build_path
|
||||
cd test-$build_path
|
||||
|
||||
/bin/bash $kokkos_path/generate_makefile.bash $build_options --kokkos-path="$kokkos_path" --with-gtest="$gtest_path" --compiler=$compiler 2>&1 |tee configure.out
|
||||
|
||||
if [ ${PIPESTATUS[0]} != 0 ]; then
|
||||
echo "Configure failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make build-test 2>&1 | tee build.log
|
||||
|
||||
if [ ${PIPESTATUS[0]} != 0 ]; then
|
||||
echo "Build failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
make test 2>&1 | tee test.log
|
||||
|
||||
grep "FAIL" test.log
|
||||
if [ $? == 0 ]; then
|
||||
echo "Tests failed."
|
||||
exit 1
|
||||
fi
|
||||
@ -1,287 +0,0 @@
|
||||
#! /usr/bin/env python
|
||||
|
||||
"""
|
||||
Compute the size at which the current compiler will start to
|
||||
significantly scale back optimization.
|
||||
|
||||
The CPP file being modified will need the following tags.
|
||||
// JGF_DUPLICATE_BEGIN - Put before start of function to duplicate
|
||||
// JGF_DUPLICATE_END - Put after end of function to duplcate
|
||||
// JGF_DUPE function_name(args); - Put anywhere where it's legal to
|
||||
put a function call but not in your timing section.
|
||||
|
||||
The program will need to output the string:
|
||||
FOM: <number>
|
||||
This will represent the program's performance
|
||||
"""
|
||||
|
||||
import argparse, sys, os, doctest, subprocess, re, time
|
||||
|
||||
VERBOSE = False
|
||||
|
||||
###############################################################################
|
||||
def parse_command_line(args, description):
|
||||
###############################################################################
|
||||
parser = argparse.ArgumentParser(
|
||||
usage="""\n%s <cppfile> <build-command> <run-command> [--verbose]
|
||||
OR
|
||||
%s --help
|
||||
OR
|
||||
%s --test
|
||||
|
||||
\033[1mEXAMPLES:\033[0m
|
||||
> %s foo.cpp 'make -j4' foo
|
||||
""" % ((os.path.basename(args[0]), ) * 4),
|
||||
|
||||
description=description,
|
||||
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
||||
)
|
||||
|
||||
parser.add_argument("cppfile", help="Name of file to modify.")
|
||||
|
||||
parser.add_argument("buildcmd", help="Build command")
|
||||
|
||||
parser.add_argument("execmd", help="Run command")
|
||||
|
||||
parser.add_argument("-v", "--verbose", action="store_true",
|
||||
help="Print extra information")
|
||||
|
||||
parser.add_argument("-s", "--start", type=int, default=1,
|
||||
help="Starting number of dupes")
|
||||
|
||||
parser.add_argument("-e", "--end", type=int, default=1000,
|
||||
help="Ending number of dupes")
|
||||
|
||||
parser.add_argument("-n", "--repeat", type=int, default=10,
|
||||
help="Number of times to repeat an individial execution. Best value will be taken.")
|
||||
|
||||
parser.add_argument("-t", "--template", action="store_true",
|
||||
help="Use templating instead of source copying to increase object size")
|
||||
|
||||
parser.add_argument("-c", "--csv", action="store_true",
|
||||
help="Print results as CSV")
|
||||
|
||||
args = parser.parse_args(args[1:])
|
||||
|
||||
if (args.verbose):
|
||||
global VERBOSE
|
||||
VERBOSE = True
|
||||
|
||||
return args.cppfile, args.buildcmd, args.execmd, args.start, args.end, args.repeat, args.template, args.csv
|
||||
|
||||
###############################################################################
|
||||
def verbose_print(msg, override=None):
|
||||
###############################################################################
|
||||
if ( (VERBOSE and not override is False) or override):
|
||||
print msg
|
||||
|
||||
###############################################################################
|
||||
def error_print(msg):
|
||||
###############################################################################
|
||||
print >> sys.stderr, msg
|
||||
|
||||
###############################################################################
|
||||
def expect(condition, error_msg):
|
||||
###############################################################################
|
||||
"""
|
||||
Similar to assert except doesn't generate an ugly stacktrace. Useful for
|
||||
checking user error, not programming error.
|
||||
"""
|
||||
if (not condition):
|
||||
raise SystemExit("FAIL: %s" % error_msg)
|
||||
|
||||
###############################################################################
|
||||
def run_cmd(cmd, ok_to_fail=False, input_str=None, from_dir=None, verbose=None,
|
||||
arg_stdout=subprocess.PIPE, arg_stderr=subprocess.PIPE):
|
||||
###############################################################################
|
||||
verbose_print("RUN: %s" % cmd, verbose)
|
||||
|
||||
if (input_str is not None):
|
||||
stdin = subprocess.PIPE
|
||||
else:
|
||||
stdin = None
|
||||
|
||||
proc = subprocess.Popen(cmd,
|
||||
shell=True,
|
||||
stdout=arg_stdout,
|
||||
stderr=arg_stderr,
|
||||
stdin=stdin,
|
||||
cwd=from_dir)
|
||||
output, errput = proc.communicate(input_str)
|
||||
output = output.strip() if output is not None else output
|
||||
stat = proc.wait()
|
||||
|
||||
if (ok_to_fail):
|
||||
return stat, output, errput
|
||||
else:
|
||||
if (arg_stderr is not None):
|
||||
errput = errput if errput is not None else open(arg_stderr.name, "r").read()
|
||||
expect(stat == 0, "Command: '%s' failed with error '%s'" % (cmd, errput))
|
||||
else:
|
||||
expect(stat == 0, "Command: '%s' failed. See terminal output" % cmd)
|
||||
return output
|
||||
|
||||
###############################################################################
|
||||
def build_and_run(source, cppfile, buildcmd, execmd, repeat):
|
||||
###############################################################################
|
||||
open(cppfile, 'w').writelines(source)
|
||||
|
||||
run_cmd(buildcmd)
|
||||
|
||||
best = None
|
||||
for i in xrange(repeat):
|
||||
wait_for_quiet_machine()
|
||||
output = run_cmd(execmd)
|
||||
|
||||
current = None
|
||||
fom_regex = re.compile(r'^FOM: ([0-9.]+)$')
|
||||
for line in output.splitlines():
|
||||
m = fom_regex.match(line)
|
||||
if (m is not None):
|
||||
current = float(m.groups()[0])
|
||||
break
|
||||
|
||||
expect(current is not None, "No lines in output matched FOM regex")
|
||||
|
||||
if (best is None or best < current):
|
||||
best = current
|
||||
|
||||
return best
|
||||
|
||||
###############################################################################
|
||||
def wait_for_quiet_machine():
|
||||
###############################################################################
|
||||
while(True):
|
||||
time.sleep(2)
|
||||
|
||||
# The first iteration of top gives garbage results
|
||||
idle_pct_raw = run_cmd("top -bn2 | grep 'Cpu(s)' | tr ',' ' ' | tail -n 1 | awk '{print $5}'")
|
||||
|
||||
idle_pct_re = re.compile(r'^([0-9.]+)%id$')
|
||||
m = idle_pct_re.match(idle_pct_raw)
|
||||
|
||||
expect(m is not None, "top not returning output in expected form")
|
||||
|
||||
idle_pct = float(m.groups()[0])
|
||||
if (idle_pct < 95):
|
||||
error_print("Machine is too busy, waiting for it to become free")
|
||||
else:
|
||||
break
|
||||
|
||||
###############################################################################
|
||||
def add_n_dupes(curr_lines, num_dupes, template):
|
||||
###############################################################################
|
||||
function_name = None
|
||||
function_invocation = None
|
||||
function_lines = []
|
||||
|
||||
function_re = re.compile(r'^.* (\w+) *[(]')
|
||||
function_inv_re = re.compile(r'^.*JGF_DUPE: +(.+)$')
|
||||
|
||||
# Get function lines
|
||||
record = False
|
||||
definition_insertion_point = None
|
||||
invocation_insertion_point = None
|
||||
for idx, line in enumerate(curr_lines):
|
||||
if ("JGF_DUPLICATE_BEGIN" in line):
|
||||
record = True
|
||||
m = function_re.match(curr_lines[idx+1])
|
||||
expect(m is not None, "Could not find function in line '%s'" % curr_lines[idx+1])
|
||||
function_name = m.groups()[0]
|
||||
|
||||
elif ("JGF_DUPLICATE_END" in line):
|
||||
record = False
|
||||
definition_insertion_point = idx + 1
|
||||
|
||||
elif (record):
|
||||
function_lines.append(line)
|
||||
|
||||
elif ("JGF_DUPE" in line):
|
||||
m = function_inv_re.match(line)
|
||||
expect(m is not None, "Could not find function invocation example in line '%s'" % line)
|
||||
function_invocation = m.groups()[0]
|
||||
invocation_insertion_point = idx + 1
|
||||
|
||||
expect(function_name is not None, "Could not find name of dupe function")
|
||||
expect(function_invocation is not None, "Could not find function invocation point")
|
||||
|
||||
expect(definition_insertion_point < invocation_insertion_point, "fix me")
|
||||
|
||||
dupe_func_defs = []
|
||||
dupe_invocations = ["int jgf_rand = std::rand();\n", "if (false) {}\n"]
|
||||
|
||||
for i in xrange(num_dupes):
|
||||
if (not template):
|
||||
dupe_func = list(function_lines)
|
||||
dupe_func[0] = dupe_func[0].replace(function_name, "%s%d" % (function_name, i))
|
||||
dupe_func_defs.extend(dupe_func)
|
||||
|
||||
dupe_invocations.append("else if (jgf_rand == %d) " % i)
|
||||
if (template):
|
||||
dupe_call = function_invocation.replace(function_name, "%s<%d>" % (function_name, i)) + "\n"
|
||||
else:
|
||||
dupe_call = function_invocation.replace(function_name, "%s%d" % (function_name, i)) + "\n"
|
||||
dupe_invocations.append(dupe_call)
|
||||
|
||||
curr_lines[invocation_insertion_point:invocation_insertion_point] = dupe_invocations
|
||||
curr_lines[definition_insertion_point:definition_insertion_point] = dupe_func_defs
|
||||
|
||||
###############################################################################
|
||||
def report(num_dupes, curr_lines, object_file, orig_fom, curr_fom, csv=False, is_first_report=False):
|
||||
###############################################################################
|
||||
fom_change = (curr_fom - orig_fom) / orig_fom
|
||||
|
||||
if (csv):
|
||||
if (is_first_report):
|
||||
print "num_dupes, obj_byte_size, loc, fom, pct_diff"
|
||||
|
||||
print "%s, %s, %s, %s, %s" % (num_dupes, os.path.getsize(object_file), len(curr_lines), curr_fom, fom_change*100)
|
||||
else:
|
||||
print "========================================================"
|
||||
print "For number of dupes:", num_dupes
|
||||
print "Object file size (bytes):", os.path.getsize(object_file)
|
||||
print "Lines of code:", len(curr_lines)
|
||||
print "Field of merit:", curr_fom
|
||||
print "Change pct:", fom_change*100
|
||||
|
||||
###############################################################################
|
||||
def obj_size_opt_check(cppfile, buildcmd, execmd, start, end, repeat, template, csv=False):
|
||||
###############################################################################
|
||||
orig_source_lines = open(cppfile, 'r').readlines()
|
||||
|
||||
backup_file = "%s.orig" % cppfile
|
||||
object_file = "%s.o" % os.path.splitext(cppfile)[0]
|
||||
os.rename(cppfile, backup_file)
|
||||
|
||||
orig_fom = build_and_run(orig_source_lines, cppfile, buildcmd, execmd, repeat)
|
||||
report(0, orig_source_lines, object_file, orig_fom, orig_fom, csv=csv, is_first_report=True)
|
||||
|
||||
i = start
|
||||
while (i < end):
|
||||
curr_lines = list(orig_source_lines)
|
||||
add_n_dupes(curr_lines, i, template)
|
||||
|
||||
curr_fom = build_and_run(curr_lines, cppfile, buildcmd, execmd, repeat)
|
||||
|
||||
report(i, curr_lines, object_file, orig_fom, curr_fom, csv=csv)
|
||||
|
||||
i *= 2 # make growth function configurable?
|
||||
|
||||
os.remove(cppfile)
|
||||
os.rename(backup_file, cppfile)
|
||||
|
||||
###############################################################################
|
||||
def _main_func(description):
|
||||
###############################################################################
|
||||
if ("--test" in sys.argv):
|
||||
test_results = doctest.testmod(verbose=True)
|
||||
sys.exit(1 if test_results.failed > 0 else 0)
|
||||
|
||||
cppfile, buildcmd, execmd, start, end, repeat, template, csv = parse_command_line(sys.argv, description)
|
||||
|
||||
obj_size_opt_check(cppfile, buildcmd, execmd, start, end, repeat, template, csv)
|
||||
|
||||
###############################################################################
|
||||
if (__name__ == "__main__"):
|
||||
_main_func(__doc__)
|
||||
Reference in New Issue
Block a user