-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcmake-3.7.2_install_deb8.sh
More file actions
61 lines (45 loc) · 1.25 KB
/
cmake-3.7.2_install_deb8.sh
File metadata and controls
61 lines (45 loc) · 1.25 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/bash
# this script dies with memory allocation errors on qubeshub debian 7 containers
# and as before I don't care I'm installing on debian 8
# show commands being run
set -x
# Fail script on error.
set -e
pkgname=cmake
VERSION=3.7.2
basedir=/apps/share64/debian8
pkginstalldir=${basedir}/${pkgname}
tarinstalldir=${pkginstalldir}/tars
installprefix=${pkginstalldir}/${VERSION}
tarfilename=${pkgname}-${VERSION}.tar.gz
tardirbase=${pkgname}-${VERSION}
downloaduri=https://cmake.org/files/v3.7/${tarfilename}
environdir=${basedir}/environ.d
cpucount=`cat /proc/cpuinfo | grep processor | wc -l`
if [[ ! -d ${pkginstalldir}/tars ]] ; then
mkdir -p ${pkginstalldir}/tars
fi
cd ${pkginstalldir}/tars
if [[ ! -e ${tarfilename} ]] ; then
wget ${downloaduri} -v -O ${tarfilename}
fi
rm -rf ${tardirbase}
tar xvzf ${tarfilename}
cd ${tardirbase}
./bootstrap --prefix=${installprefix}
make -j${cpucount}
make install
if [[ ! -d ${environdir} ]] ; then
mkdir ${environdir}
fi
cat <<- _END_ > ${environdir}/${pkgname}-${VERSION}
conflict CMAKE_CHOICE
desc "CMAKE ${VERSION}"
help "the cross-platform, open-source build system"
version=${VERSION}
location=${pkginstalldir}/\${version}
prepend PATH \${location}/bin
tags MATHSCI
_END_
echo "all done"
exit 0