Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 82

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