Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 10

Matt Copper, 09/15/2016 02:07 PM

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
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 8 Ted Sume
    for i in cmap fancybox fancyvrb framed epstopdf framed mdwtools multirow newfloat parskip \
140 1 Redmine Admin
pdftex revtex4 titlesec threeparttable url wrapfig courier ec helvetic palatino; do
141
     tlmgr install $i
142
    done
143
~~~~~~
144
145
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.
146
147
## Fedora
148
149
The following packages are needed for Fedora
150
151
~~~~~~
152
   bison
153
   glib2-devel
154
   gstreamer-devel
155
   gstreamer-plugins-base-devel
156
   libxml2-devel
157 2 Matt Copper
   openssl-devel
158 1 Redmine Admin
   zlib-devel
159
   patch
160
~~~~~~
161
162
If you cannot install in the system area, bilder/extras/gstreamer.sh may
163
be modified to do what you need.
164
165 9 David Alexander
You may also need
166
167
~~~~~~
168
   libblas-devel
169
   lapack-devel
170
~~~~~~
171
172 1 Redmine Admin
## Ubuntu
173
174
The following packages are needed for Ubuntu
175
176
~~~~~~
177
   ace-netsvcs
178
   bison
179
   flex
180
   gfortran
181
   graphviz
182
   graphviz-dev
183
   heirloom-mailx
184
   libblas-dev
185
   libfreetype6-dev
186
   libgl1-mesa-dev
187
   libglu1-mesa-dev
188
   liblapack-dev
189
   libntlm0
190
   libpng12-dev
191
   libxext-dev
192
   libxrender-dev
193
   libxtst-dev
194
   libzzip-dev
195
   mailutils
196
   python2.6
197
   python2.6-dev
198
   vim
199
   zlib-dev
200
~~~~~~
201
202
The use of the following commands are helpful. To search for an available package dealing with a keyword, use:
203
204
~~~~~~
205
    $ sudo apt-cache search keyword
206
~~~~~~
207
208
To install a particular package, use:
209
210
~~~~~~
211
    $ sudo apt-get install libblah-dev
212
~~~~~~
213
214
Note: that development packages names typically end with "dev" not "devel" as in other flavors of linux.
215
216
## Suse Linux Enterprise Server (SLES)
217
218
The following packages are needed on SLES
219
220
~~~~~~
221
   bison
222
   blas-devel
223
   blas-devel-static
224
   libblas3
225
   flex
226
   freetype2-devel
227
   gcc
228
   gcc-32bit
229
   gcc-fortran
230
   git
231
   glibc-devel
232
   glibc-devel-32bit
233
   graphviz
234
   graphviz-devel
235
   gstreamer-0_10-devel
236
   gstreamer-0_10-plugins-base-devel
237
   lapack-devel
238
   lapack-devel-static
239
   liblapack3
240
   libapr-util1 (needed to build subversion)
241
   libapr1      (needed to build subversion)
242
   libneon27    (needed to build subversion)
243
   libpng-devel
244
   libssh-devel
245
   libxml2-devel
246
   mailx
247
   mercurial
248
   Mesa-devel
249
   python-devel
250
   xorg-x11-devel
251
   xorg-x11-libXext-devel
252
   xorg-x11-libXrender-devel
253
   xorg-x11-libs
254
   zlib-devel
255
~~~~~~
256
257
To get blas-devel, blas-devel-static and lapack-devel, lapack-devel-static on SLES 11 SP3 , add the Science repository
258
259
~~~~~~
260
   zypper addrepo http://download.opensuse.org/repositories/science/SLE_11_SP3/science.repo
261
   zypper refresh
262
   zypper install blas-devel blas-devel-static lapack-devel lapack-devel-static
263
~~~~~~
264
265
## Vendor-specific version of graphics driver
266
267
If you are preparing a Linux machine for the VisIt Visualization package, the vendor-specific graphics driver for your graphics card should be installed.
268
269
By default, a generic graphics driver is installed.  On Fedora, the generic driver is "nouveau".
270
271
To determine if the nouveau driver is installed on your system, enter the command
272
273
~~~~~~
274
     lsmod | grep nouv
275
~~~~~~
276
277
You will need to download and install the appropriate driver from your graphics card vendor.  This generally uninstalls the nouveau drivers.
278 3 Matt Copper
279 4 Matt Copper
## NVIDIA CUDA Toolkit
280 3 Matt Copper
281
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 
282
283
~~~~~~
284
     https://developer.nvidia.com/cuda-toolkit-70
285
~~~~~~
286
287
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. 
288
289
~~~~~~
290
     cd <location of download>
291
     sudo rpm -i cuda-repo-fedora21-7-0-local-7.0-28.x86_64.rpm   #<or whatever file you downloaded> 
292
     sudo dnf install cuda
293
~~~~~~
294
295 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:
296 3 Matt Copper
297
~~~~~~
298
     which nvcc
299
~~~~~~
300
301
The output should be /usr/local/cuda-7.0/bin/nvcc. This will allow bilder to build GPU c++ code.