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