You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case, the \verb+blas+ and \verb+lapack+ libraries are assumed to be provided by the
265
267
\verb+-framework vecLib+ option. The \verb+libgfortran+ library is located in the directory
266
-
\verb+/opt/local/lib/gcc47+, which is where \verb+macports+ currently installs it.
268
+
\verb+/opt/local/lib/gcc48+, which is where \verb+macports+ currently installs it.
267
269
268
270
\subsubsection{Linux machines}
269
271
If you are on a Linux machine, we suggest you copy the configuration options from \verb+make.linux+,
@@ -354,6 +356,7 @@ \subsubsection{How do I setup the {\tt make.inc} file?}
354
356
The following \verb+make.inc+ file includes all configurable options:
355
357
\begin{verbatim}
356
358
etree = no
359
+
proj = no
357
360
SW4ROOT = /Users/petersson1
358
361
359
362
CXX = mpicxx
@@ -370,9 +373,42 @@ \subsubsection{How do I setup the {\tt make.inc} file?}
370
373
\verb+EXTRA_LINK_FLAGS+ variables should contain any additional arguments that need to be passed to
371
374
the C++ compiler, Fortran compiler, or linker, on your system.
372
375
376
+
\subsection{Building {\tt sw4} with proj.4 and/or efile support}
377
+
The installation of the proj.4, euclid, and cencalvm libraries is discussed in
378
+
Section~\ref{sec:cencalvm-install}. Note that the proj.4 libraray enables the more advanced
379
+
geographical mapping keywords in the {\tt grid} command and is also required by the {\tt rfile}
380
+
command. To enable the {\tt efile} command, you have to also install the {\tt euclid} and {\tt
381
+
cencalvm} libraries. Note that the latter two libraries are only needed by the {\tt efile}
382
+
command. If you are not planning on using that command, there is no need to install those
383
+
libraies. This is a change from \emph{SW4} version 1.0.
384
+
385
+
Once you have successfully installed the proj.4, and optionally the euclid and cencalvm libraries,
386
+
it should be easy to re-configure \emph{SW4} to use them. Simply edit your configuration file
387
+
(\verb+make.inc+) by adding two lines to the top of the file, setting the {\tt etree} keyword to
388
+
{\tt yes} or {\tt no}, as appropriate.
389
+
\begin{verbatim}
390
+
proj = yes
391
+
etree = no
392
+
SW4ROOT = /thid/party/basedir
393
+
...
394
+
\end{verbatim}
395
+
You then need to re-compile \emph{SW4}. Go to the \emph{SW4} main directory, clean up the previous
396
+
object files and executable, and re-run make:
397
+
\begin{verbatim}
398
+
shell> cd /my/installation/dir/sw4-v1.1
399
+
shell> make clean
400
+
shell> make
401
+
\end{verbatim}
402
+
If all goes well, the ``SW4 lives'' banner is shown after the make command is
403
+
completed. As before, the \verb+sw4+ executable will be located in the \verb+optimize+ or
404
+
\verb+debug+ directories.
373
405
374
406
\section{Installing \emph{SW4} with CMake}\label{cha:installing-cmake-sw4}
375
-
\emph{SW4} also allows building using CMake. The \emph{SW4} CMake configuration includes several tests used to ensure the code calculates the correct values for some well established benchmark cases and that answers converge appropriately to analytical solutions.
407
+
\emph{SW4} also allows building using CMake. The \emph{SW4} CMake configuration also automates the
408
+
testing of the code, which ensures that it functions correctly. The tests run a number of input
409
+
scripts in the \verb+examples+ directory and evaluates the accuracy of the numerical solutions using
410
+
various analytical solutions, see the Appendix of the \emph{SW4} user's guide~\cite{SW4-11} for
411
+
details.
376
412
377
413
To use CMake, change to the sw4 directory and run the following commands:
378
414
\begin{verbatim}
@@ -381,40 +417,63 @@ \section{Installing \emph{SW4} with CMake}\label{cha:installing-cmake-sw4}
381
417
shell> cmake [options] ..
382
418
shell> make
383
419
\end{verbatim}
384
-
The \verb+cmake+ command searches for the necessary libraries and other dependencies, then creates makefiles appropriate to your system. Running \verb+make+ compiles \emph{SW4} using these makefiles. For details about the exact commands being used in compilation, run \texttt{make VERBOSE=1}. Once SW4 is successfully compiled and linked you will see the ``SW4 Lives!'' banner on the screen.
420
+
The two dots after {\tt cmake [options]} are essential and instructs it to look in the parent
421
+
directory for the {\tt CMakeLists.txt} file.
422
+
423
+
The \verb+cmake+ command searches for the necessary libraries and other dependencies, then creates
424
+
makefiles appropriate to your system. Running \verb+make+ compiles \emph{SW4} using these
425
+
makefiles. For details about the exact commands being used in compilation, run \texttt{make
426
+
VERBOSE=1}. Once SW4 is successfully compiled and linked you will see the ``SW4 Lives!'' banner
427
+
on the screen.
385
428
386
429
\subsection{CMake Options}
387
-
CMake provides several options to allow customized configuration of \emph{SW4}. To use any option, add \texttt{-D\textless option\textgreater=\textless value\textgreater} to the options in the \texttt{cmake} command. For example:
388
-
430
+
CMake provides several options to allow customized configuration of \emph{SW4}. To use any option,
431
+
add \texttt{-D\textless option\textgreater=\textless value\textgreater} to the options in the
will configure \emph{SW4} with testing level 1 and compile the debug version of the code. A list of options is shown in the table below.
394
-
437
+
%
438
+
configures \emph{SW4} with testing level 1, to be compiled with debugging symbols in the object
439
+
files. A list of options is shown in the table below.
440
+
%
395
441
\begin{center}
396
442
\begin{tabular}{|l|c|p{0.55\textwidth}|}
397
443
\hline
398
444
Option & Default & Details \\
399
445
\hline
400
-
PROJ4\_HOME & (none) & The path to the Proj.4 installation to use when compiling \emph{SW4}. \\
401
-
\hline
402
-
CENCALVM\_HOME & (none) & The path to the cencalvm installation to use when compiling \emph{SW4}. \\
403
-
\hline
404
-
CMAKE\_BUILD\_TYPE & Release & Which type of build to perform. Can be either \texttt{Debug}, \texttt{Release}, or \texttt{RelWithDebInfo}. This affects the type of optimization and debug flags used in compiling \emph{SW4}. \\
405
-
\hline
406
-
TESTING\_LEVEL & 0 & Specifies the testing level for automated tests. Level 0 corresponds to tests which run in roughly a minute or less (7 total), level 1 to tests which run in roughly 10 minutes or less (13 total) and level 2 to tests which may require up to an hour or more (17 total). \\
407
-
\hline
408
-
MPI\_NUM\_TEST\_PROCS & 4 & Number of MPI processes to use in tests. Generally using more processes will result in tests finishing faster. We strongly recommend at least 8 processes if TESTING\_LEVEL is 1 or higher.\\
409
-
\hline
446
+
%
447
+
PROJ4\_HOME & (none) & The path to the Proj.4 installation to use when compiling
448
+
\emph{SW4}. \\ \hline
449
+
%
450
+
CENCALVM\_HOME & (none) & The path to the cencalvm installation to use when compiling
451
+
\emph{SW4}. \\ \hline
452
+
%
453
+
CMAKE\_BUILD\_TYPE & Release & The type of build to setup. Can be either \texttt{Debug},
454
+
\texttt{Release}, or \texttt{RelWithDebInfo}. This affects the type of optimization and debug flags
455
+
used in compiling \emph{SW4}. \\ \hline
456
+
%
457
+
TESTING\_LEVEL & 0 & Specifies the testing level for automated tests. Level 0 corresponds to tests
458
+
that run in roughly a minute or less (7 total), level 1 to tests that run in roughly 10 minutes or
459
+
less (13 total) and level 2 to tests that may require up to an hour or more (17 total). \\ \hline
460
+
%
461
+
MPI\_NUM\_TEST\_PROCS & 4 & Number of MPI processes to use in tests. Generally using more processes
462
+
will result in the tests finishing faster, but there is no point exceeding the number of available
463
+
cores on your system. We strongly recommend at least 8 processes if TESTING\_LEVEL is 1 or
464
+
higher.\\ \hline
465
+
%
410
466
\end{tabular}
411
467
\end{center}
412
468
413
469
\subsection{CTest}
414
-
The \emph{SW4} CMake configuration includes several test cases to confirm the code is working correctly. Each test consists of two parts, 1) it performs a run using an input file in the \verb+examples/+ directory, then 2) it confirms the results of the run are within accepted error tolerances.
470
+
The \emph{SW4} CMake configuration includes several test cases, which can be used to confirm that
471
+
the code is working correctly. Each test consists of two parts. First it runs a case using an input
472
+
file in the \verb+examples/+ directory. Secondly, it confirms that the results are within
473
+
a reasonable error tolerances from previously recorded results.
415
474
416
475
To run the tests, use either the command \texttt{make test} or \texttt{ctest} as follows:
417
-
476
+
%
418
477
\begin{verbatim}
419
478
build > make test
420
479
Running tests...
@@ -436,7 +495,7 @@ \subsection{CTest}
436
495
\end{verbatim}
437
496
438
497
You can run tests selectively using \texttt{ctest -R \textless regex\textgreater}, for example:
439
-
498
+
%
440
499
\begin{verbatim}
441
500
build > ctest -R twi-2
442
501
Test project /.../sw4/build
@@ -454,11 +513,22 @@ \subsection{CTest}
454
513
Total Test time (real) = 14.90 sec
455
514
\end{verbatim}
456
515
457
-
You can use these tests to help ensure your \emph{SW4} installation is working correctly. If a test fails you can check the details in the output log at \texttt{Testing/Temporary/LastTest.log}.
516
+
If a test fails you can check the details in the output log at
517
+
\texttt{Testing/Temporary/LastTest.log}.
458
518
459
-
\section{Installing the cencalvm, proj.4, and euclid libraries}\label{sec:cencalvm-install}
460
-
\index{installation!cencalvm}
461
-
\index{installation!efile}
519
+
\section{Installing the proj.4, euclid, and cencalvm packages}\label{sec:cencalvm-install}
0 commit comments