forked from awslabs/libfabric-ci-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-libfabric.sh
35 lines (34 loc) · 1.37 KB
/
install-libfabric.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
echo "==> Building libfabric"
# Pulls the libfabric repository and checks out the pull request commit
cd ${HOME}
git clone https://github.com/libfabric-test1/libfabric
cd ${HOME}/libfabric
if [ ! "$PULL_REQUEST_ID" = "None" ]; then
git fetch origin +refs/pull/$PULL_REQUEST_ID/*:refs/remotes/origin/pr/$PULL_REQUEST_ID/*
git checkout $PULL_REQUEST_REF -b PRBranch
fi
./autogen.sh
configure_flags=(--prefix=${HOME}/libfabric/install/ \
--enable-debug \
--enable-mrail \
--enable-tcp \
--enable-rxm \
--disable-rxd \
--disable-verbs \
--enable-efa )
# Build libfabric with cuda on x86_64 platform only.
if [ "$(uname -m)" == "x86_64" ]; then
with_cuda_option_available="$(./configure -h 2>&1 | grep '\-\-with\-cuda' || true)"
enable_cuda_dlopen_option_available="$(./configure -h 2>&1 | grep '\-\-enable\-cuda\-dlopen' || true)"
if [[ -n "$with_cuda_option_available" && -n "$enable_cuda_dlopen_option_available" ]]; then
configure_flags+=(--with-cuda=/usr/local/cuda --enable-cuda-dlopen)
fi
fi
./configure "${configure_flags[@]}"
make -j 4
make install
LIBFABRIC_INSTALL_PATH=${HOME}/libfabric/install
# ld.so.conf.d files are preferred in alphabetical order
# this doesn't seem to be working for non-interactive shells
sudo bash -c "echo ${LIBFABRIC_INSTALL_PATH} > /etc/ld.so.conf.d/aaaa-libfabric-testing.sh"