Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 39

John Cary, 02/14/2018 02:26 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 1 Redmine Admin
10 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.
11
12
## Java
13
14
At least one package (Babel) needs Oracle's java, so we recommend installing it.
15
16 1 Redmine Admin
## GCC
17 15 John Cary
18 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 ]].
19 1 Redmine Admin
20 36 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)? ]]
21 1 Redmine Admin
22
### Make sure 32bit glibc-devel is installed
23
24
~~~~~~
25
yum -y install glibc-devel.i686
26 22 John Cary
dnf -y install glibc-devel.i686
27 1 Redmine Admin
zypper install glibc-devel-32bit  (SLES 11 SP3)
28
~~~~~~
29
30 28 John Cary
### Get and unpack the source package
31 1 Redmine Admin
32
~~~~~~
33 25 John Cary
export GCCVER=6.4.0
34 1 Redmine Admin
wget ftp://ftp.gnu.org/gnu/gcc/gcc-${GCCVER}/gcc-${GCCVER}.tar.xz
35 33 Jonathan Smith
tar xf gcc-${GCCVER}.tar.xz && cd gcc-${GCCVER}
36 1 Redmine Admin
~~~~~~
37
38 28 John Cary
### Patch as needed
39
40
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
41
42
~~~~~~
43
for i in libgcc/config/*/linux-unwind.h; do
44
  if grep -q "struct ucontext" $i; then
45
    sed -i.bak 's/struct ucontext/ucontext_t/' $i
46
  fi
47
done
48
~~~~~~
49
50 1 Redmine Admin
### Build
51
52
Define CONTRIB_DIR to be your tarball installation directory, e.g.,
53
54
~~~~~~
55
export CONTRIB_DIR=/contrib
56
~~~~~~
57
58
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:
59
60
~~~~~~
61
mkdir /internal /contrib /volatile
62
chmod 775 /internal /contrib /volatile
63
~~~~~~
64
65
Unpack gcc, go into the gcc source directory, and build according to the instructions below.
66
67
**gcc:**
68
69 22 John Cary
~~~~~~
70 1 Redmine Admin
./contrib/download_prerequisites
71
mkdir build && cd build
72 25 John Cary
../configure --prefix=$CONTRIB_DIR/gcc-${GCCVER} --enable-languages=c,c++,fortran --with-pic
73 1 Redmine Admin
env LD_RUN_PATH=$CONTRIB_DIR/gcc-${GCCVER}/lib64 make -j 4
74
make install
75
# Alias as desired.
76
mkdir -p $CONTRIB_DIR/bin && cd $CONTRIB_DIR/bin
77
ln -s $CONTRIB_DIR/gcc-${GCCVER}/bin/{c,g}* .
78
~~~~~~
79
80
### Fix permissions
81
82
~~~~~~
83
chmod -R g+rwX $CONTRIB_DIR/gcc-${GCCVER}
84
chmod -R o+rX $CONTRIB_DIR/gcc-${GCCVER}
85
find $CONTRIB_DIR/gcc-${GCCVER} -type d -exec chmod g+rs '{}' \;
86
~~~~~~
87
88
## Java
89
90
Install Oracle's Java.
91
92
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:
93
94
~~~~~~
95
for i in java jar javac; do
96
  alternatives --install /usr/bin/$i j$i /usr/java/jdk1.6.0_16/bin/$i 3
97
done
98
alternatives --config java # Pick 3
99
~~~~~~
100
101
On SLES , Install using the tar package from Oracle, then change into the installation directory
102
103
~~~~~~
104
for i in java jar javac; do
105
  /usr/sbin/update-alternatives --install /usr/bin/$i $i <installation directory>/bin/$i 3
106
done
107
~~~~~~
108
109
where <installation directory\> is the absolute path to where Java was just installed  
110
111
## Version control systems
112
113
Make sure git, mercurial, and subversion are all installed.
114
115
## LaTeX
116
117
Install the texlive-latex package. You may need to install other packages over time. For gui usage, see texworks: http://www.tug.org/texworks
118
119
If you cannot install in the system area, you can download
120
121
~~~~~~
122
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz
123
tar xzf install-tl-unx.tar.gz
124
cd install-tl-20150411 (date might be different)
125
./install-tl -no-gui
126
~~~~~~
127
128
This is now interactive, so set
129 11 Matt Copper
 
130 10 Matt Copper
* Set scheme to basic
131
** To do this type 'S' and hit enter.
132
** Then enter 'd' to set the scheme to basic.
133
** Type 'R' and hit enter to return to the main configuration page.
134 1 Redmine Admin
135 10 Matt Copper
* Set TEXDIR = $CONTRIB_DIR/texlive
136
** Start by typing 'D' and hit enter.
137
** Then enter '1' to change TEXDIR.
138
** Type $CONTRIB_DIR/texlive and hit return.
139
** To return to configuration type 'R' and return.
140 1 Redmine Admin
141 10 Matt Copper
* Set page size to Letter size
142
** Type 'O' and hit enter.
143
** Enter 'P'
144
** Return to main menu by typing 'R' and enter. 
145
146
* Install
147
** Type 'I' and hit enter to install.
148
149
* Put your texlive in your PATH.
150
** Edit you bashrc (vim ~/.bashrc)
151
** Add "export PATH=$PATH:<$CONTRIB_DIR>/texlive/bin/x86_64-linux/" (enter the full CONTRIB_DIR value)
152
** Exit and save. Then source ~/.bashrc.
153
154
To ensure you are using the correct texlive installation type "which pdflatex" and make sure it 
155
the one in $CONTRIB_DIR/texlive/bin/x86_64-linux/. If it is not the correct pdflatex, you may
156
have to remove the system version (sudo yum remove texlive). 
157 1 Redmine Admin
158
and then
159
160
~~~~~~
161 38 John Cary
tlmgr install breakurl capt-of cmap comment courier ec eepic environ epstopdf eqparbox \
162
fancybox fancyvrb framed footnote fricychap gensymb helvetic latexmk lineno mdwtools mmap \
163 39 John Cary
mptopdf multirow needspace newfloat overpic palatino parskip pdftex pifont revtex4 siunitx subfiles \
164
symbol tabulary threeparttable titlesec trimspaces txfonts units upquote ur  varwidth wrapfig \
165 38 John Cary
xcite xcolor xypic zapfding
166 1 Redmine Admin
~~~~~~
167 12 John Cary
168 38 John Cary
You may also want to install some of the fonts, 
169
~~~~~~
170
tlmgr install  avantgar bookman charter cmextra courier euro-ce eurosym marvosym mathpazo \
171
ncntrsbk pxfonts rsfs symbol times txfonts utopia wasy zapfchan zapfding
172
~~~~~~
173 1 Redmine Admin
174 25 John Cary
## Additional packages
175 1 Redmine Admin
176 25 John Cary
Other parts of the toolchain introduce other package requirements.  Below are the initial lists.
177
178 24 John Cary
### Fedora
179
180 1 Redmine Admin
The following packages are needed for Fedora
181
182
~~~~~~
183 19 John Cary
  bison
184
  glib2-devel
185
  libxml2-devel
186
  openssl-devel
187
  zlib-devel
188
  patch
189 1 Redmine Admin
~~~~~~
190
191 9 David Alexander
You may also need
192
193 1 Redmine Admin
~~~~~~
194 19 John Cary
  libblas-devel
195
  lapack-devel
196 9 David Alexander
~~~~~~
197
198
For more recent versions of Fedora, you will need.
199 18 John Cary
200
~~~~~~
201 19 John Cary
  egl-wayland
202
  mesa-libEGL-devel
203 18 John Cary
  redhat-rpm-config
204 1 Redmine Admin
~~~~~~
205 18 John Cary
206 24 John Cary
### Ubuntu
207 1 Redmine Admin
208
The following packages are needed for Ubuntu
209
210
~~~~~~
211
   ace-netsvcs
212
   bison
213
   flex
214
   gfortran
215
   graphviz
216
   graphviz-dev
217
   heirloom-mailx
218
   libblas-dev
219
   libfreetype6-dev
220
   libgl1-mesa-dev
221
   libglu1-mesa-dev
222
   liblapack-dev
223
   libntlm0
224
   libpng12-dev
225
   libxext-dev
226
   libxrender-dev
227
   libxtst-dev
228
   libzzip-dev
229
   mailutils
230
   python2.6
231
   python2.6-dev
232 14 Jonathan Smith
   zlib-dev *
233 1 Redmine Admin
~~~~~~
234 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" 
235
* zlib-dev doesn't exist on ubuntu 16.04 - use zlib1g-dev instead.
236
237
mailutils is necessary for configuring the system for jenkins. 
238
You'll be offered to choose:
239
* Internet site
240
* Internet with smarthost
241
* Satellite system
242
* Local only
243
244
Internet with smarthost is recommended.
245
246 1 Redmine Admin
247
The use of the following commands are helpful. To search for an available package dealing with a keyword, use:
248
249
~~~~~~
250
    $ sudo apt-cache search keyword
251
~~~~~~
252
253
To install a particular package, use:
254
255
~~~~~~
256
    $ sudo apt-get install libblah-dev
257
~~~~~~
258
259
Note: that development packages names typically end with "dev" not "devel" as in other flavors of linux.
260
261 24 John Cary
### Suse Linux Enterprise Server (SLES)
262 1 Redmine Admin
263
The following packages are needed on SLES
264
265
~~~~~~
266
   bison
267
   blas-devel
268
   blas-devel-static
269
   libblas3
270
   flex
271
   freetype2-devel
272
   gcc
273
   gcc-32bit
274
   gcc-fortran
275
   git
276
   glibc-devel
277
   glibc-devel-32bit
278
   graphviz
279
   graphviz-devel
280
   gstreamer-0_10-devel
281
   gstreamer-0_10-plugins-base-devel
282 13 David Alexander
   libbz2-devel
283 1 Redmine Admin
   lapack-devel
284
   lapack-devel-static
285
   liblapack3
286
   libapr-util1 (needed to build subversion)
287
   libapr1      (needed to build subversion)
288
   libneon27    (needed to build subversion)
289
   libpng-devel
290
   libssh-devel
291
   libxml2-devel
292
   mailx
293
   mercurial
294
   Mesa-devel
295
   python-devel
296
   xorg-x11-devel
297
   xorg-x11-libXext-devel
298
   xorg-x11-libXrender-devel
299
   xorg-x11-libs
300
   zlib-devel
301
~~~~~~
302
303
To get blas-devel, blas-devel-static and lapack-devel, lapack-devel-static on SLES 11 SP3 , add the Science repository
304
305
~~~~~~
306
   zypper addrepo http://download.opensuse.org/repositories/science/SLE_11_SP3/science.repo
307
   zypper refresh
308
   zypper install blas-devel blas-devel-static lapack-devel lapack-devel-static
309
~~~~~~
310 24 John Cary
311 1 Redmine Admin
## Qt Prerequisites
312
313 25 John Cary
Qt-5 must be built with QtWebEngine, which particularly introduces requirements for other packages as noted at
314 24 John Cary
315 25 John Cary
* https://doc.qt.io/qt-5.10/qtwebengine-platform-notes.html
316
* https://wiki.qt.io/QtWebEngine/How_to_Try
317
* https://www.ics.com/blog/building-qtwebengine
318
* http://www.linuxfromscratch.org/blfs/view/svn/x/qtwebengine.html
319 24 John Cary
320 25 John Cary
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.
321
322 24 John Cary
### Fedora
323
324
~~~~~~
325 37 John Cary
sudo yum install alsa-lib-devel cups-devel bison flex fontconfig-devel gperf libicu-devel
326 27 John Cary
sudo yum install libcap-devel libgcrypt-devel libgcrypt libgudev1-devel libsndfile-devel libwebp-devel
327
sudo yum install libXcomposite-devel libXcursor-devel libXi-devel libXrandr-devel libxslt-devel libXtst-devel
328
sudo yum install mesa-libEGL-devel nss-devel opus-devel pciutils-devel pulseaudio-libs-devel re2c ruby systemd-devel
329 1 Redmine Admin
~~~~~~
330
331
## Vendor-specific version of graphics driver
332
333
If you are preparing a Linux machine for the VisIt Visualization package, the vendor-specific graphics driver for your graphics card should be installed.
334
335
By default, a generic graphics driver is installed.  On Fedora, the generic driver is "nouveau".
336
337
To determine if the nouveau driver is installed on your system, enter the command
338
339
~~~~~~
340
     lsmod | grep nouv
341
~~~~~~
342
343
You will need to download and install the appropriate driver from your graphics card vendor.  This generally uninstalls the nouveau drivers.
344 3 Matt Copper
345 4 Matt Copper
## NVIDIA CUDA Toolkit
346 3 Matt Copper
347
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 
348
349
~~~~~~
350
     https://developer.nvidia.com/cuda-toolkit-70
351
~~~~~~
352
353
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. 
354
355
~~~~~~
356
     cd <location of download>
357
     sudo rpm -i cuda-repo-fedora21-7-0-local-7.0-28.x86_64.rpm   #<or whatever file you downloaded> 
358
     sudo dnf install cuda
359
~~~~~~
360
361 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:
362 3 Matt Copper
363
~~~~~~
364
     which nvcc
365
~~~~~~
366 23 John Cary
The output should be /usr/local/cuda-7.0/bin/nvcc. This will allow bilder to build GPU c++ code.
367 31 Jonathan Smith
368
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 ]]