Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 24

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