Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 15

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