Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 55

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