Skip to content

Commit

Permalink
avoid liburing dependency without --io-uring
Browse files Browse the repository at this point in the history
Upcoming PRs require liburing and a previous commit has added it as a
dependency during in `build.sh`. This commit avoids installing liburing
without specifying `--io-uring` when running `build.sh`. Additionally,
it sets `USE_IO_URING` which can be used in the code.
  • Loading branch information
philipportner committed Sep 19, 2024
1 parent 7f77edb commit 941b768
Showing 1 changed file with 28 additions and 18 deletions.
46 changes: 28 additions & 18 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function printHelp {
echo " --fpgaopencl Compile with support for Intel PAC D5005 FPGA"
echo " --mpi Compile with support for MPI"
echo " --hdfs Compile with support for HDFS"
echo " --io_uring Compile with support for io_uring"
echo " --no-papi Compile without support for PAPI"
}

Expand Down Expand Up @@ -451,6 +452,7 @@ BUILD_FPGAOPENCL="-DUSE_FPGAOPENCL=OFF"
BUILD_DEBUG="-DCMAKE_BUILD_TYPE=Release"
BUILD_MPI="-DUSE_MPI=OFF"
BUILD_HDFS="-DUSE_HDFS=OFF"
BUILD_IO_URING="-DUSE_IO_URING=OFF"
BUILD_PAPI="-DUSE_PAPI=ON"
WITH_DEPS=1
WITH_SUBMODULE_UPDATE=1
Expand Down Expand Up @@ -504,6 +506,10 @@ while [[ $# -gt 0 ]]; do
echo using HDFS
export BUILD_HDFS="-DUSE_HDFS=ON"
;;
--io-uring)
echo using io_uring
export BUILD_IO_URING="-DUSE_IO_URING=ON"
;;
--no-papi)
echo not using PAPI
export BUILD_PAPI="-DUSE_PAPI=OFF"
Expand Down Expand Up @@ -1035,25 +1041,29 @@ if [ $WITH_DEPS -gt 0 ]; then
liburingInstDirName=$installPrefix
liburing_cc=$([ "$CC" = "" ] && echo "gcc" || echo "$CC")
liburing_cxx=$([ "$CXX" = "" ] && echo "g++" || echo "$CXX")
if ! is_dependency_downloaded "liburing_v${liburingVersion}"; then
daphne_msg "Get liburing version ${liburingVersion}"
wget "https://github.com/axboe/liburing/archive/refs/tags/${liburingTarName}" \
-qO "${cacheDir}/${liburingTarName}"
mkdir "$sourcePrefix/$liburingDirName"
tar -xf "$cacheDir/$liburingTarName" -C "$sourcePrefix/$liburingDirName" --strip-components=1
dependency_download_success "liburing_v${liburingVersion}"
fi
if ! is_dependency_installed "liburing_v${liburingVersion}"; then
cd "$sourcePrefix/$liburingDirName"
./configure --cc="$liburing_cc" --cxx="$liburing_cxx" --prefix="$liburingInstDirName"
make -j"$(nproc)"
cp ./src/liburing.a "$installPrefix/lib/"
cp -r ./src/include/* "$installPrefix/include"
cd - > /dev/null
dependency_install_success "liburing_v${liburingVersion}"
else
daphne_msg "No need to build liburing again."

if [ $BUILD_IO_URING == "-DUSE_IO_URING=ON" ]; then
if ! is_dependency_downloaded "liburing_v${liburingVersion}"; then
daphne_msg "Get liburing version ${liburingVersion}"
wget "https://github.com/axboe/liburing/archive/refs/tags/${liburingTarName}" \
-qO "${cacheDir}/${liburingTarName}"
mkdir "$sourcePrefix/$liburingDirName"
tar -xf "$cacheDir/$liburingTarName" -C "$sourcePrefix/$liburingDirName" --strip-components=1
dependency_download_success "liburing_v${liburingVersion}"
fi
if ! is_dependency_installed "liburing_v${liburingVersion}"; then
cd "$sourcePrefix/$liburingDirName"
./configure --cc="$liburing_cc" --cxx="$liburing_cxx" --prefix="$liburingInstDirName"
make -j"$(nproc)"
cp ./src/liburing.a "$installPrefix/lib/"
cp -r ./src/include/* "$installPrefix/include"
cd - > /dev/null
dependency_install_success "liburing_v${liburingVersion}"
else
daphne_msg "No need to build liburing again."
fi
fi

#------------------------------------------------------------------------------
# 8.14 Fetch bitstreams
#------------------------------------------------------------------------------
Expand Down

0 comments on commit 941b768

Please sign in to comment.