forked from FAIR4HEP/hbb_interaction_network
-
Notifications
You must be signed in to change notification settings - Fork 4
/
install_xrootd.sh
33 lines (26 loc) · 743 Bytes
/
install_xrootd.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
#!/usr/bin/env bash
function setNumProcessors () {
# Set the number of processors used for build
# to be 1 less than are available
if [[ -f "$(which nproc)" ]]; then
NPROC="$(nproc)"
else
NPROC="$(grep -c '^processor' /proc/cpuinfo)"
fi
echo `expr "${NPROC}" - 1`
}
function main() {
cd /tmp
git clone https://github.com/xrootd/xrootd.git /tmp/xroot
mkdir build
cd build
printf "\n# cmake /tmp/xroot -DCMAKE_INSTALL_PREFIX=/opt/xrootd\n"
cmake /tmp/xroot \
-DCMAKE_INSTALL_PREFIX=/opt/xrootd
printf "\n# cmake --build . -- -j${NPROC}\n"
cmake --build . -- -j${NPROC}
printf "\n# make install\n"
make install
rm -rf /tmp/*
}
main "$@" || exit 1