Skip to content

Commit 3ee429b

Browse files
authored
Merge pull request #146 from houjun/master
Makefile changes for Spack on MacOS
2 parents d4f1f4f + 9195458 commit 3ee429b

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

Makefile

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,19 @@ ifeq ($(USERMAKE),configs/make.inc)
8989
include configs/make.inc
9090
foundincfile := "configs/make.inc"
9191
else
92-
92+
# Below are commented out for Spack install
9393
# if configs/make.inc does not exist
94-
ifeq ($(UNAME),Darwin)
95-
# for Anders' old laptop
96-
ifeq ($(findstring chebyshev,$(HOSTNAME)),chebyshev)
97-
include configs/make.chebyshev
98-
foundincfile := "configs/make.chebyshev"
99-
# for Anders' new laptop
100-
else ifeq ($(findstring fourier,$(HOSTNAME)),fourier)
101-
include configs/make.fourier
102-
foundincfile := "configs/make.fourier"
94+
# ifeq ($(UNAME),Darwin)
95+
# for Anders' laptop
96+
# ifeq ($(findstring chebyshev,$(HOSTNAME)),chebyshev)
97+
# include configs/make.chebyshev
98+
# foundincfile := "configs/make.chebyshev"
10399
# for any other MacOS system
104100
# else
105101
# include configs/make.osx
106102
# foundincfile := "configs/make.osx"
107-
endif
108-
endif
103+
# endif
104+
# endif
109105

110106
# put the variables in the configs/make.xyz file
111107
ifeq ($(UNAME),Linux)
@@ -164,8 +160,8 @@ else
164160
optdir := $(optdir)_mp
165161
profiledir := $(profiledir)_mp
166162
ifeq ($(UNAME),Darwin)
167-
CXXFLAGS += -lomp
168-
FFLAGS += -lomp
163+
CXXFLAGS += -Xpreprocessor -fopenmp
164+
FFLAGS += -Xpreprocessor -fopenmp
169165
else
170166
CXXFLAGS += -fopenmp
171167
FFLAGS += -fopenmp

doc/SW4-Installation.pdf

1.41 KB
Binary file not shown.

doc/SW4-Installation.tex

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,23 @@
6969
\section{Introduction}
7070
The sole purpose of this document is to describe the installation process of the seismic wave
7171
propagation code \emph{SW4}. A comprehensive user's guide is provided in the report by
72-
Petersson and Sjogreen~\cite{SW4-v3}.
72+
Petersson, Sjogreen, and Tang~\cite{SW4-v3}.
73+
74+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75+
\section{Installing \emph{SW4} with spack}\label{cha:installing-sw4-spack}
76+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77+
\emph{SW4} can be installed with Spack (\url{https://spack.io}), which is a package manager for supercomputers, Linux, and macOS. It can automatically install \emph{SW4} together with all its dependent libraries, such as MPI, Proj, OpenMP, blas, lapack, HDF5, FFTW, and ZFP.
78+
\begin{verbatim}
79+
> git clone -c feature.manyFiles=true https://github.com/spack/spack.git
80+
> . spack/share/spack/setup-env.sh
81+
> spack install sw4
82+
\end{verbatim}
83+
84+
Run the following command to add the installed \emph{SW4} executable to your system PATH:
85+
\begin{verbatim}
86+
> . spack/share/spack/setup-env.sh
87+
> spack load sw4
88+
\end{verbatim}
7389

7490
\section{Compilers and third party libraries}
7591

@@ -189,7 +205,7 @@ \section{Installing \emph{SW4} with make}\label{cha:installing-sw4}
189205

190206
The classical way of building \emph{SW4} uses \verb+make+. We recommend using GNU make, sometimes called \verb+gmake+. You can check the version of make on you system with the command
191207
\begin{verbatim}
192-
make -v
208+
> make -v
193209
\end{verbatim}
194210
If you don't have GNU make installed on your system, you can obtain it from www.gnu.org.
195211

@@ -281,8 +297,8 @@ \subsubsection{Using make}
281297
\end{verbatim}
282298
You can also build an executable with debugging symbols by adding the \verb+debug=yes+ option to \verb+make+,
283299
\begin{verbatim}
284-
cd /enter/your/path/sw4-v3.0
285-
make debug=yes
300+
> cd /enter/your/path/sw4-v3.0
301+
> make debug=yes
286302
\end{verbatim}
287303
In this case, the executable will be located in
288304
\begin{verbatim}
@@ -342,8 +358,8 @@ \subsection{Building \emph{SW4} with PROJ, HDF5, and ZFP support}
342358
You then need to re-compile \emph{SW4}. Go to the \emph{SW4} main directory, clean out the previous
343359
object files and executable, and re-run make:
344360
\begin{verbatim}
345-
make clean
346-
make
361+
> make clean
362+
> make
347363
\end{verbatim}
348364
If all goes well, the ``SW4 lives'' banner is shown after the make command is
349365
completed. As before, the \verb+sw4+ executable will be located in the \verb+optimize+ or
@@ -358,8 +374,8 @@ \subsection{Testing the \emph{SW4} installation}
358374
\verb+test_sw4.py+. If the \verb+sw4+ executable resides in the \verb+optimize+ directory, you can
359375
run the basic tests by doing:
360376
\begin{verbatim}
361-
cd pytest
362-
./test_sw4.py ("./test_sw4.py -u 0" if HDF5 is not installed)
377+
> cd pytest
378+
> ./test_sw4.py ("./test_sw4.py -u 0" if HDF5 is not installed)
363379
\end{verbatim}
364380
If all goes well, you should see the following output:
365381
\begin{verbatim}
@@ -374,7 +390,7 @@ \subsection{Testing the \emph{SW4} installation}
374390
\verb+test_sw4.py+. For a complete list of options do \verb+test_sw4.py --help+, which currently
375391
give the output:
376392
\begin{verbatim}
377-
./test_sw4.py --help
393+
> ./test_sw4.py --help
378394
usage: test_sw4.py [-h] [-v] [-l {0,1,2}] [-m MPITASKS] [-d SW4_EXE_DIR]
379395
380396
optional arguments:

0 commit comments

Comments
 (0)