Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 14

Jonathan Smith, 04/14/2017 04:03 AM

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