lawn81.tex

来自「famous linear algebra library (LAPACK) p」· TEX 代码 · 共 1,501 行 · 第 1/5 页

TEX
1,501
字号

This release also contains two distinct timing programs for the
LAPACK routines in each data type. 
The linear equation timing program gathers performance data in
megaflops on the factor, solve, and inverse routines for solving
linear systems, the routines to generate or apply an orthogonal matrix
given as a sequence of elementary transformations, and the reductions
to bidiagonal, tridiagonal, or Hessenberg form for eigenvalue
computations.
The operation counts used in computing the megaflop rates are computed
from a formula;
see LAPACK Working Note 41~\cite{WN41}.
% see Appendix ~\ref{appendixc}.
The eigenvalue timing program is used with the eigensystem routines
and returns the execution time, number of floating point operations, and
megaflop rate for each of the requested subroutines.
In this program, the number of operations is computed while the
code is executing using special instrumented versions of the LAPACK
subroutines.

\section{Installing LAPACK on a Unix System}\label{installation}

Installing, testing, and timing\footnotemark[\value{footnote}] the Unix version of LAPACK
involves the following steps: 
\begin{enumerate}
\item Gunzip and tar the file.

\item Copy and edit the file \texttt{LAPACK/make.inc.example to LAPACK/make.inc}.
 
\item Edit the file \texttt{LAPACK/Makefile} and type \texttt{make}.

%\item Test and Install the Machine-Dependent Routines \\
%\emph{(WARNING:  You may need to supply a correct version of second.f and
%dsecnd.f for your machine)}
%{\tt
%\begin{list}{}{}
%\item cd LAPACK
%\item make install
%\end{list} }
%
%\item Create the BLAS Library, \emph{if necessary} \\
%\emph{(NOTE:  For best performance, it is recommended you use the manufacturers' BLAS)}
%{\tt
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make blaslib}
%\end{list} }
%
%\item Run the Level 1, 2, and 3 BLAS Test Programs
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make blas\_testing}
%\end{list}
%
%\item Create the LAPACK Library
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make lapacklib}
%\end{list}
%
%\item Create the Library of Test Matrix Generators
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make tmglib}
%\end{list}
%
%\item Run the LAPACK Test Programs
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make testing}
%\end{list}
%
%\item Run the LAPACK Timing Programs
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make timing}
%\end{list}
%
%\item Run the BLAS Timing Programs
%\begin{list}{}{}
%\item \texttt{cd LAPACK}
%\item \texttt{make blas\_timing}
%\end{list}
\end{enumerate}
 
\subsection{Untar the File}

If you received a tar file of LAPACK via the World Wide
Web or anonymous ftp, enter the following command:

\begin{list}{}
\item{\texttt{gunzip -c lapack.tgz | tar xvf -}}
\end{list}

\noindent
This will create a top-level directory called \texttt{LAPACK}, which
requires approximately 34 Mbytes of disk space.
The total space requirements including the object files and executables
is approximately 100 Mbytes for all four data types.

\subsection{Copy and edit the file \texttt{LAPACK/make.inc.example to LAPACK/make.inc}}

Before the libraries can be built, or the testing and timing\footnotemark[\value{footnote}] programs
run, you must define all machine-specific parameters for the
architecture to which you are installing LAPACK.  All machine-specific
parameters are contained in the file \texttt{LAPACK/make.inc}.
An example of  \texttt{LAPACK/make.inc} for a LINUX machine with GNU compilers is given 
in \texttt{LAPACK/make.inc.example}, copy that file to LAPACK/make.inc by entering the following command:

\begin{list}{}
\item{\texttt{cp LAPACK/make.inc.example LAPACK/make.inc}}
\end{list}

\noindent
Now modify your \texttt{LAPACK/make.inc} by applying the following recommendations.
The first line of this \texttt{make.inc} file is:
\begin{quote}
SHELL = /bin/sh
\end{quote}
and it will need to be modified to \texttt{SHELL = /sbin/sh} if you are
installing LAPACK on an SGI architecture.
Second, you will
need to modify the \texttt{PLAT} definition, which is appended to all
library names, to specify the architecture to which you are installing
LAPACK.  This features avoids confusion in library names when you are
installing LAPACK on more than one architecture.  Next, you will need
to modify \texttt{FORTRAN}, \texttt{OPTS}, \texttt{DRVOPTS}, \texttt{NOOPT}, \texttt{LOADER},
and \texttt{LOADOPTS} to specify
the compiler, compiler options, compiler options for the testing and
timing\footnotemark[\value{footnote}] main programs, loader, loader options.
Next you will have to choose which function you will use to time in the \texttt{SECOND} and \texttt{DSECND} routines.
\begin{verbatim}
#The Default : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME
TIMER    = EXT_ETIME
# For RS6K : SECOND and DSECND will use a call to the EXTERNAL FUNCTION ETIME_ 
# TIMER    = EXT_ETIME_
# For gfortran compiler: SECOND and DSECND will use the INTERNAL FUNCTION ETIME
# TIMER    = INT_ETIME
# If your Fortran compiler does not provide etime (like Nag Fortran Compiler, etc...)
# SECOND and DSECND will use a call to the INTERNAL FUNCTION CPU_TIME
# TIMER    = INT_CPU_TIME
# If neither of this works...you can use the NONE value... 
# In that case, SECOND and DSECND will always return 0
# TIMER     = NONE
\end{verbatim}
Refer to the section~\ref{second} to get more information.


Next, you will need to modify \texttt{ARCH}, \texttt{ARCHFLAGS}, and \texttt{RANLIB} to specify archiver,
archiver options, and ranlib for your machine.  If your architecture
does not require \texttt{ranlib} to be run after each archive command (as
is the case with CRAY computers running UNICOS, Hewlett Packard
computers running HP-UX, or SUN SPARCstations running Solaris), set
\texttt{ranlib=echo}.  And finally, you must
modify the \texttt{BLASLIB} definition to specify the BLAS library to which
you will be linking.  If an optimized version of the BLAS is available
on your machine, you are highly recommended to link to that library.
Otherwise, by default, \texttt{BLASLIB} is set to the Fortran 77 version.  \\

\textbf{NOTE:}  Example \texttt{make.inc} include files are contained in the
\texttt{LAPACK/INSTALL} directory.  Please refer to
Appendix~\ref{appendixd} for machine-specific installation hints, and/or
the \texttt{release\_notes} file on \texttt{netlib}.
\begin{quote}
\url{http://www.netlib.org/lapack/release\_notes}
\end{quote}

\subsection{Edit the file \texttt{LAPACK/Makefile}}\label{toplevelmakefile}

This \texttt{Makefile} can be modified to perform as much of the
installation process as the user desires.  Ideally, this is the ONLY
makefile the user must modify.  However, modification of lower-level
makefiles may be necessary if a specific routine needs to be compiled
with a different level of optimization.  

First, edit the definitions of \texttt{blaslib}, \texttt{lapacklib},
\texttt{tmglib}, \texttt{lapack\_testing}, and \texttt{timing}\footnotemark[\value{footnote}] in the file \texttt{LAPACK/Makefile}
to specify the data types desired.  For example,
if you only wish to compile the single precision real version of the
LAPACK library, you would modify the \texttt{lapacklib} definition to be:

\begin{verbatim}
lapacklib:
        ( cd SRC; $(MAKE) single )
\end{verbatim}

Likewise, you could specify \texttt{double, complex, or complex16} to
build the double precision real, single precision complex, or double
precision complex libraries, respectively.  By default, the presence of
no arguments following the \texttt{make} command will result in the
building of all four data types.
The make command can be run more than once to add another
data type to the library if necessary.

%If you are installing LAPACK on a Silicon Graphics machine, you must
%modify the respective definitions of \texttt{testing} and \texttt{timing} to be
%\begin{verbatim}
%testing:
%        ( cd TESTING; $(MAKE) -f Makefile.sgi )
%\end{verbatim}
%and
%\begin{verbatim}
%timing:
%        ( cd TIMING; $(MAKE) -f Makefile.sgi )
%\end{verbatim}
      
Next, if you will be using a locally available BLAS library, you will need
to remove \texttt{blaslib} from the \texttt{lib} definition.  And finally,
if you do not wish to build all of the libraries individually and
likewise run all of the testing and timing separately, you can
modify the \texttt{all} definition to specify the amount of the
installation process that you want performed.  By default,
the \texttt{all} definition is set to
\begin{verbatim}
all: lapack_install lib lapack_testing blas_testing
\end{verbatim}
which will perform all phases of the installation
process -- testing of machine-dependent routines, building the libraries,
BLAS testing and LAPACK testing.

The entire installation process will then be performed by typing
\texttt{make}.

Questions and/or comments can be directed to the
authors as described in Section~\ref{sendresults}.  If test failures
occur, please refer to the appropriate subsection in
Section~\ref{furtherdetails}.

If disk space is limited, we suggest building each data type separately
and/or deleting all object files after building the libraries.  Likewise, all
testing and timing executables can be deleted after the testing and timing
process is completed.  The removal of all object files and executables
can be accomplished by the following:

\begin{list}{}{}
\item \texttt{cd LAPACK}
\item \texttt{make clean}
\end{list}

\section{Further Details of the Installation Process}\label{furtherdetails}

Alternatively, you can choose to run each of the phases of the
installation process separately.  The following sections give details
on how this may be achieved.

\subsection{Test and Install the Machine-Dependent Routines.}

There are six machine-dependent functions in the test and timing
package, at least three of which must be installed.  They are

\begin{tabbing}
MONOMO  \=  DOUBLE PRECYSION  \=  \kill
LSAME   \>  LOGICAL      \> Test if two characters are the same regardless of case \\
SLAMCH  \>  REAL  \> Determine machine-dependent parameters \\
DLAMCH  \>  DOUBLE PRECISION \> Determine machine-dependent parameters \\
SECOND  \>  REAL  \> Return time in seconds from a fixed starting time \\
DSECND  \>  DOUBLE PRECISION  \> Return time in seconds from a fixed starting time\\
ILAENV  \>  INTEGER \> Checks that NaN and infinity arithmetic are IEEE-754 compliant
\end{tabbing}

\noindent
If you are working only in single precision, you do not need to install
DLAMCH and DSECND, and if you are working only in double precision,
you do not need to install SLAMCH and SECOND.

These six subroutines are provided in \texttt{LAPACK/INSTALL},
along with six test programs.
To compile the six test programs and run the tests, go to \texttt{LAPACK} and
type \texttt{make lapack\_install}.  The test programs are called
\texttt{testlsame, testslamch, testdlamch, testsecond, testdsecnd} and
\texttt{testieee}.
If you do not wish to run all tests, you will need to modify the 
\texttt{lapack\_install} definition in the \texttt{LAPACK/Makefile} to only include the
tests you wish to run.  Otherwise, all tests will be performed.
The expected results of each test program are described below.

\subsubsection{Installing LSAME}

LSAME is a logical function with two character parameters, A and B.
It returns .TRUE. if A and B are the same regardless of case, or .FALSE.
if they are different. 
For example, the expression

\begin{list}{}{} 
\item \texttt{LSAME( UPLO, 'U' )}
\end{list}
\noindent 
is equivalent to
\begin{list}{}{} 
\item \texttt{( UPLO.EQ.'U' ).OR.( UPLO.EQ.'u' )}
\end{list} 
 
The test program in \texttt{lsametst.f} tests all combinations of
the same character in upper and lower case for A and B, and two
cases where A and B are different characters.

Run the test program by typing \texttt{testlsame}.
If LSAME works correctly, the only message you should see after the
execution of \texttt{testlsame} is
\begin{verbatim}
 ASCII character set

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?