Skip to content

Commit

Permalink
some progress on build stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierson T. Guthrey authored and pguthrey committed Dec 30, 2024
1 parent 2fcd22e commit 1e63f6a
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
29 changes: 29 additions & 0 deletions host-configs/lanl-builds/nvcc_gcc_X.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
###############################################################################
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and RAJA project contributors. See the RAJA/LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

set(RAJA_COMPILER "RAJA_COMPILER_CLANG" CACHE STRING "")

set(CMAKE_CXX_FLAGS_RELEASE "-O3 -march=native -funroll-loops -finline-functions" CACHE STRING "")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -march=native -funroll-loops -finline-functions" CACHE STRING "")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g" CACHE STRING "")

set(HOST_OPT_FLAGS "-Xcompiler -O3 -Xcompiler -fopenmp")

set(CMAKE_THREAD_LIBS_INIT "-lpthread")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(CMAKE_HAVE_THREADS_LIBRARY 1)
set(CMAKE_USE_WIN32_THREADS_INIT 0)
set(CMAKE_USE_PTHREADS_INIT 1)
set(THREADS_PREFER_PTHREAD_FLAG ON)

set(CMAKE_CUDA_FLAGS_RELEASE "-O3 ${HOST_OPT_FLAGS}" CACHE STRING "")
set(CMAKE_CUDA_FLAGS_DEBUG "-g -G -O0" CACHE STRING "")
set(CMAKE_CUDA_FLAGS_RELWITHDEBINFO "-g -lineinfo -O3 ${HOST_OPT_FLAGS}" CACHE STRING "")

set(RAJA_DATA_ALIGN 64 CACHE STRING "")

set(RAJA_HOST_CONFIG_LOADED On CACHE BOOL "")
67 changes: 67 additions & 0 deletions scripts/lanl-builds/cray_nvcc_gcc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/usr/bin/env bash

###############################################################################
# Copyright (c) 2016-24, Lawrence Livermore National Security, LLC
# and RAJA project contributors. See the RAJA/LICENSE file for details.
#
# SPDX-License-Identifier: (BSD-3-Clause)
###############################################################################

if [[ $# -lt 3 ]]; then
echo
echo "You must pass 3 arguments to the script (in this order): "
echo " 1) compiler version number for nvcc"
echo " 2) CUDA compute architecture (number only, not 'sm_90' for example)"
echo " 3) compiler version number for gcc"
echo
echo "For example: "
echo " cray_nvcc_gcc.sh 12.5 90 12.3.0"
exit
fi

COMP_NVCC_VER=$1
COMP_ARCH=$2
COMP_GCC_VER=$3
shift 3

BUILD_SUFFIX=lanl_cray-nvcc${COMP_NVCC_VER}-${COMP_ARCH}-gcc${COMP_GCC_VER}

echo
echo "Creating build directory build_${BUILD_SUFFIX} and generating configuration in it"
echo "Configuration extra arguments:"
echo " $@"
echo

rm -rf build_${BUILD_SUFFIX} >/dev/null
mkdir build_${BUILD_SUFFIX} && cd build_${BUILD_SUFFIX}

module load cmake/3.29.6

cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/projects/hpcsoft/tce/24-07/cos3-aarch64-cc90/compilers/gcc/${COMP_GCC_VER}/bin/g++ \
-DBLT_CXX_STD=c++14 \
-Dgtest_disable_pthreads=ON \
-DGTEST_HAS_PTHREAD=0 \
-C ../host-configs/lanl-builds/cray/nvcc_gcc_X.cmake \
-DENABLE_OPENMP=Off \
-DENABLE_CUDA=On \
-DCUDA_TOOLKIT_ROOT_DIR=/opt/nvidia/hpc_sdk/Linux_aarch64/24.7/cuda \
-DCMAKE_CUDA_COMPILER=/opt/nvidia/hpc_sdk/Linux_aarch64/24.7/cuda/${COMP_NVCC_VER}/bin/nvcc \
-DCMAKE_CUDA_ARCHITECTURES=${COMP_ARCH} \
-DENABLE_BENCHMARKS=On \
-DCMAKE_INSTALL_PREFIX=../install_${BUILD_SUFFIX} \
"$@" \
..

echo
echo "***********************************************************************"
echo
echo "cd into directory build_${BUILD_SUFFIX} and run make to build RAJA"
echo
echo " Please note that you have to disable CUDA GPU hooks when you run"
echo " the RAJA tests; for example,"
echo
echo " lrun -1 --smpiargs="-disable_gpu_hooks" make test"
echo
echo "***********************************************************************"

0 comments on commit 1e63f6a

Please sign in to comment.