Contents of /release/3.3.1/doc/install/compiler.tex

Revision 4318 - (show annotations)
Thu Mar 14 10:16:49 2013 UTC (6 years, 1 month ago) by jfenwick
File MIME type: application/x-tex
File size: 3580 byte(s)
arrrggggg

 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 % Copyright (c) 2003-2013 by University of Queensland 3 4 % 5 % Primary Business: Queensland, Australia 6 % Licensed under the Open Software License version 3.0 7 8 % 9 % Development until 2012 by Earth Systems Science Computational Center (ESSCC) 10 % Development since 2012 by School of Earth Sciences 11 % 12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 13 14 % Notes about compilers 15 16 \chapter{Compilers}\label{chap:compiler} 17 18 If you compiling escript yourself, you should be aware of the capabilities of the compiler you use. 19 In particular, whether or not it supports \openmp. 20 Escript is primarily tested on recent versions of the GNU or Intel suites (gcc, g++'' / icc, icpc''). 21 However, it also passes our tests when compiled using clang, clang++''. 22 [This section does not discuss the Microsoft compiler]. 23 24 One of the benefits of compiling \escript rather than using the binary packages, is that your build of escript 25 can make use of mutiple cpu-cores on your system. 26 \escript can make use of two mechanisms for parallelism. 27 \openmp uses multi-threading and is the more efficient approach on a single computer. 28 \mpi executes a number of sub-programs and can be used when \openmp is not available (or in more 29 advanced settings, where mutiple computers are in use). 30 The table below shows which types of parallelism are available under which compilers. 31 32 \begin{center} 33 \begin{tabular}{|l|c|c|c|}\hline 34 & Serial & OpenMP & MPI \\\hline 35 $\leq$ gcc-4.2.1 & \checkmark & \raisebox{-0.1cm}{\footnotemark}& \checkmark \\\hline 36 gcc (recent $\geq 4.3.2$) & \checkmark& \checkmark& \checkmark \\\hline 37 icc(10) & \checkmark& \checkmark& \checkmark \\\hline 38 icc(11) & \checkmark& \raisebox{-0.1cm}{\footnotemark} &\checkmark \\\hline 39 icc(12) & \checkmark& \checkmark&\checkmark \\\hline 40 clang & \checkmark& & \checkmark\\\hline 41 \end{tabular} 42 \end{center} 43 \addtocounter{footnote}{-1} 44 \footnotetext{The \openmp support in gcc-4.2.1 is buggy. In particular, the version of gcc-4.2.1 45 distributed by Apple, requires extra compile options to build escript. 46 Even when built, escript crashes in tests.} 47 \addtocounter{footnote}{1} 48 \footnotetext{There is a subtle bug in icc-11 when \openmp and c++ exception handling 49 are combined.} 50 51 \noindent Where both \openmp and \mpi are marked, \escript can be compiled with either or both. 52 A \checkmark mark means that combination passes our tests. 53 We use OpenMPI or IntelMPI depending on what is available on the system. 54 55 56 57 \section{Compiling on OSX} 58 Older versions of OSX (eg Leopard'') come with an optional developer tools'' package on their install media. 59 Newer versions (eg Lion'') require users to have an iTunes account to be able to download XCode. 60 Alternatively, there is at least one project\footnote{\url{http://hpc.sourceforge.net/} --- 61 the escript development team has no connection with this project} which offers builds of gcc for OSX for download. 62 63 At this time, the best (although not simplest) option seems to be to use either of the compilers 64 provided by Apple to build a more up to date version of gcc ($4.7$ at time of writing). 65 If you already use a package management system such as MacPorts you may be able to get updated compilers using them. 66 If you do not already use a package manager then it may be simpler just to build it yourself from source. 67 This actually turns out to be pretty easy, see Section~\ref{sec:gccbuilding} for instructions. 68 69 70 71 72