atlas_install

  • 格式:pdf
  • 大小:361.42 KB
  • 文档页数:41

ATLAS Installation Guide∗R.Clint Whaley†July10,2012AbstractThis note provides a brief overview of ATLAS,and describes how to install it.It includes extensive discussion of common configure options,and describes why they might be employed on various platforms.In addition to discussing how to configure and build the ATLAS package,this note also describes how an installer can confirm that the resulting libraries are producing correct answers and running efficiently.Extensive examples are provided,including a full-length example showing the installation of both ATLAS and LAPACK on an example architecture.∗This work was supported in part by National Science Foundation CRI grant SNS-0551504†rwhaley@,/∼whaleyContents1Introduction1 2Overview of an ATLAS Installation22.1Downloading the software and checking for known errors (2)2.2Turn offCPU throttling when installing ATLAS (2)2.3Basic Steps of an ATLAS install (3)3The ATLAS configure step43.1Building a full LAPACK library using ATLAS and netlib’s LAPACK (4)3.1.1LAPACK APIs (5)3.1.2Obtaining netlib’s LAPACK (5)3.2Changing the compilers andflags that ATLAS uses for the build (5)3.2.1Changing ATLAS interface compilers to match your usage (6)3.2.2Rough guide to overriding ATLAS’s compiler choice/changingflags (7)3.2.3Forcing ATLAS to use a particular gcc (7)3.2.4Installing ATLAS when you don’t have access to a FORTRAN compiler (8)3.2.5Improvingflag selection using mmflagsearch (9)3.3Handling hyperthreading,SMT,modules,and other horrors (12)3.4Building dynamic/shared libraries (13)3.5Changing the way ATLAS does timings (14)3.6Building Generic x86libraries (14)3.6.1Building generic libraries for any x86with an x87FPU(PPRO&later) (15)3.6.2Building generic libraries for SSE1(PIII&later) (15)3.6.3Building generic libraries for SSE2(P4&later) (15)3.6.4Selecting a good generic CacheEdge (16)3.6.5Handling paralellism in generic libraries (16)3.7Various otherflags (16)3.7.1Changing pointer bitwidth(64or32bits) (16)3.7.2Changing configure verbosity (16)3.7.3Controlling where ATLAS will movefiles to during install step (17)3.7.4Telling ATLAS to ignore architectural defaults (17)4The ATLAS build step18 5The ATLAS check step18 6The ATLAS time step196.1Contrasting non-default install performance (21)6.2Discussion of timing targets (22)7The ATLAS install step22 8Example:Installing ATLAS with full LAPACK on Linux/AMD64248.1Figuring out configureflags (24)8.2Creating BLDdir and installing ATLAS (25)9Special Instructions for some platforms289.1Special Instructions for Windows (28)9.1.1Setting up Cygwin (28)9.1.2Choosing cygwin or MinGW compilers (28)9.1.3Specifying the MinGW binutils to use (29)9.1.4Creating MSVC++compatible import libraries (29)9.1.5Special Instructions for64bit Windows(eg.,Windows7)users (30)9.2Special instructions for ARM with HARDFP ABIs (31)9.3Special instructions for OS X (31)9.4Special instructions for AIX (31)9.5Special instructions for SunOS (31)10Troubleshooting32 A Post-install Timing and Benchmarking35A.1Setting up ploticus (35)A.2Building the existing charts (35)A.3A guide to the tools(to build your own) (37)1IntroductionThis note provides a quick reference to installing and using ATLAS[20,17,18,19,23,22]. ATLAS(Automatically Tuned Linear Algebra Software),is an empirical tuning system that produces a BLAS[7,8,9,13,14](Basic Linear Algebra Subprograms)library which has been specifically optimized for the platform you install ATLAS on.The BLAS are a set of building block routines which,when tuned well,allow more complicated Linear Algebra operations such as solving linear equations orfinding eigenvalues to run extremely efficiently (this is important,since these operations are computationally intensive).For a list of the BLAS routines,see the FORTRAN77and C API quick references guides available in the ATLAS tarfile at:ATLAS/doc/cblasqref.pdfATLAS/doc/f77blasqref.pdfATLAS also natively provides a few routines from the LAPACK[2](Linear Algebra PACKage).LAPACK is an extremely comprehensive FORTRAN package for solving the most commonly occurring problems in numerical linear PACK is available as an open source FORTRAN package from netlib[21],and its size and complexity effectively rule out the idea of ATLAS providing a full implementation.Therefore,we add support for particular LAPACK routines only when we believe that the potential performance win we can offer make the extra development and maintenance costs worthwhile.Presently,ATLAS provides roughly most of the routines that involve the LU,QR and Cholesky factorizations. ATLAS’s implementation uses pure recursive version of LU and Cholesky based on the work of[15,11,12,1],and the QR version uses the hybrid algorithm with static outer blocking and panel recursion described in[10];the static blocking is empirically tuned as described in[16].In parallel,these routines are further sped up by the PCA panel factorization[6]and the threading techniques discussed in[5].The standard LAPACK routines use statically blocked routines,which typically run slower than recursively blocked for all problem sizes.In addition to providing the standard FORTRAN77interface to LAPACK,ATLAS also provides its own C interface,modeled after the official C interface to the BLAS[4,3], which includes support for row-major storage in addition to the standard column-major implementations.The netlib LAPACK has recently begun supporting Intel’s propriatary C interface,which is incompatible with the C BLAS as well as ATLAS’s C interface,as well as performaing a host of unnecessary matrix transpositions.Note that there is no official C interface to LAPACK,and so there is no general C API that allows users to easily substitute one C-interface LAPACK for another,as there is when one uses the standard FORTRAN77API.For a list of the LAPACK routines that ATLAS natively supplies,see the FORTRAN77and C API quick references guide available in the ATLAS tarfile at:ATLAS/doc/lapackqref.pdfNote that although ATLAS provides only a handful of LAPACK routines,it is designed so that it can easily be combined with netlib LAPACK in order to provide the complete library.See Section3.1for details.2Overview of an ATLAS Installation2.1Downloading the software and checking for known errorsThe main ATLAS homepage is at:/The software link offof this page allows for downloading the tarfile.The explicit down-load link is:https:///project/showfiles.php?group_id=23725Once you have obtained the tarfile,you untar it in the directory where you want to keep the ATLAS source directory.The tarfile will create a subdirectory called ATLAS,which you may want to rename to make less generic.For instance,assuming I have saved the tarfile to/home/whaley/dload,and want to put the source in/home/whaley/numerics,I could create ATLAS’s source directory(SRCdir)with the following commands: cd~/numericsbunzip2-c~/dload/atlas3.10.0.tar.bz2|tar xfm-mv ATLAS ATLAS3.10.0Before doing anything else,scope the ATLAS erratafile for known errors/problems that you shouldfix/be aware of before installation:/errata.htmlThisfile contains not only all bugs found,but also all kinds of platform-specific instal-lation and tuning help.2.2Turn offCPU throttling when installing ATLASMost OSes and hardware now turn on CPU throttling for power managementeven if you are using a desktop machine.CPU throttling makes pretty much all timings completely random,and so any ATLAS install will be junk.Therefore,before installing ATLAS,turn offCPU throttling.For most PCs,you can switch it offin the BIOS(eg.,on my Athlon-64machine,I can say”No”to”Cool and Quiet”under”Power Management”). Most OSes also provide a way to switch offCPU throttling,but that varies from OS to OS. Under Fedora,at any rate,the following command seemed to work:/usr/bin/cpufreq-selector-g performanceOn my Core2Duo,cpufreq-selector only changes the parameters of thefirst CPU,re-gardless of which cpu you specify.I suspect this is a bug,because on earlier systems,the remaining CPUs were controlled via a logical link to/sys/devices/system/cpu/cpu0/.In this case,the only way I found to force the second processor to also run at its peak frequency was to issue the following as root after setting CPU0to performance:cp/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor\/sys/devices/system/cpu/cpu1/cpufreq/scaling_governorUnder MacOS or Windows,you may be able to change this under the power settings.2.3Basic Steps of an ATLAS install Whaley32.3Basic Steps of an ATLAS installAn ATLAS install is performed in5steps,only thefirst two of which are mandatory.This install process is very similar to other free software installs,particularly gnu,though the fact that ATLAS does an extremely complex empirical tuning step can make the build step particularly long running.There are two directories that we will refer to constantly in this note,which indicate both the ATLAS source and build directories:SRCdir:This handle should be replaced by the path to your ATLAS source directory(eg, /home/whaley/ATLAS3.8.0).BLDdir:This handle should be replaced by the path to your ATLAS build directory(eg, /home/whaley/ATLAS3.8.0/Linux P4E64SSE3).Note that these two directories cannot be the same(i.e.you cannot build the libraries directly in the source directory).The examples in this note show the BLDdir being a subdirectory of the SRCdir,but this is not required(in fact,any directory to which the installer has read/write permission other than SRCdir can be used).The ATLAS install steps are:1.configure(§3):Tell the ATLAS build harness where your SRCdir and BLDdir direc-tories are,and allow ATLAS to probe the platform to create ATLAS’s Make.inc and BLDdir directory tree.2.build(§4):Tune ATLAS for your platform,and build the libraries.3.check1(§5):Run sanity tests to ensure your libraries are producing correct answers.4.time1(§6):Run basic timing on various ATLAS kernels in order to make sure thetuning done in the build step has resulted in efficient implementations.5.install1(§7):Copy ATLAS’s libraries from the BLDdir to some standard location.It is extremely important that you read Section3in particular,as most users will want to throw at least oneflag during the configure step.In particular,most installers will want to set whether to build32or64-bit libraries(Section3.7.1),andfine-tune the timer used, as discussed in Section3.5.However,for the impatient,here is the way a typical install might look(see§3for an explanation of the configureflags,since they will not work on all systems);note that the characters after the#character are comments,and not meant to be typed in:bunzip2-c atlas3.10.x.tar.bz2|tar xfm-#create SRCdirmv ATLAS ATLAS3.10.x#get unique dir namecd ATLAS3.10.x#enter SRCdirmkdir Linux_C2D64SSE3#create BLDdircd Linux_C2D64SSE3#enter BLDdir../configure-b64-D c-DPentiumCPS=2400\#configure command--prefix=/home/whaley/lib/atlas\#install dir 1Optional stepWhaley4 --with-netlib-lapack-tarfile=/home/whaley/dload/lapack-3.4.1.tgzmake build#tune&build libmake check#sanity check correct answer make ptcheck#sanity check parallelmake time#check if lib is fastmake install#copy libs to install dir3The ATLAS configure stepIn this step,ATLAS builds all the subdirectories of the BLDdir,and creates the make includefile used in all ATLAS’s Makefiles(Make.inc).In order to do this successfully,you inform ATLAS where your SRCdir and BLDdir are located,and passflags which tell configure what type of install you want to do.The basic way to do a configure step is:cd BLDdir;SRCdir/configure[flags]A complete list offlags is beyond the scope of this paper,but you can get a list of them by passing--help to configure.In this note,we will discuss some of the more importantflags only.ATLAS takes two types offlags:flags that are consumed by the initial configure script itself begin with--,andflags that are passed by configure to a later config step begin with only a single-.Wefirst discussflags and steps for building a full netlib library using netlib’s LA-PACK(§3.1),building a shared library(§3.4),changing the compilers(§3.2),and aflag(§3.2.4) to indicate that you have no FORTRAN compiler(and thus don’t need any FORTRAN APIs),and changing the way ATLAS does timings(§3.5).Finally,we consider a few miscel-laneousflags(§3.7),including theflag telling ATLAS whether the resulting libraries should assume a64or32bit address space(§3.7.1).3.1Building a full LAPACK library using ATLAS and netlib’s LAPACK ATLAS natively provides only a relative handful of the routines which comprise LAPACK. However,ATLAS is designed so that its routines can easily be added to netlib’s standard LAPACK in order to get a full LAPACK library.If you want yourfinal libraries to haveall the LAPACK routines,then you just need to pass the--with-netlib-lapack-tarfileflag to configure,along with the netlib tarfile that you have previously downloaded.For instance,assuming you have previously downloaded the lapack tarfile to/home/whaley/dload/lapack-3.4.1.tgz,you would add the following to your configureflags:--with-netlib-lapack-tarfile=/home/whaley/dload/lapack-3.4.1.tgzConfigure then auto-builds a make.inc for LAPACK to use,and builds netlib LAPACK as part of the ATLAS install process.ATLAS3.10.0was tested tow work with LAPACKv3.4.1and3.3.1.3.1.1LAPACK APIsNote that there is no standard C API to LAPACK.Therefore,when you build the netlib LAPACK,you get only the Fortran77API on all platforms.Various vendor libraries provide various C APIs.ATLAS provides two types of LAPACK APIs for C.ATLAS’s clapack API:ATLAS’s original C interface to the LU,QR and Cholesky-related routines is built from the ATLAS/interfaces/lapack/C/src/directory,and is doc-umented in ATLAS/doc/cblasqref.pdf.This API is like that of the cblas,in that all routines take a new argument that allows matrices to be either row-or column-major.This API is difficult to extend to all of LAPACK,since the F77LAPACK provided by netlib only handles column-major.This API uses the CBLAS enum types for F77’s string arguments, and the appropriate pass-by-value or pass-by-address.This API prefixes clapack to the native lapack routine name.3.1.2Obtaining netlib’s LAPACKYou can download the LAPACK reference implementation from /lapack/.For more standard information on LAPACK,please scope the following URLs:•/lapack/•/lapack/lawn81/index.html•/lapack/lawn41/index.html•/lapack/release_notes.html•/lapack/lug/index.html3.2Changing the compilers andflags that ATLAS uses for the build ATLAS defines eight different compilers and associatedflag macros in its Make.inc which are used to compile variousfiles during the install process.ATLAS’s configure provides flags for changing both the compiler andflags for each of these macros.In the following list,the macro name is givenfirst,and the configureflag abbreviation is in parentheses:1.XCC(xc):C compiler used to compile ATLAS’s build harness routines(these neverappear in any user-callable library)2.GOODGCC(gc):gcc with any required architecturalflags(eg.-m64),which will be usedto assemble cpp-enabled assembly and to compile certain multiple implementation routines that specifically request gcc3.F77(if):FORTRAN compiler used to compile ATLAS’s FORTRAN77API interfaceroutines.4.ICC(ic):C compiler used to compile ATLAS’s C API interface routines.5.DMC(dm):C compiler used to compile ATLAS’s generated double precision(real andcomplex)matmul kernels6.SMC(sm):C compiler used to compile ATLAS’s generated single precision(real andcomplex)matmul kernels7.DKC(dk):C compiler used to compile all other double precision routines(mainly usedfor other kernels,thus the K)8.SKC(sk):C compiler used to compile all other single precision routines(mainly usedfor other kernels,thus the K)It is almost never a good idea to change DMC or SMC,and it is only very rarely a good idea to change DKC or SKC.For ATLAS3.10.0,all architectural defaults are set using gcc4.7.0 only(the one exception is PowerPCG4,where gcc4.6.2was used).In most cases,switching these compilers will get you worse performance and accuracy,even when you are absolutely sure it is a better compiler andflag combination!In particular,our timingsclang was always slower on all platforms that gcc,and that it very often produced incorrect code.Intel’s icc was not tried for this release since it is a non-free compiler,but even worse, from the documentation icc does not seem to have anyfirm IEEEfloating point compliance unless you want to run so slow that you could compute it by hand faster.This means that whenever icc achieves reasonable performance,I have no idea if the error will be bounded or not.There is almost never a need to change XCC,since it doesn’t affect the output libraries in any way,and we have seen that changing the kernel compilers is a bad idea.Under Unix, most compilers interoperate with the GNU compilers,and so you can build ATLAS with the GNU compilers,and then simply link to the resulting libs with the compiler of your choice.On Windows,if you want to build ATLAS for linking with native libraries such as MSVC++,then you can build ATLAS with the MinGW compilers,which are GNU compil-ers that are made to natively interoprate with native Windows compilers.See Section9.1 for more information.For those who insist on monkeying with other compilers,Section3.2.2gives some guid-ance.Finally installing ATLAS without a FORTRAN compiler is discussed in Section3.2.4.3.2.1Changing ATLAS interface compilers to match your usageAs mentioned,ATLAS typically gets its best performance when compiled with gcc using theflags that ATLAS automatically picks for your platform(this assumes you are installing on a system that ATLAS provides architectural defaults for).However,you can vary the interface(API)compilers without affecting ATLAS’s performance.Since most compilers are interoperable with gcc this is what we recommend you do if you are using a non-default compiler.Note that almost all compilers can interoperate with gcc,though you may have to throw some specialflags(eg.,/iface:cref for MSVC++).The configureflags to override the C interface compiler andflags are:-C ic<C compiler>-F ic’<compiler flags>’The configureflags to override the FORTRAN interface compiler andflags are:-C if<FORTRAN compiler>-F if’<compiler flags>’For example,assume you use the Sun Workshop compilers available under Solaris.You can instruct configure to use them for building the APIs rather than the gnu compilers with something like:-C if f77-F if’-dalign-native-xO5’\-C ic cc-F ic’-dalign-fsingle-xO5-native’3.2.2Rough guide to overriding ATLAS’s compiler choice/changingflags Previous sections have discussed the more useful cases of overriding ATLAS’s compiler and flags,which typically leave ATLAS’s kernel compilers ers often wish to addflags or change arbitrary compilers,however.This is rarely a good idea,and almost always provides reduced performance.However,you can do it.You canfind more details by passing--help to configure.If you use the-Cflag,then you are overriding ATLAS’s compiler choice(based on the abbrevation you specify,as described below),-F means to override theflags for that compiler,and-Fa tells configure that you want to keep ATLAS’s defaultflags,but wish to append your own list offlags to them.All of theseflags take an abbreviation(<abbr>)describing the particular compiler/flag to override/append,where<abbr>is one of,•One of the already discussed compiler abbreviations(eg,xc,gc,ic,if,sk,dc,sm or dm)•al:all compilers(including FORTRAN)except GOODGCC•alg all compilers(including FORTRAN)including GOODGCC•ac:all C compilers except GOODGCC•acg:all C compilers including GOODGCCTherefore,by passing the following to configure:-Fa acg’-DUsingDynamic-fPIC’We would have all C routines compiled with-fPIC,and also have the macro UsingDynamic defined(ATLAS does not use this macro,this is for example only).As an example,if I want to use SunOS’s f77rather than gfortran,I could pass the following compiler andflag override:-C if f77-F if’dalign-native-xO5’IMPORTANT NOTE:If you change the defaultflags in any way for the kernel compilers(even just appendingflags),you may reduce performance.Therefore once your build isfinished,you should make sure to compare your achieved performance against what ATLAS’s architectural defaults achieved.See Section6.1for details on how to do this.If your compiler is a different version of gcc,you may also want to tell ATLAS not to use the architectural defaults,as described in Section3.7.4.3.2.3Forcing ATLAS to use a particular gccATLAS contains architectural defaults allowing installers to skip most of the empirical tuning,and these defaults were built on most systems for gcc4.7.0.By default,ATLAS will search for this version on your system during configure,and if it can’tfind it,it will select the closest version number that it canfind.Not even later versions of the compiler are necessarily safe to use,since both performance and correctness regressions are relatively common.However,many users wish to force ATLAS to use a particular gcc,even when they have many different gccs installed.The easiest way to force ATLAS to use a particular gcc for all C compilers is:-C acg/full/path/to/your/gccIf you specify only the name and not the path(eg.,“-C alg gcc-4.4”,then ATLAS will search for the named compiler in your PATH variable.The safest approach is to give the full path to the compiler if gcc choice is critical to you.If you want also specify the gfortran to use,additionally add theflag:-C if/full/path/to/your/gfortranIMPORTANT NOTE:If you use a different gcc than4.7.0,you may reduce per-formance.Therefore once your build isfinished,you should make sure to compare your achieved performance against what ATLAS’s architectural defaults achieved.See Section6.1 for details on how to do this.If you can tolerate a long install time,you may also want to tell ATLAS not to use the architectural defaults,as described in Section3.7.4.3.2.4Installing ATLAS when you don’t have access to a FORTRAN compiler By default,ATLAS expects tofind a FORTRAN compiler on your system.If you cannot install a FORTRAN compiler,you can still install ATLAS,but ATLAS will be unable to build the FORTRAN77APIs for both BLAS and LAPACK.Further,certain tests will not be able to even compile,as their testers are at least partially implemented in FORTRAN. To tell ATLAS you wish to install w/o a FORTRAN compiler,simply add theflag: --nof77to your configure command.IMPORTANT NOTE:When you install ATLAS w/o a FORTRAN compiler,your build step will end with a bunch of make errors about being unable to compile some FORTRAN routines.This is because the Makefile s always attempt to compile the FORTRAN APIs: they simply continue the install if they don’t succeed in building them.So,just because you get a lot of make messages about FORTRAN,don’t assume your library is messed up. As long as make check and make time say your-nof77install is OK,you should befine.3.2.5Improvingflag selection using mmflagsearchIf you are on a architecture or using a gcc for which configure does not suggestflags,or if you believe the present set is out-of-date,you can quickly search through a host of compilerflags tofind the best set for a given gemm kernel using the specialized routine mmflagsearch.c. To do this,you need a working install,typically installed with your best guess at goodflags. Now,in your BLDdir/tune/blas/gemm directory,issue make xmmflagsearch.The idea behind this search is that it takes an ATLAS GEMM kernel descriptionfile (output from one of the ATLAS searches),and then tries a series offlags given in another file,and returns to you the best combination found.The importantflags are:-p[s,d,c,z]:set type/precision prefix-f<flagfile>:file containing allflags to try-m<mmfile>:mmsearch outputfile describing kernel to timeThe mmfile is the matmul kernel that you wish to use tofind the bestflags,and if this argument is omitted the search will automatically read res/<pre>gMMRES.sum,which is the best kernel found for the during the prior install using the scalar ANSI C generator.If badflags have caused this search to generate a weirdfile,you can copy thisfile to a new name,and then hand edit it to have the features you like.In the flagfile,any line beginning with‘#’is ignored.Thisfile has a special format that is more easily understood once you understand the method of the search.The user provides one line for anyflags that should always appear(examples include things like -fPIC,-m64,-mcpu=XXX,etc.).This is given on thefirst line.Now,the way the search is going to work is thatfirst it willfind the appropriate op-timization level and fundamentalflag combination,which will be searched by trying all combinations of theseflags.Once these baselineflags are determined,all remainingflags will be tried one after the other using a greedy linear search.With this in mind,the format of thisfile is:Required flags for all cases(eg.-fPIC-m64-msse3-mfpmath=sse)<N>Number of optimization level lines<lvlflagset1>....<lvlflagsetN><F>Number of fundamental flag lines<fundflagset1>....<fundflagsetF>#Now list any number of modifier flag linesflag set1flag set2...flag set XSo,the way this search is going to work is that we willfirst try all N×(F+1)com-binations of the levels and fundamentalflags,and choose a best-performing set.We willthen try adding every provided modifierflag line to the best found combination.The best performing list will be given.To create such aflagfile one usually scopes the compiler documentation,andfinds all performance-orientedflags.For gcc,you can make mmflagsearch give you a template that includes all non-architecture-specific optimizationflags(as found in the documenta-tion for gcc4.2)by running./xmmflagsearch-f gcc.This will create a directory called gccflags.txt in the current directory,which presently has a format like:REPLACE THIS LINE WT ARCH-DEP FLAGS ALWAYS USED(eg,-fPIC-m64-msse3)4-O2-O1-O3-Os6-fschedule-insns-fno-schedule-insns-fschedule-insns2-fno-schedule-insns2-fexpensive-optimizations-fno-expensive-optimizations#Flags to probe once optimization level is selected...whole boatload of flags...Now lets see an example of this working on my ARM embedded machine.Thefirst thing I do is replace thefirst line with my mandatoryflags:-mfpu=vfpv3-mcpu=cortex-a8I then add two architecture-specificflags to the auto-generated generalflag list(might want to try a lot more,this is just an example),which in this case are:-mtune=cortex-a8-mno-thumbAn extract of this search is shown in Figure1.FINDING BEST FLAGS USING MATMUL KERNEL:ID=0ROUT=’dgmm.c’AUTH=’Whaley/emit_mm’TA=’T’TB=’N’\MULADD=1PREF=1LAT=5NFTCH=2IFTCH=6FFTCH=1KBMAX=0KBMIN=0KU=1NU=5\MU=4MB=80NB=80KB=80L14NB=0PFBCOLS=0PFABLK=0PFACOLS=0STFLOAT=0\LDFLOAT=0AOUTER=0LDAB=1BETAN1=0LDISKB=1KUISKB=0KRUNTIME=0NRUNTIME=0\ MRUNTIME=0LDCTOP=0X87=0\MFLOP=5.848105e+02FINDING BEST FLAG SETTINGS FOR THIS MATMUL KERNEL:...Trying optlvls using base flags:’-mfpu=vfpv3-mcpu=cortex-a8’1.mf=557.83,flags=’-O2’--->Opt level’-O2’is better!2.mf=558.18,flags=’-O2-fschedule-insns’3.mf=564.07,flags=’-O2-fno-schedule-insns’--->Opt combo’-O2-fno-schedule-insns’is better!4.mf=564.53,flags=’-O2-fno-schedule-insns-fschedule-insns2’5.mf=572.04,flags=’-O2-fno-schedule-insns-fno-schedule-insns2’--->Opt combo’-O2-fno-schedule-insns-fno-schedule-insns2’is better!6.mf=572.11,flags=’-O2-fno-schedule-insns-fno-schedule-insns2-fexpensive-optimizations’7.mf=573.24,flags=’-O2-fno-schedule-insns-fno-schedule-insns2-fno-expensive-optimizations’8.mf=572.34,flags=’-O1’...Bunch of cases elided...27.mf=562.53,flags=’-Os-fno-schedule-insns-fno-schedule-insns2-fexpensive-optimizations’28.mf=563.81,flags=’-Os-fno-schedule-insns-fno-schedule-insns2-fno-expensive-optimizations’...All cases using flags:’-O2-mfpu=vfpv3-mcpu=cortex-a8-fno-schedule-insns-fno-schedule-insns2’29.mf=571.41,flags=’-mtune=cortex-a8’30.mf=572.32,flags=’-mno-thumb’31.mf=571.02,flags=’-fno-cprop-registers’...Bunch of cases elided...42.mf=574.69,flags=’-fomit-frame-pointer’43.mf=572.39,flags=’-foptimize-register-move’44.mf=571.79,flags=’-fno-optimize-register-move’45.mf=592.68,flags=’-fprefetch-loop-arrays’--->Adding flag’-fprefetch-loop-arrays’!46.mf=572.65,flags=’-fno-prefetch-loop-arrays’...Bunch of cases elided...90.mf=594.61,flags=’-falign-loops=8’91.mf=594.65,flags=’-falign-loops=16’92.mf=594.37,flags=’-falign-loops=32’BEST FLAGS GIVE MFLOP=592.68(6.25%improvement over first case):’-O2-mfpu=vfpv3-mcpu=cortex-a8-fno-schedule-insns-fno-schedule-insns2-fprefetch-loop-arrays’Figure1:Result of./xmmflagsearch-p d-f gccflags.txt on ARM。