@@ -39,7 +39,7 @@ Building ModEM with CMake
3939
4040 or if you are in ``ModEM/build ``:
4141
42- ``cmake -S .. -B . -LH ``
42+ ``cmake . . -LH ``
4343
4444Navigate into ModEM and create a new directory, ``build ``. CMake is nice in that
4545it allows us to build out of source. Change directory into this ``build `` directory:
@@ -54,17 +54,13 @@ Now, we can run CMake:
5454
5555.. code-block :: bash
5656
57- $ cmake -S .. -B . -DCMAKE_Fortran_COMPILER=mpifort
58-
59- In the above command, the ``-S .. `` says that CMake should look in the directory
60- above for the source and the ``-B . `` specifies that CMake should build in the
61- current working directory.
57+ $ cmake .. -DCMAKE_Fortran_COMPILER=mpifort
6258
6359 The above command prints some output:
6460
6561.. code-block :: bash
6662
67- $ cmake -S .. -B . -DCMAKE_Fortran_COMPILER=mpifort
63+ $ cmake . . -DCMAKE_Fortran_COMPILER=mpifort
6864 -- The Fortran compiler identification is LLVMFlang 20.1.8
6965 -- Detecting Fortran compiler ABI info
7066 -- Detecting Fortran compiler ABI info - done
@@ -100,7 +96,7 @@ difficulties finding them, you can specify them by using the
10096
10197.. code-block :: bash
10298
103- $ cmake -S .. -B -DLAPACK_LIBRARIES=/path/to/lapacklib/liblapack.a -DBLAS_LIBRARIES=/path/to/lablaslib/libblas.a
99+ $ cmake .. -DLAPACK_LIBRARIES=/path/to/lapacklib/liblapack.a -DBLAS_LIBRARIES=/path/to/lablaslib/libblas.a
104100
105101
106102 After running CMake command above, and you see that the build files have been
@@ -182,7 +178,7 @@ Again, once can use the following to display all the available options:
182178
183179 $ mkdir build
184180 $ cd build
185- $ cmake -B .. -S . -LH
181+ $ cmake . . -LH
186182
187183 * 2D/3D Builds:
188184 * ``-DMODEM_BUILD_DIMS=<2D | 3D> ``
@@ -243,6 +239,39 @@ also explicitly specify your feature set:
243239 $ cmake .. -DCMAKE_Fortran_FLAGS=" -msse4.2"
244240
245241
242+
243+ Building ModEM Spherical Version
244+ ==================================
245+
246+ .. warning ::
247+
248+ The Spherical version of ModEM is experimental and will not work with
249+ traditional MT source setup. MT forward modeling in spherical coordinates
250+ relies on an external 1D forward model and the secondary field formulation
251+ option in ModEM to be physically correct.
252+
253+ Using spherical coordinates with the tradtional MT source setup has not
254+ been shown to be physically accurate.
255+
256+
257+ To build the experimental spherical version of ModEM you can specify the
258+ ``BUILD_SPHERICAL `` argument in CMake:
259+
260+ .. code-block :: bash
261+
262+ $ cmake .. -DBUILD_SPHERICAL=on
263+
264+
265+ After running the above, you will presented with the same warning printed
266+ above, in order to fully build the experimental version, you must also pass the
267+ `FORCE_SPHERICAL ` argument as well:
268+
269+ .. code-block :: bash
270+
271+ $ cmake .. -DBUILD_SPHERICAL=on -DFORCE_SPHERICAL=on
272+ $ make
273+
274+
246275 Building GPU capable ModEM with CMake
247276======================================
248277
@@ -271,7 +300,7 @@ To build ModEM with GPU CUDA we can run the following command:
271300.. code-block :: bash
272301
273302 $ mkdir build; cd build
274- $ cmake -S .. -B . -DCMAKE_Fortran_COMPILER=mpifort -DBUILD_GPU=CUDA
303+ $ cmake . . -DCMAKE_Fortran_COMPILER=mpifort -DBUILD_GPU=CUDA
275304
276305 Again, you may need to specify LAPACK or BLAS libraries, see
277306:ref: `findlapack_n_blas `. After building, you should see confirmation that the
@@ -328,14 +357,14 @@ You can specify your desired compute capability by specifying the
328357
329358.. code-block :: bash
330359
331- $ cmake -S .. -B . -DCMAKE_Fortran_COMPILER=mpifort -DBUILD_GPU=CUDA -DCMAKE_CUDA_ARCHITECTURES=" 35;50;72"
360+ $ cmake . . -DCMAKE_Fortran_COMPILER=mpifort -DBUILD_GPU=CUDA -DCMAKE_CUDA_ARCHITECTURES=" 35;50;72"
332361
333362 This will generate code for Cuda architectures 35, 50 and 72. You can also tell
334363CMake to use whatever capability your GPU can handle with the ``native `` keyword:
335364
336365.. code-block :: bash
337366
338- $ cmake -S .. -B . -DCMAKE_Fortran_COMPILER=mpifort -DBUILD_GPU=CUDA -DCMAKE_CUDA_ARCHITECTURES=" native"
367+ $ cmake . . -DCMAKE_Fortran_COMPILER=mpifort -DBUILD_GPU=CUDA -DCMAKE_CUDA_ARCHITECTURES=" native"
339368
340369 You can also specify ``all `` or ``all-major ``, which will generate code for all
341370or all major version. For more information on available options see:
@@ -404,3 +433,5 @@ Compiling ModEM GPU Code with HIP
404433----------------------------------
405434
406435Compiling the HIP code with CMAKE is currently a WIP.
436+
437+
0 commit comments