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