Project

General

Profile

Preparing a Linux machine for Bilder » History » Version 7

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