Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 81

David Alexander, 08/03/2024 01:13 PM

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 77 John Cary
Below are the instructions for building gcc
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 78 John Cary
export GCCVER=11.2.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 77 John Cary
No patching needs known as of now.
44 28 John Cary
45 1 Redmine Admin
### Build
46
47 72 John Cary
Define GCC_INSTS_DIR to be your tarball installation directory, e.g.,
48 1 Redmine Admin
49
~~~~~~
50 72 John Cary
export GCC_INSTS_DIR=/contrib
51 1 Redmine Admin
~~~~~~
52
53 72 John Cary
Usually GCC_INSTS_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:
54 1 Redmine Admin
55
~~~~~~
56
mkdir /internal /contrib /volatile
57
chmod 775 /internal /contrib /volatile
58
~~~~~~
59
60
Unpack gcc, go into the gcc source directory, and build according to the instructions below.
61
62
**gcc:**
63
64 78 John Cary
You may need to set some addition options, e.g., 
65
* ```ADDLOPTS=--with-cpu=power9``` on linuxppc64le
66
* ```ADDLOPTS=--disable-multilib``` if 32bit glibc libraries are not installed.
67 68 John Cary
68 22 John Cary
~~~~~~
69 1 Redmine Admin
./contrib/download_prerequisites
70
mkdir build && cd build
71 72 John Cary
../configure --prefix=$GCC_INSTS_DIR/gcc-${GCCVER} --enable-languages=c,c++,fortran --with-pic $ADDLOPTS
72
env LD_RUN_PATH=$GCC_INSTS_DIR/gcc-${GCCVER}/lib64 make -j 4
73 1 Redmine Admin
make install
74 75 John Cary
chmod -R a+rX $GCC_INSTS_DIR/gcc-${GCCVER} # Perms issues seen in 9.4.0: 9.4.0/include-fixed/openssl/bn.h
75 1 Redmine Admin
# Alias as desired.
76 72 John Cary
mkdir -p $GCC_INSTS_DIR/bin && cd $GCC_INSTS_DIR/bin
77
ln -s $GCC_INSTS_DIR/gcc-${GCCVER}/bin/{c,g}* .
78 1 Redmine Admin
~~~~~~
79
80
### Fix permissions
81
82
~~~~~~
83 80 John Cary
chown -R root:root $GCC_INSTS_DIR/gcc-${GCCVER}
84 72 John Cary
chmod -R g+rwX $GCC_INSTS_DIR/gcc-${GCCVER}
85
chmod -R o+rX $GCC_INSTS_DIR/gcc-${GCCVER}
86
find $GCC_INSTS_DIR/gcc-${GCCVER} -type d -exec chmod g+rs '{}' \;
87 1 Redmine Admin
~~~~~~
88
89 73 Seth Veitzer
90
## Python
91
92
For Python 3
93
94
On Linux, libffi must be installed at the system level in order to properly get ctypes.
95
96
~~~~~~
97
sudo yum -y install libffi-devel
98
~~~~~~
99
100 74 Seth Veitzer
Qt requires Python 2 to build webengine for Chromium, expected through release 5.16 at least. The Qt configure system (perl) looks for the executable "python2" in PATH, and if not found looks for executable "python". Thus Python 2 needs to be installed on the build system and in the PATH in order to build Composer.
101
102 1 Redmine Admin
## Java
103
104
Install Oracle's Java.
105
106
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:
107
108
~~~~~~
109
for i in java jar javac; do
110
  alternatives --install /usr/bin/$i j$i /usr/java/jdk1.6.0_16/bin/$i 3
111
done
112
alternatives --config java # Pick 3
113
~~~~~~
114
115
On SLES , Install using the tar package from Oracle, then change into the installation directory
116
117
~~~~~~
118
for i in java jar javac; do
119
  /usr/sbin/update-alternatives --install /usr/bin/$i $i <installation directory>/bin/$i 3
120
done
121
~~~~~~
122
123
where <installation directory\> is the absolute path to where Java was just installed  
124
125
## Version control systems
126
127
Make sure git, mercurial, and subversion are all installed.
128
129 49 Nathan Neri
For building VisIt, install git large file storage: https://git-lfs.github.com/
130 54 Nathan Neri
Download the tarball from that site, untar, and run
131
132
~~~~~~
133
git lfs install --force --skip-smudge
134
~~~~~~
135 49 Nathan Neri
136 1 Redmine Admin
## LaTeX
137
138 46 John Cary
LaTeX is needed for building documentation using Sphinx.
139 1 Redmine Admin
140 46 John Cary
Bilder prefers the texlive-latex package. For gui usage, see texworks: http://www.tug.org/texworks
141
142 1 Redmine Admin
If you cannot install in the system area, you can download
143
144
~~~~~~
145
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
146
tar xzf install-tl-unx.tar.gz
147 76 John Cary
cd install-tl-20230412 (date might be different)
148 1 Redmine Admin
./install-tl -no-gui
149
~~~~~~
150
151
This is now interactive, so set
152 11 Matt Copper
 
153 10 Matt Copper
* Set scheme to basic
154
** To do this type 'S' and hit enter.
155
** Then enter 'd' to set the scheme to basic.
156
** Type 'R' and hit enter to return to the main configuration page.
157 1 Redmine Admin
158 10 Matt Copper
* Set TEXDIR = $CONTRIB_DIR/texlive
159
** Start by typing 'D' and hit enter.
160
** Then enter '1' to change TEXDIR.
161
** Type $CONTRIB_DIR/texlive and hit return.
162
** To return to configuration type 'R' and return.
163 1 Redmine Admin
164 10 Matt Copper
* Set page size to Letter size
165
** Type 'O' and hit enter.
166
** Enter 'P'
167
** Return to main menu by typing 'R' and enter. 
168
169
* Install
170
** Type 'I' and hit enter to install.
171
172
* Put your texlive in your PATH.
173
** Edit you bashrc (vim ~/.bashrc)
174
** Add "export PATH=$PATH:<$CONTRIB_DIR>/texlive/bin/x86_64-linux/" (enter the full CONTRIB_DIR value)
175
** Exit and save. Then source ~/.bashrc.
176
177
To ensure you are using the correct texlive installation type "which pdflatex" and make sure it 
178
the one in $CONTRIB_DIR/texlive/bin/x86_64-linux/. If it is not the correct pdflatex, you may
179 1 Redmine Admin
have to remove the system version (sudo yum remove texlive). 
180 38 John Cary
181 46 John Cary
and then install the packages noted at
182 45 John Cary
183 46 John Cary
[[LaTeX packages needed by Bilder]]
184 38 John Cary
185 81 David Alexander
## Language Local
186
187
The txbase unit tests need a german local package. It can be generated by the command:
188
189
~~~~~~~
190
sudo locale-gen de_DE.UTF-8
191
~~~~~~~
192 1 Redmine Admin
193 25 John Cary
## Additional packages
194 1 Redmine Admin
195 25 John Cary
Other parts of the toolchain introduce other package requirements.  Below are the initial lists.
196
197 61 Nathan Neri
### Fedora / Redhat / CentOS
198 24 John Cary
199 44 John Cary
The following packages (cut and paste after dnf install or yum install) are needed for Fedora, Redhat, CentOS
200 1 Redmine Admin
201 40 John Cary
~~~~~~
202 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
203 40 John Cary
~~~~~~
204 9 David Alexander
205
For more recent versions of Fedora, you will need.
206 40 John Cary
207
~~~~~~
208 43 John Cary
egl-wayland mesa-libEGL-devel redhat-rpm-config
209 18 John Cary
~~~~~~
210 1 Redmine Admin
211 47 David Alexander
For centos7 you will also need.
212
213
~~~~~~
214 62 John Cary
imake xorg-x11-utils
215 1 Redmine Admin
~~~~~~
216 61 Nathan Neri
217
and to build Qt 5 for VisIt you will need.
218 1 Redmine Admin
219 61 Nathan Neri
~~~~~~
220 71 Ted Sume
dbus-devel nss-devel gperf 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
221 61 Nathan Neri
~~~~~~
222
223 47 David Alexander
224 18 John Cary
### Ubuntu
225 24 John Cary
226 1 Redmine Admin
The following packages are needed for Ubuntu
227
228
~~~~~~
229 48 Benjamin Cowan
ace-netsvcs
230
bc
231 1 Redmine Admin
bison
232 48 Benjamin Cowan
flex
233
gfortran
234
graphviz
235
libblas-dev
236
libfreetype6-dev
237
libgl1-mesa-dev
238
libglu1-mesa-dev
239
libgraphviz-dev
240
liblapack-dev
241
libntlm0
242
libpng-dev
243
libxext-dev
244
libxrender-dev
245
libxtst-dev
246
libzzip-dev
247
mailutils
248
python2.7
249
python2.7-dev
250
zlib1g-dev
251 1 Redmine Admin
~~~~~~
252 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" 
253
* zlib-dev doesn't exist on ubuntu 16.04 - use zlib1g-dev instead.
254
255 1 Redmine Admin
mailutils is necessary for configuring the system for jenkins. 
256 14 Jonathan Smith
You'll be offered to choose:
257
* Internet site
258
* Internet with smarthost
259
* Satellite system
260 1 Redmine Admin
* Local only
261 14 Jonathan Smith
262
Internet with smarthost is recommended.
263 1 Redmine Admin
264 14 Jonathan Smith
265 1 Redmine Admin
The use of the following commands are helpful. To search for an available package dealing with a keyword, use:
266
267
~~~~~~
268
$ sudo apt-cache search keyword
269
~~~~~~
270
271
To install a particular package, use:
272
273
~~~~~~
274
$ sudo apt-get install libblah-dev
275
~~~~~~
276
277
Note: that development packages names typically end with "dev" not "devel" as in other flavors of linux.
278
279
### Suse Linux Enterprise Server (SLES)
280
281 43 John Cary
The following packages (in cut/paste for zypper form) are needed on SLES
282 1 Redmine Admin
283
~~~~~~
284 43 John Cary
bc bison blas-devel blas-devel-static libblas3 flex freetype2-devel
285
gcc gcc-32bit gcc-fortran git glibc-devel glibc-devel-32bit
286
graphviz graphviz-devel libbz2-devel lapack-devel lapack-devel-static liblapack3 libpng-devel libssh-devel libxml2-devel
287
mailx mercurial Mesa-devel python-devel
288
xorg-x11-devel xorg-x11-libXext-devel xorg-x11-libXrender-devel xorg-x11-libs zlib-devel
289 1 Redmine Admin
~~~~~~
290 43 John Cary
291
The following are needed to build subversion
292
293
~~~~~~
294
libapr-util1 libapr1 libneon27
295
~~~~~~
296
297 1 Redmine Admin
298
To get blas-devel, blas-devel-static and lapack-devel, lapack-devel-static on SLES 11 SP3 , add the Science repository
299
300
~~~~~~
301 40 John Cary
zypper addrepo http://download.opensuse.org/repositories/science/SLE_11_SP3/science.repo
302
zypper refresh
303
zypper install blas-devel blas-devel-static lapack-devel lapack-devel-static
304 1 Redmine Admin
~~~~~~
305 24 John Cary
306 1 Redmine Admin
## Qt Prerequisites
307
308 25 John Cary
Qt-5 must be built with QtWebEngine, which particularly introduces requirements for other packages as noted at
309 24 John Cary
310 25 John Cary
* https://doc.qt.io/qt-5.10/qtwebengine-platform-notes.html
311
* https://wiki.qt.io/QtWebEngine/How_to_Try
312
* https://www.ics.com/blog/building-qtwebengine
313
* http://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
314
315
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.
316 1 Redmine Admin
317 24 John Cary
### Fedora
318
319
~~~~~~
320 41 John Cary
sudo yum install alsa-lib-devel bison cups-devel dbus-devel flex fontconfig-devel gperf libicu-devel
321 64 John Cary
sudo yum install libcap-devel libgcrypt-devel libgcrypt libgudev1-devel libsndfile-devel libstdc++-static libwebp-devel
322 27 John Cary
sudo yum install libXcomposite-devel libXcursor-devel libXi-devel libXrandr-devel libxslt-devel libXtst-devel
323 1 Redmine Admin
sudo yum install mesa-libEGL-devel nss-devel opus-devel pciutils-devel pulseaudio-libs-devel re2c ruby systemd-devel
324
~~~~~~
325
326
## Vendor-specific version of graphics driver
327
328
If you are preparing a Linux machine for the VisIt Visualization package, the vendor-specific graphics driver for your graphics card should be installed.
329
330
By default, a generic graphics driver is installed.  On Fedora, the generic driver is "nouveau".
331
332
To determine if the nouveau driver is installed on your system, enter the command
333
334
~~~~~~
335 40 John Cary
lsmod | grep nouv
336 1 Redmine Admin
~~~~~~
337
338
You will need to download and install the appropriate driver from your graphics card vendor.  This generally uninstalls the nouveau drivers.
339 3 Matt Copper
340 4 Matt Copper
## NVIDIA CUDA Toolkit
341 3 Matt Copper
342
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 
343
344
~~~~~~
345 40 John Cary
https://developer.nvidia.com/cuda-toolkit-70
346 3 Matt Copper
~~~~~~
347
348
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. 
349
350
~~~~~~
351 40 John Cary
cd <location of download>
352
sudo rpm -i cuda-repo-fedora21-7-0-local-7.0-28.x86_64.rpm   #<or whatever file you downloaded> 
353
sudo dnf install cuda
354 3 Matt Copper
~~~~~~
355
356 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:
357 3 Matt Copper
358
~~~~~~
359 40 John Cary
which nvcc
360 3 Matt Copper
~~~~~~
361 23 John Cary
The output should be /usr/local/cuda-7.0/bin/nvcc. This will allow bilder to build GPU c++ code.
362 31 Jonathan Smith
363
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 ]]