Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 9

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