Skip to content

Commit

Permalink
Added option to specify underlying OMPI compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
Heinrich-BR committed Dec 17, 2024
1 parent 98681e3 commit 7e55f47
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions scripts/build-platypus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ parse_options() {
-c=* | --compiler=*)
COMPILERS+=("${arg#*=}")
;;
-mpicxx=* | --ompi-cxx=*)
OMPICXX="${arg#*=}"
;;
-mpicc=* | --ompi-cc=*)
OMPICC="${arg#*=}"
;;
*)
OTHER_ARGUMENTS+=("${arg}")
;;
Expand All @@ -52,6 +58,8 @@ export_config_file() {
printf 'GPU_BACKEND = %s\n' "${GPU_BACKEND}"
printf 'GPU_ARCH = %s\n' "${GPU_ARCH}"
printf 'CPU_TARGET = %s\n\n' "${CPU_TARGET}"
printf 'OMPI_CXX = %s\n' "${OMPICXX}"
printf 'OMPI_CC = %s\n\n' "${OMPICC}"
} >> ${CONFIG_FILE}

}
Expand Down Expand Up @@ -234,12 +242,16 @@ set_environment_vars() {
export CPPFLAGS="${CPPFLAGS} -I${TIRPC_DIR}/include/tirpc"
export LDFLAGS="${LDFLAGS} -L${TIRPC_DIR}/lib"

if [[ ${GPU_BUILD} -eq 1 && ${GPU_BACKEND} == "rocm" ]]; then
OMPI_CXX=$(spack location -i llvm-amdgpu)/bin/amdclang++
OMPI_CC=$(spack location -i llvm-amdgpu)/bin/amdclang
else
if [ -z "${OMPICXX}" ]; then
OMPI_CXX=clang++
else
OMPI_CXX=${OMPICXX}
fi

if [ -z "${OMPICC}" ]; then
OMPI_CC=clang
else
OMPI_CC=${OMPICC}
fi

export OMPI_CXX
Expand Down Expand Up @@ -350,6 +362,8 @@ GPU_BUILD=0
GPU_BACKEND=""
GPU_ARCH=""
CPU_TARGET=""
OMPICXX=""
OMPICC=""
PACKAGES=()
COMPILERS=()
OTHER_ARGUMENTS=()
Expand Down

0 comments on commit 7e55f47

Please sign in to comment.