Skip to content

Commit 9cd2adc

Browse files
committed
Add script to print dependency info
1 parent bf439d3 commit 9cd2adc

File tree

1 file changed

+161
-0
lines changed

1 file changed

+161
-0
lines changed

tools/scripts/deps_info

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Print dependency information.
4+
#
5+
# Usage: deps_info
6+
#
7+
8+
# FUNCTIONS #
9+
10+
# Prints usage information.
11+
usage() {
12+
echo '' >&2
13+
echo 'Usage: deps_info' >&2
14+
echo '' >&2
15+
}
16+
17+
# MAIN #
18+
19+
CLANG=$(which clang 2>/dev/null)
20+
echo '-----'
21+
echo 'clang:' >&2
22+
echo '' >&2
23+
if [[ -x "${CLANG}" ]]; then
24+
"${CLANG}" --version >&2
25+
else
26+
echo 'Unable to detect clang.' >&2
27+
fi
28+
echo '' >&2
29+
30+
CMAKE=$(which cmake 2>/dev/null)
31+
echo '-----'
32+
echo 'CMake:' >&2
33+
echo '' >&2
34+
if [[ -x "${CMAKE}" ]]; then
35+
"${CMAKE}" --version >&2
36+
else
37+
echo 'Unable to detect CMake.' >&2
38+
fi
39+
echo '' >&2
40+
41+
GCC=$(which gcc 2>/dev/null)
42+
echo '-----'
43+
echo 'gcc:' >&2
44+
echo '' >&2
45+
if [[ -x "${GCC}" ]]; then
46+
"${GCC}" --version >&2
47+
else
48+
echo 'Unable to detect gcc.' >&2
49+
fi
50+
echo '' >&2
51+
52+
GFORTRAN=$(which gfortran 2>/dev/null)
53+
echo '-----'
54+
echo 'gfortran:' >&2
55+
echo '' >&2
56+
if [[ -x "${GFORTRAN}" ]]; then
57+
"${GFORTRAN}" --version >&2
58+
else
59+
echo 'Unable to detect gfortran.' >&2
60+
fi
61+
echo '' >&2
62+
63+
GIT=$(which git 2>/dev/null)
64+
echo '-----'
65+
echo 'git:' >&2
66+
echo '' >&2
67+
if [[ -x "${GIT}" ]]; then
68+
"${GIT}" --version >&2
69+
else
70+
echo 'Unable to detect git.' >&2
71+
fi
72+
echo '' >&2
73+
74+
GNU_MAKE=$(which make 2>/dev/null)
75+
echo '-----'
76+
echo 'GNU make:' >&2
77+
echo '' >&2
78+
if [[ -x "${GNU_MAKE}" ]]; then
79+
"${GNU_MAKE}" --version >&2
80+
else
81+
echo 'Unable to detect GNU make.' >&2
82+
fi
83+
echo '' >&2
84+
85+
GPP=$(which g++ 2>/dev/null)
86+
echo '-----'
87+
echo 'g++:' >&2
88+
echo '' >&2
89+
if [[ -x "${GPP}" ]]; then
90+
"${GPP}" --version >&2
91+
else
92+
echo 'Unable to detect g++.' >&2
93+
fi
94+
echo '' >&2
95+
96+
JULIA=$(which julia 2>/dev/null)
97+
echo '-----'
98+
echo 'Julia:' >&2
99+
echo '' >&2
100+
if [[ -x "${JULIA}" ]]; then
101+
"${JULIA}" --version >&2
102+
else
103+
echo 'Unable to detect Julia.' >&2
104+
fi
105+
echo '' >&2
106+
107+
NODEJS=$(which node 2>/dev/null)
108+
echo '-----'
109+
echo 'Node.js:' >&2
110+
echo '' >&2
111+
if [[ -x "${NODEJS}" ]]; then
112+
"${NODEJS}" --version >&2
113+
else
114+
echo 'Unable to detect Node.js.' >&2
115+
fi
116+
echo '' >&2
117+
118+
NPM=$(which npm 2>/dev/null)
119+
echo '-----'
120+
echo 'npm:' >&2
121+
echo '' >&2
122+
if [[ -x "${NPM}" ]]; then
123+
"${NPM}" --version >&2
124+
else
125+
echo 'Unable to detect npm.' >&2
126+
fi
127+
echo '' >&2
128+
129+
PANDOC=$(which pandoc 2>/dev/null)
130+
echo '-----'
131+
echo 'pandoc:' >&2
132+
echo '' >&2
133+
if [[ -x "${PANDOC}" ]]; then
134+
"${PANDOC}" -v >&2
135+
else
136+
echo 'Unable to detect pandoc.' >&2
137+
fi
138+
echo '' >&2
139+
140+
PYTHON=$(which python 2>/dev/null)
141+
echo '-----'
142+
echo 'Python:' >&2
143+
echo '' >&2
144+
if [[ -x "${PYTHON}" ]]; then
145+
"${PYTHON}" --version >&2
146+
else
147+
echo 'Unable to detect Python.' >&2
148+
fi
149+
echo '' >&2
150+
151+
R=$(which r 2>/dev/null)
152+
echo '-----'
153+
echo 'R:' >&2
154+
echo '' >&2
155+
if [[ -x "${R}" ]]; then
156+
"${R}" --version >&2
157+
else
158+
echo 'Unable to detect R.' >&2
159+
fi
160+
echo '' >&2
161+

0 commit comments

Comments
 (0)