Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 69

David Alexander, 05/14/2020 10:49 AM

1 1 Redmine Admin
# Preparing a Linux machine for Bilder
2
3 15 John Cary
__If all you need is python and sphinx__ (e.g., for builds of documentation), then you need only
4 1 Redmine Admin
5 15 John Cary
* CMake (probably present)
6
* Python (probably present)
7 16 Ted Sume
* Python-dev or Python-devel (on Fedora)
8 15 John Cary
* Latex as installed below
9 53 John Cary
* Perl-dev or Perl-devel with perl-ExtUtils-Embed
10 1 Redmine Admin
11 15 John Cary
and then you can add the arguments,  -W python,cmake, and your installed Python and CMake will be used if your path is correct.
12
13
## Java
14
15
At least one package (Babel) needs Oracle's java, so we recommend installing it.
16
17 1 Redmine Admin
## GCC
18 15 John Cary
19 32 Jonathan Smith
It is often useful to get a newer gcc that has mmintrinsics. This may break compatibility with some versions of [[ CUDAgccCompatibility | CUDA ]].
20 1 Redmine Admin
21 57 John Cary
Below are the instructions for building gcc-8.3.0. [[ BilderKnownIssuesGcc730 | (As of this writing, 8.3 is the latest compiler to work with CUDA-10.2, and gcc-5.3.1 will not build QT-5.10.0) ]]
22 1 Redmine Admin
23
### Make sure 32bit glibc-devel is installed
24 42 John Cary
25
Do the applicable of
26 1 Redmine Admin
27
~~~~~~
28
yum -y install glibc-devel.i686
29 22 John Cary
dnf -y install glibc-devel.i686
30 1 Redmine Admin
zypper install glibc-devel-32bit  (SLES 11 SP3)
31
~~~~~~
32
33 28 John Cary
### Get and unpack the source package
34 1 Redmine Admin
35
~~~~~~
36 56 John Cary
export GCCVER=8.3.0
37 1 Redmine Admin
wget ftp://ftp.gnu.org/gnu/gcc/gcc-${GCCVER}/gcc-${GCCVER}.tar.xz
38 33 Jonathan Smith
tar xf gcc-${GCCVER}.tar.xz && cd gcc-${GCCVER}
39 1 Redmine Admin
~~~~~~
40
41 28 John Cary
### Patch as needed
42
43
If your system has glibc 2.26 or later, you will need to fix the source by making the changes specified in  https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=72edc2c02f8b4768ad660f46a1c7e2400c0a8e06 and also
44
45
~~~~~~
46
for i in libgcc/config/*/linux-unwind.h; do
47
  if grep -q "struct ucontext" $i; then
48
    sed -i.bak 's/struct ucontext/ucontext_t/' $i
49
  fi
50
done
51
~~~~~~
52
53 1 Redmine Admin
### Build
54
55
Define CONTRIB_DIR to be your tarball installation directory, e.g.,
56
57
~~~~~~
58
export CONTRIB_DIR=/contrib
59
~~~~~~
60
61
Usually CONTRIB_DIR=/contrib, but if one does not have root access, one has to put this in a user area. If one does have root access, one should execute the following commands:
62
63
~~~~~~
64
mkdir /internal /contrib /volatile
65
chmod 775 /internal /contrib /volatile
66
~~~~~~
67
68
Unpack gcc, go into the gcc source directory, and build according to the instructions below.
69
70
**gcc:**
71
72 68 John Cary
You may need to set some addition options, e.g., ```ADDLOPTS=--with-cpu=power9``` on linuxppc64le.
73
74 22 John Cary
~~~~~~
75 1 Redmine Admin
./contrib/download_prerequisites
76
mkdir build && cd build
77 68 John Cary
../configure --prefix=$CONTRIB_DIR/gcc-${GCCVER} --enable-languages=c,c++,fortran --with-pic $ADDLOPTS
78 1 Redmine Admin
env LD_RUN_PATH=$CONTRIB_DIR/gcc-${GCCVER}/lib64 make -j 4
79
make install
80
# Alias as desired.
81
mkdir -p $CONTRIB_DIR/bin && cd $CONTRIB_DIR/bin
82
ln -s $CONTRIB_DIR/gcc-${GCCVER}/bin/{c,g}* .
83
~~~~~~
84
85
### Fix permissions
86
87
~~~~~~
88
chmod -R g+rwX $CONTRIB_DIR/gcc-${GCCVER}
89
chmod -R o+rX $CONTRIB_DIR/gcc-${GCCVER}
90
find $CONTRIB_DIR/gcc-${GCCVER} -type d -exec chmod g+rs '{}' \;
91
~~~~~~
92
93
## Java
94
95
Install Oracle's Java.
96
97
Once it is installed, you will need to modify your path to include /usr/java/default/bin before /usr/bin or use the alternatives package:
98
99
~~~~~~
100
for i in java jar javac; do
101
  alternatives --install /usr/bin/$i j$i /usr/java/jdk1.6.0_16/bin/$i 3
102
done
103
alternatives --config java # Pick 3
104
~~~~~~
105
106
On SLES , Install using the tar package from Oracle, then change into the installation directory
107
108
~~~~~~
109
for i in java jar javac; do
110
  /usr/sbin/update-alternatives --install /usr/bin/$i $i <installation directory>/bin/$i 3
111
done
112
~~~~~~
113
114
where <installation directory\> is the absolute path to where Java was just installed  
115
116
## Version control systems
117
118
Make sure git, mercurial, and subversion are all installed.
119
120 49 Nathan Neri
For building VisIt, install git large file storage: https://git-lfs.github.com/
121 54 Nathan Neri
Download the tarball from that site, untar, and run
122
123
~~~~~~
124
git lfs install --force --skip-smudge
125
~~~~~~
126 49 Nathan Neri
127 1 Redmine Admin
## LaTeX
128
129 46 John Cary
LaTeX is needed for building documentation using Sphinx.
130 1 Redmine Admin
131 46 John Cary
Bilder prefers the texlive-latex package. For gui usage, see texworks: http://www.tug.org/texworks
132
133 1 Redmine Admin
If you cannot install in the system area, you can download
134
135
~~~~~~
136
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
137
tar xzf install-tl-unx.tar.gz
138
cd install-tl-20150411 (date might be different)
139
./install-tl -no-gui
140
~~~~~~
141
142
This is now interactive, so set
143 11 Matt Copper
 
144 10 Matt Copper
* Set scheme to basic
145
** To do this type 'S' and hit enter.
146
** Then enter 'd' to set the scheme to basic.
147
** Type 'R' and hit enter to return to the main configuration page.
148 1 Redmine Admin
149 10 Matt Copper
* Set TEXDIR = $CONTRIB_DIR/texlive
150
** Start by typing 'D' and hit enter.
151
** Then enter '1' to change TEXDIR.
152
** Type $CONTRIB_DIR/texlive and hit return.
153
** To return to configuration type 'R' and return.
154 1 Redmine Admin
155 10 Matt Copper
* Set page size to Letter size
156
** Type 'O' and hit enter.
157
** Enter 'P'
158
** Return to main menu by typing 'R' and enter. 
159
160
* Install
161
** Type 'I' and hit enter to install.
162
163
* Put your texlive in your PATH.
164
** Edit you bashrc (vim ~/.bashrc)
165
** Add "export PATH=$PATH:<$CONTRIB_DIR>/texlive/bin/x86_64-linux/" (enter the full CONTRIB_DIR value)
166
** Exit and save. Then source ~/.bashrc.
167
168
To ensure you are using the correct texlive installation type "which pdflatex" and make sure it 
169
the one in $CONTRIB_DIR/texlive/bin/x86_64-linux/. If it is not the correct pdflatex, you may
170 1 Redmine Admin
have to remove the system version (sudo yum remove texlive). 
171 38 John Cary
172 46 John Cary
and then install the packages noted at
173 45 John Cary
174 46 John Cary
[[LaTeX packages needed by Bilder]]
175 38 John Cary
176 1 Redmine Admin
177 25 John Cary
## Additional packages
178 1 Redmine Admin
179 25 John Cary
Other parts of the toolchain introduce other package requirements.  Below are the initial lists.
180
181 61 Nathan Neri
### Fedora / Redhat / CentOS
182 24 John Cary
183 44 John Cary
The following packages (cut and paste after dnf install or yum install) are needed for Fedora, Redhat, CentOS
184 1 Redmine Admin
185 40 John Cary
~~~~~~
186 69 David Alexander
bc bison git-lfs glib2-devel imake krb5-devel lapack-devel blas-devel blas-static libcurl-devel libxkbcommon-devel libxkbcommon-x11-devel libxml2-devel openssl-devel patch redhat-lsb zlib-devel libXt-devel
187 40 John Cary
~~~~~~
188 9 David Alexander
189
For more recent versions of Fedora, you will need.
190 40 John Cary
191
~~~~~~
192 43 John Cary
egl-wayland mesa-libEGL-devel redhat-rpm-config
193 18 John Cary
~~~~~~
194 1 Redmine Admin
195 47 David Alexander
For centos7 you will also need.
196
197
~~~~~~
198 62 John Cary
imake xorg-x11-utils
199 1 Redmine Admin
~~~~~~
200 61 Nathan Neri
201
and to build Qt 5 for VisIt you will need.
202 1 Redmine Admin
203 61 Nathan Neri
~~~~~~
204 62 John Cary
libxcb-devel xcb-util-renderutil-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel xcb-util-devel xcb-util-cursor-devel
205 61 Nathan Neri
~~~~~~
206
207 47 David Alexander
208 18 John Cary
### Ubuntu
209 24 John Cary
210 1 Redmine Admin
The following packages are needed for Ubuntu
211
212
~~~~~~
213 48 Benjamin Cowan
ace-netsvcs
214
bc
215 1 Redmine Admin
bison
216 48 Benjamin Cowan
flex
217
gfortran
218
graphviz
219
libblas-dev
220
libfreetype6-dev
221
libgl1-mesa-dev
222
libglu1-mesa-dev
223
libgraphviz-dev
224
liblapack-dev
225
libntlm0
226
libpng-dev
227
libxext-dev
228
libxrender-dev
229
libxtst-dev
230
libzzip-dev
231
mailutils
232
python2.7
233
python2.7-dev
234
zlib1g-dev
235 1 Redmine Admin
~~~~~~
236 14 Jonathan Smith
* You will probably want a lightweight command line editor other than gedit, so "sudo apt-get install vim"  or "sudo apt-get install emacs" 
237
* zlib-dev doesn't exist on ubuntu 16.04 - use zlib1g-dev instead.
238
239 1 Redmine Admin
mailutils is necessary for configuring the system for jenkins. 
240 14 Jonathan Smith
You'll be offered to choose:
241
* Internet site
242
* Internet with smarthost
243
* Satellite system
244 1 Redmine Admin
* Local only
245 14 Jonathan Smith
246
Internet with smarthost is recommended.
247 1 Redmine Admin
248 14 Jonathan Smith
249 1 Redmine Admin
The use of the following commands are helpful. To search for an available package dealing with a keyword, use:
250
251
~~~~~~
252
$ sudo apt-cache search keyword
253
~~~~~~
254
255
To install a particular package, use:
256
257
~~~~~~
258
$ sudo apt-get install libblah-dev
259
~~~~~~
260
261
Note: that development packages names typically end with "dev" not "devel" as in other flavors of linux.
262
263
### Suse Linux Enterprise Server (SLES)
264
265 43 John Cary
The following packages (in cut/paste for zypper form) are needed on SLES
266 1 Redmine Admin
267
~~~~~~
268 43 John Cary
bc bison blas-devel blas-devel-static libblas3 flex freetype2-devel
269
gcc gcc-32bit gcc-fortran git glibc-devel glibc-devel-32bit
270
graphviz graphviz-devel libbz2-devel lapack-devel lapack-devel-static liblapack3 libpng-devel libssh-devel libxml2-devel
271
mailx mercurial Mesa-devel python-devel
272
xorg-x11-devel xorg-x11-libXext-devel xorg-x11-libXrender-devel xorg-x11-libs zlib-devel
273 1 Redmine Admin
~~~~~~
274 43 John Cary
275
The following are needed to build subversion
276
277
~~~~~~
278
libapr-util1 libapr1 libneon27
279
~~~~~~
280
281 1 Redmine Admin
282
To get blas-devel, blas-devel-static and lapack-devel, lapack-devel-static on SLES 11 SP3 , add the Science repository
283
284
~~~~~~
285 40 John Cary
zypper addrepo http://download.opensuse.org/repositories/science/SLE_11_SP3/science.repo
286
zypper refresh
287
zypper install blas-devel blas-devel-static lapack-devel lapack-devel-static
288 1 Redmine Admin
~~~~~~
289 24 John Cary
290 1 Redmine Admin
## Qt Prerequisites
291
292 25 John Cary
Qt-5 must be built with QtWebEngine, which particularly introduces requirements for other packages as noted at
293 24 John Cary
294 25 John Cary
* https://doc.qt.io/qt-5.10/qtwebengine-platform-notes.html
295
* https://wiki.qt.io/QtWebEngine/How_to_Try
296
* https://www.ics.com/blog/building-qtwebengine
297
* http://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
298
299
Each of the above websites appears to have made assumptions about what is already installed, so as one encounters more workstations, one is likely to find yet another package missing.  This is our list so far.
300 1 Redmine Admin
301 24 John Cary
### Fedora
302
303
~~~~~~
304 41 John Cary
sudo yum install alsa-lib-devel bison cups-devel dbus-devel flex fontconfig-devel gperf libicu-devel
305 64 John Cary
sudo yum install libcap-devel libgcrypt-devel libgcrypt libgudev1-devel libsndfile-devel libstdc++-static libwebp-devel
306 27 John Cary
sudo yum install libXcomposite-devel libXcursor-devel libXi-devel libXrandr-devel libxslt-devel libXtst-devel
307 1 Redmine Admin
sudo yum install mesa-libEGL-devel nss-devel opus-devel pciutils-devel pulseaudio-libs-devel re2c ruby systemd-devel
308
~~~~~~
309
310
## Vendor-specific version of graphics driver
311
312
If you are preparing a Linux machine for the VisIt Visualization package, the vendor-specific graphics driver for your graphics card should be installed.
313
314
By default, a generic graphics driver is installed.  On Fedora, the generic driver is "nouveau".
315
316
To determine if the nouveau driver is installed on your system, enter the command
317
318
~~~~~~
319 40 John Cary
lsmod | grep nouv
320 1 Redmine Admin
~~~~~~
321
322
You will need to download and install the appropriate driver from your graphics card vendor.  This generally uninstalls the nouveau drivers.
323 3 Matt Copper
324 4 Matt Copper
## NVIDIA CUDA Toolkit
325 3 Matt Copper
326
If you have a compatible GPU and wish to compile with nvcc code, you must first install the CUDA Toolkit. The linux installation page is 
327
328
~~~~~~
329 40 John Cary
https://developer.nvidia.com/cuda-toolkit-70
330 3 Matt Copper
~~~~~~
331
332
Download the applicable file. Your Linux distribution may or may not be natively supported for version 7.0. You may alternatively use version 7.5 if supported or an older version if necessary. As an example, we will include the steps known to work for Fedora 22. On Fedora 22, download the Fedora 21 Local RPM package. 
333
334
~~~~~~
335 40 John Cary
cd <location of download>
336
sudo rpm -i cuda-repo-fedora21-7-0-local-7.0-28.x86_64.rpm   #<or whatever file you downloaded> 
337
sudo dnf install cuda
338 3 Matt Copper
~~~~~~
339
340 5 Matt Copper
Different Linux distributions will have different package handlers (here we use dnf, ubuntu has apt-get, fedora < 22 uses yum). You should now have the directory /usr/local/cuda-7.0. Add /usr/local/cuda-7.0/bin to your path. To ensure you have gotten the necessary components, type:
341 3 Matt Copper
342
~~~~~~
343 40 John Cary
which nvcc
344 3 Matt Copper
~~~~~~
345 23 John Cary
The output should be /usr/local/cuda-7.0/bin/nvcc. This will allow bilder to build GPU c++ code.
346 31 Jonathan Smith
347
IMPORTANT NOTE: CUDA versions only support particular GCC versions, and the latest GCC may not support your CUDA.[[ CUDAgccCompatibility | See this wiki page for details ]]