Debian Codegraph @

GUI/PWgui/doc/pwdocs/user_guide/node15.html

raw
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2
3 <!--Converted with LaTeX2HTML 2019.2 (Released June 5, 2019) -->
4 <HTML lang="EN">
5 <HEAD>
6 <TITLE>2.8 Installation tricks and problems</TITLE>
7 <META NAME="description" CONTENT="2.8 Installation tricks and problems">
8 <META NAME="keywords" CONTENT="user_guide">
9 <META NAME="resource-type" CONTENT="document">
10 <META NAME="distribution" CONTENT="global">
11
12 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
13 <META NAME="viewport" CONTENT="width=device-width, initial-scale=1.0">
14 <META NAME="Generator" CONTENT="LaTeX2HTML v2019.2">
15
16 <LINK REL="STYLESHEET" HREF="user_guide.css">
17
18 <LINK REL="next" HREF="node16.html">
19 <LINK REL="previous" HREF="node14.html">
20 <LINK REL="next" HREF="node16.html">
21 </HEAD>
22
23 <BODY >
24 <!--Navigation Panel-->
25 <A
26 HREF="node16.html">
27 <IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A>
28 <A
29 HREF="node7.html">
30 <IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A>
31 <A
32 HREF="node14.html">
33 <IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A>
34 <A ID="tex2html192"
35 HREF="node1.html">
36 <IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A>
37 <BR>
38 <B> Next:</B> <A
39 HREF="node16.html">2.9 Cray machines</A>
40 <B> Up:</B> <A
41 HREF="node7.html">2 Installation</A>
42 <B> Previous:</B> <A
43 HREF="node14.html">2.7 Running tests and</A>
44 <B> <A ID="tex2html193"
45 HREF="node1.html">Contents</A></B>
46 <BR>
47 <BR>
48 <!--End of Navigation Panel-->
49 <!--Table of Child-Links-->
50 <A ID="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
51
52 <UL>
53 <LI><A ID="tex2html194"
54 HREF="node15.html#SECTION00038100000000000000">2.8.1 All architectures</A>
55 <LI><A ID="tex2html195"
56 HREF="node15.html#SECTION00038200000000000000">2.8.2 Linux PC</A>
57 <UL>
58 <LI><A ID="tex2html196"
59 HREF="node15.html#SECTION00038210000000000000">2.8.2.1 Linux PCs with gfortran</A>
60 <LI><A ID="tex2html197"
61 HREF="node15.html#SECTION00038220000000000000">2.8.2.2 Linux PCs with Intel compiler (ifort)</A>
62 <LI><A ID="tex2html198"
63 HREF="node15.html#SECTION00038230000000000000">2.8.2.3 Linux PCs with MKL libraries</A>
64 <LI><A ID="tex2html199"
65 HREF="node15.html#SECTION00038240000000000000">2.8.2.4 Linux PCs with AMD processors</A>
66 </UL>
67 <BR>
68 <LI><A ID="tex2html200"
69 HREF="node15.html#SECTION00038300000000000000">2.8.3 Linux PC clusters with MPI</A>
70 <LI><A ID="tex2html201"
71 HREF="node15.html#SECTION00038400000000000000">2.8.4 Microsoft Windows</A>
72 <LI><A ID="tex2html202"
73 HREF="node15.html#SECTION00038500000000000000">2.8.5 Mac OS</A>
74 </UL>
75 <!--End of Table of Child-Links-->
76 <HR>
77
78 <H2><A ID="SECTION00038000000000000000">
79 2.8 Installation tricks and problems</A>
80 </H2>
81
82 <P>
83
84 <H3><A ID="SECTION00038100000000000000">
85 2.8.1 All architectures</A>
86 </H3>
87
88 <UL>
89 <LI>Working Fortran and C compilers, compliant with F2003 and C89 standards
90 (see Sec.<A HREF="node9.html#Sec:Installation">2.2</A>)
91 respectively, are needed in order to compile Q<SMALL>UANTUM </SMALL>ESPRESSO. Most recent Fortran
92 compilers will do the job.
93
94 <P>
95 C and Fortran compilers must be in your PATH.
96 If <TT>configure</TT> says that you have no working compiler, well,
97 you have no working compiler, at least not in your PATH, and
98 not among those recognized by <TT>configure</TT>.
99 </LI>
100 <LI>If you get <EM>Compiler Internal Error</EM> or similar messages: your
101 compiler version is buggy. Try to lower the optimization level, or to
102 remove optimization just for the routine that has problems. If it
103 doesn't work, or if you experience weird problems at run time, try to
104 install patches for your version of the compiler (most vendors release
105 at least a few patches for free), or to upgrade to a more recent
106 compiler version.
107 </LI>
108 <LI>If you get error messages at the loading phase that look like
109 <EM>file XYZ.o: unknown / not recognized/ invalid / wrong
110 file type / file format / module version</EM>,
111 one of the following things have happened:
112
113 <OL>
114 <LI>you have leftover object files from a compilation with another
115 compiler: run <TT>make clean</TT> and recompile.
116 </LI>
117 <LI><TT>make</TT> did not stop at the first compilation error (it may
118 happen in some software configurations). Remove the file *.o
119 that triggers the error message, recompile, look for a
120 compilation error.
121 </LI>
122 </OL>
123 If many symbols are missing in the loading phase: you did not specify the
124 location of all needed libraries (LAPACK, BLAS, FFTW, machine-specific
125 optimized libraries), in the needed order.
126 Note that Q<SMALL>UANTUM </SMALL>ESPRESSO is self-contained (with the exception of MPI libraries for
127 parallel compilation): if system libraries are missing, the problem is in
128 your compiler/library combination or in their usage, not in Q<SMALL>UANTUM </SMALL>ESPRESSO.
129 </LI>
130 <LI>If you get <EM>Segmentation fault</EM> or similar errors
131 in the provided tests and examples: your compiler, or
132 your mathematical libraries, or MPI libraries,
133 or a combination thereof, is buggy, or there is some
134 software incompatibility. Although one can never rule out
135 the presence of subtle bugs in Q<SMALL>UANTUM </SMALL>ESPRESSO that are not revealed during
136 the testing phase, it is very unlikely
137 that this happens on the provided tests and examples.
138 </LI>
139 <LI>If all test fails, look into the output and error files:
140 there is some dumb reason for failure.
141 </LI>
142 <LI>If most test pass but some fail, again: look into the output
143 and error files. A frequent source of trouble is complex function
144 <TT>zdotc</TT>. See the "Linux PCs with gfortran compilers" paragraph,
145 or replace <TT>zdotc</TT> with fortran intrinsic <TT>dot_product</TT>.
146 </LI>
147 </UL>
148
149 <P>
150
151 <H3><A ID="SECTION00038200000000000000">
152 2.8.2 Linux PC</A>
153 </H3>
154
155 <P>
156 Both AMD and Intel CPUs, 32-bit and 64-bit, are supported and work,
157 either in 32-bit emulation and in 64-bit mode. 64-bit executables
158 can address a much larger memory space than 32-bit executable, but
159 there is no gain in speed.
160 Beware: the default integer type for 64-bit machine is typically
161 32-bit long. You should be able to use 64-bit integers as well,
162 but it is not guaranteed to work and will not give
163 any advantage anyway.
164
165 <P>
166 Currently, <TT>configure</TT> supports Intel (ifort), NAG (nagfor), PGI (pgf90)
167 and gfortran compilers. Pathscale, Sun Studio, AMD Open64, are no
168 longer supported after v.6.2: g95, since v.6.1.
169
170 <P>
171 Both Intel MKL and AMD acml mathematical libraries are supported, the
172 former much better than the latter.
173
174 <P>
175 It is usually convenient to create semi-statically linked executables (with only
176 libc, libm, libpthread dynamically linked). If you want to produce a binary
177 that runs on different machines, compile it on the oldest machine you have
178 (i.e. the one with the oldest version of the operating system).
179
180 <P>
181
182 <H4><A ID="SECTION00038210000000000000">
183 2.8.2.1 Linux PCs with gfortran</A>
184 </H4>
185
186 <P>
187 Gfortran v.4.8.5, still often found on CentOS machines, no longer compiles
188 Q<SMALL>UANTUM </SMALL>ESPRESSO v.6.6 or later, due to a gfortran bug. You need at least gfortran v.4.9.X.
189
190 <P>
191 "There is a known incompatibility problem between different calling
192 convention for Fortran functions that return complex values [...]
193 If your code crashes during a call to <TT>zdotc</TT>,
194 recompile Q<SMALL>UANTUM </SMALL>ESPRESSO using the internal BLAS and LAPACK routines
195 (using <TT>configure</TT> options <TT>&ndash;with-internal-blas</TT> and
196 <TT>&ndash;with-internal-lapack</TT>)
197 to see if the problem disappears; or, add the <TT>-ff2c</TT> flag"
198 (info by Giovanni Pizzi, Jan. 2013).
199
200 <P>
201 If you want to use MKL libraries together with gfortran,
202 link <TT>-lmkl_gf_lp64</TT>, not <TT>-lmkl_intel_lp64</TT>
203 (and the like for other architectures).
204
205 <P>
206
207 <H4><A ID="SECTION00038220000000000000">
208 2.8.2.2 Linux PCs with Intel compiler (ifort)</A>
209 </H4>
210
211 <P>
212 IMPORTANT NOTE: ifort versions earlier than v.15 miscompile the new
213 XML code in QE v.6.4 and later. Please install this patch:
214 <BR><TT>https://gitlab.com/QEF/q-e/wikis/Support/Patch-for-old-Intel-compilers</TT>.
215
216 <P>
217 The Intel compiler ifort <TT>http://software.intel.com/</TT>
218 produces fast executables, at least on Intel CPUs, but not all versions
219 work as expected. In case of trouble, update your version
220 with the most recent patches. Since each major release of ifort
221 differs a lot from the previous one, compiled objects from different
222 releases may be incompatible and should not be mixed.
223
224 <P>
225 The Intel compiler is no longer free for personal usage, but it is still
226 for students and open-source contributors
227 (<TT>https://software.intel.com/en-us/qualify-for-free-software</TT>).
228
229 <P>
230 If <TT>configure</TT> doesn't find the compiler, or if you get
231 <EM>Error loading shared libraries</EM> at run time, you may have
232 forgotten to execute the script that
233 sets up the correct PATH and library path. Unless your system manager has
234 done this for you, you should execute the appropriate script &ndash; located in
235 the directory containing the compiler executable &ndash; in your
236 initialization files. Consult the documentation provided by Intel.
237
238 <P>
239 The warning: <EM>feupdateenv is not implemented and will always fail</EM>,
240 can be safely ignored. Warnings on ``bad preprocessing option'' when compiling
241 iotk and complains about ``recommended formats'' may also be ignored.
242
243 <P>
244
245 <H4><A ID="SECTION00038230000000000000">
246 2.8.2.3 Linux PCs with MKL libraries</A>
247 </H4>
248 On Intel CPUs it is very convenient to use Intel MKL libraries
249 (freely available at
250 <TT>https://software.intel.com/en-us/performance-libraries</TT>).
251 MKL libraries can be used also with non-Intel compilers.
252 They work also for AMD CPU, selecting the appropriate machine-optimized
253 libraries: see ``Linux PCs with AMD processors''.
254
255 <P>
256 <TT>configure</TT> properly detects only recent (v.12 or later) MKL libraries,
257 as long as the $MKLROOT environment variable is set in the current shell.
258 Normally this environment variable is set by sourcing the Intel MKL or Intel
259 Parallel Studio environment script.
260 By default the non-threaded version of MKL is linked, unless option
261 <TT>configure &ndash;with-openmp</TT> is specified. In case of trouble,
262 refer to the following web page to find the correct way to link MKL:
263 <BR><TT>http://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/</TT>.
264
265 <P>
266 For parallel (MPI) execution on multiprocessor (SMP) machines, set the
267 environment variable OMP_NUM_THREADS to 1 unless you know what you
268 are doing. See Sec.<A HREF="node17.html#Sec:para">3</A> for more info on this
269 and on the difference between MPI and OpenMP parallelization.
270
271 <P>
272 If you get a mysterious "too many communicators" error and a
273 subsequent crash: there is a bug in Intel MPI and MKL 2016 update 3.
274 See this thread and the links quoted therein:
275 <code>http://www.mail-archive.com/[email protected]/msg29684.html</code>.
276
277 <P>
278
279 <H4><A ID="SECTION00038240000000000000">
280 2.8.2.4 Linux PCs with AMD processors</A>
281 </H4>
282 For AMD CPUs you may find convenient to link AMD acml libraries
283 (can be freely downloaded from AMD web site).
284 <TT>configure</TT> should recognize properly installed acml libraries.
285 UPDATE (February 2020): ACML have been discontinued. There are new
286 libraries called AMD Optimizing CPU Libraries (AOCL), tuned for the
287 AMD EPYC processor family.
288 `` Recently I played around with some AMD EPYC cpus and the bad thing
289 is that I also saw some strange numbers when using libflame/aocl 2.1.
290 (...) Since version 2020 the MKL performs rather well when using AMD cpus,
291 however, if you want to get the best performance you have to additionally set:
292 <PRE>
293 export MKL_DEBUG_CPU_TYPE=5
294 </PRE>
295 which gives an additional 10-20% speedup with MKL 2020,
296 while for earlier versions the speedup is greater than 200%.
297 [...] Another note, there seem to be problems using FFTW interface
298 of MKL with AMD cpus. To get around this problem, one has to
299 additionally set
300 <PRE>
301 export MKL_CBWR=AUTO
302 </PRE>
303 `` (Info by Tobias Klöffel, Feb. 2020)
304
305 <P>
306
307 <H3><A ID="SECTION00038300000000000000"></A>
308 <A ID="SubSec:LinuxPCMPI"></A>
309 <BR>
310 2.8.3 Linux PC clusters with MPI
311 </H3>
312 PC clusters running some version of MPI are a very popular
313 computational platform nowadays. Q<SMALL>UANTUM </SMALL>ESPRESSO is known to work
314 with at least two of the major MPI implementations (MPICH, LAM-MPI),
315 plus with the newer MPICH2 and OpenMPI implementation.
316 <TT>configure</TT> should automatically recognize a properly installed
317 parallel environment and prepare for parallel compilation.
318 Unfortunately this not always happens. In fact:
319
320 <UL>
321 <LI><TT>configure</TT> tries to locate a parallel compiler in a logical
322 place with a logical name, but if it has a strange names or it is
323 located in a strange location, you will have to instruct <TT>configure</TT> to find it. Note that in many PC clusters (Beowulf), there is no
324 parallel Fortran compiler in default installations: you have to
325 configure an appropriate script, such as mpif90.
326 </LI>
327 <LI><TT>configure</TT> tries to locate libraries (both mathematical and
328 parallel libraries) in the usual places with usual names, but if
329 they have strange names or strange locations, you will have to
330 rename/move them, or to instruct <TT>configure</TT> to find them. If MPI
331 libraries are not found,
332 parallel compilation is disabled.
333 </LI>
334 <LI><TT>configure</TT> tests that the compiler and the libraries are
335 compatible (i.e. the compiler may link the libraries without
336 conflicts and without missing symbols). If they aren't and the
337 compilation fails, <TT>configure</TT> will revert to serial compilation.
338 </LI>
339 </UL>
340
341 <P>
342 Apart from such problems, Q<SMALL>UANTUM </SMALL>ESPRESSO compiles and works on all non-buggy, properly
343 configured hardware and software combinations. In some cases you may have to
344 recompile MPI libraries: not all MPI installations contain support for
345 the Fortran compiler of your choice (or for any Fortran compiler
346 at all!).
347
348 <P>
349 If Q<SMALL>UANTUM </SMALL>ESPRESSO does not work for some reason on a PC cluster,
350 try first if it works in serial execution. A frequent problem with parallel
351 execution is that Q<SMALL>UANTUM </SMALL>ESPRESSO does not read from standard input,
352 due to the configuration of MPI libraries: see Sec.<A HREF="node21.html#SubSec:badpara">3.4</A>.
353 If you are dissatisfied with the performances in parallel execution,
354 see Sec.<A HREF="node17.html#Sec:para">3</A> and in particular Sec.<A HREF="node21.html#SubSec:badpara">3.4</A>.
355
356 <P>
357
358 <H3><A ID="SECTION00038400000000000000"></A>
359 <A ID="SubSec:Windows"></A>
360 <BR>
361 2.8.4 Microsoft Windows
362 </H3>
363 Since February 2020 Q<SMALL>UANTUM </SMALL>ESPRESSO can be compiled on MS-Windows 10 using PGI 19.10
364 Community Edition (freely downloadable). <TT>configure</TT> works with the bash
365 script provided by PGI but the <TT>configure</TT> of FoX fails: use script
366 <TT>install/build_fox_with_pgi.sh</TT> to manually compile FoX.
367
368 <P>
369 Another option: use MinGW/MSYS. Download the installer from
370 <TT>https://osdn.net/projects/mingw/</TT>, install MinGW, MSYS, gcc and
371 gfortran. Start a shell window; run "./configure"; edit <TT>make.inc</TT>;
372 uncommenting the second definition of TOPDIR (the first one introduces a
373 final "/" that Windows doesn't like); run "make". Note that on some Windows
374 the code fails when checking that <TT>tmp_dir</TT> is writable, for unclear
375 reasons.
376
377 <P>
378 Another option is Cygwin, a UNIX environment which runs under Windows: see
379 <BR><TT>http://www.cygwin.com/</TT>.
380
381 <P>
382 Windows-10 users may also enable the Windows Subsystem for Linux (see here:
383 <BR><TT>https://docs.microsoft.com/en-us/windows/wsl/install-win10</TT>),
384 install a Linux distribution, compile Q<SMALL>UANTUM </SMALL>ESPRESSO as on Linux. It works very well.
385
386 <P>
387 As a final option, one can use Quantum Mobile:
388 <BR><TT>https://www.materialscloud.org/work/quantum-mobile</TT>.
389
390 <P>
391
392 <H3><A ID="SECTION00038500000000000000">
393 2.8.5 Mac OS</A>
394 </H3>
395
396 <P>
397 Mac OS-X machines with gfortran or with the Intel compiler ifort
398 and MKL libraries should work, but "your mileage may vary", depending
399 upon the specific software stack you are using. Parallel compilation
400 with OpenMPI should also work.
401
402 <P>
403 If you get an error like
404 <PRE>
405 clang: error: no input files
406 make[1]: *** [laxlib.fh] Error 1
407 make: *** [libla] Error 1i
408 </PRE>
409 redefine <TT>CPP</TT> as <TT>CPP=gcc -E</TT> in <TT>make.inc</TT>.
410
411 <P>
412 Gfortran information and binaries for Mac OS-X here:
413 <TT>http://hpc.sourceforge.net/</TT> and
414 <TT>https://wiki.helsinki.fi/display/HUGG/GNU+compiler+install+on+Mac+OS+X</TT>.
415
416 <P>
417 Mysterious crashes in <TT>zdotc</TT> are due to a known incompatibility of
418 complex functions with some optimized BLAS. See the "Linux PCs with gfortran"
419 paragraph.
420
421 <P>
422 <HR>
423 <!--Navigation Panel-->
424 <A
425 HREF="node16.html">
426 <IMG WIDTH="37" HEIGHT="24" ALT="next" SRC="next.png"></A>
427 <A
428 HREF="node7.html">
429 <IMG WIDTH="26" HEIGHT="24" ALT="up" SRC="up.png"></A>
430 <A
431 HREF="node14.html">
432 <IMG WIDTH="63" HEIGHT="24" ALT="previous" SRC="prev.png"></A>
433 <A ID="tex2html192"
434 HREF="node1.html">
435 <IMG WIDTH="65" HEIGHT="24" ALT="contents" SRC="contents.png"></A>
436 <BR>
437 <B> Next:</B> <A
438 HREF="node16.html">2.9 Cray machines</A>
439 <B> Up:</B> <A
440 HREF="node7.html">2 Installation</A>
441 <B> Previous:</B> <A
442 HREF="node14.html">2.7 Running tests and</A>
443 <B> <A ID="tex2html193"
444 HREF="node1.html">Contents</A></B>
445 <!--End of Navigation Panel-->
446
447 </BODY>
448 </HTML>