Skip to content

Commit

Permalink
[DAPHNE-#830] Clang option for build.sh
Browse files Browse the repository at this point in the history
This commit adds the convenience option to build with Clang to the build.sh script
  • Loading branch information
corepointer committed Oct 6, 2024
1 parent a12694e commit d286eff
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function printHelp {
echo " --hdfs Compile with support for HDFS"
echo " --io_uring Compile with support for io_uring"
echo " --no-papi Compile without support for PAPI"
echo " --clang Compile using Clang (instead of GCC)"
}

#******************************************************************************
Expand Down Expand Up @@ -456,6 +457,7 @@ BUILD_IO_URING="-DUSE_IO_URING=OFF"
BUILD_PAPI="-DUSE_PAPI=ON"
WITH_DEPS=1
WITH_SUBMODULE_UPDATE=1
WITH_CLANG=""

while [[ $# -gt 0 ]]; do
key=$1
Expand Down Expand Up @@ -528,6 +530,10 @@ while [[ $# -gt 0 ]]; do
-ns | --no-submodule-update)
WITH_SUBMODULE_UPDATE=0
;;
--clang)
echo "Compiling with Clang"
WITH_CLANG="-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++"
;;
*)
unknown_options="${unknown_options} ${key}"
;;
Expand Down Expand Up @@ -1109,7 +1115,7 @@ fi
daphne_msg "Build Daphne"

cmake -S "$projectRoot" -B "$daphneBuildDir" -G Ninja -DANTLR_VERSION="$antlrVersion" \
-DCMAKE_PREFIX_PATH="$installPrefix" \
-DCMAKE_PREFIX_PATH="$installPrefix" ${WITH_CLANG} \
$BUILD_CUDA $BUILD_FPGAOPENCL $BUILD_DEBUG $BUILD_MPI $BUILD_HDFS $BUILD_PAPI

cmake --build "$daphneBuildDir" --target "$target"
Expand Down

0 comments on commit d286eff

Please sign in to comment.