macos.rst 1.41 KB
Newer Older
Victor Yu's avatar
Victor Yu committed
1
.. _macos:
2

Victor Yu's avatar
Victor Yu committed
3
4
5
=====
macOS
=====
6

Victor Yu's avatar
Victor Yu committed
7
The following instructions have been tested on macOS 11.3.
8

Victor Yu's avatar
Victor Yu committed
9
Requirements:
10

Victor Yu's avatar
Victor Yu committed
11
12
13
- gcc/gfortran (e.g. GCC 9)
- MPICH
- BLAS/LAPACK/ScaLAPACK
14
15
16
17
18
19
- FFTW3
- Python3

Building WEST
~~~~~~~~~~~~~

Victor Yu's avatar
Victor Yu committed
20
WEST executables can be compiled using the following script:
21

Victor Yu's avatar
Victor Yu committed
22
.. code-block:: bash
23
24
25
26
27
28

   $ cat build_west.sh
   #!/bin/bash

   export MY_LIB_PATH=/Users/myname/LIBRARIES

Marco Govoni's avatar
Marco Govoni committed
29
30
   export CPP='cpp-10'
   export CC='gcc-10'
31
32
33
34
   export CFLAGS='-m64 -Wall -Wextra'
   export F77='mpif77'
   export FFLAGS='-m64 -fopenmp'
   export FC='mpif90'
Marco Govoni's avatar
Marco Govoni committed
35
   export MPIF90='mpif90'
36
37
38
39
40
41
   export F90='mpif90'
   export FCFLAGS='-m64 -fopenmp -Wall -fbacktrace -fbounds-check'
   export BLAS_LIBS=${MY_LIB_PATH}/BLAS/libblas.a
   export LAPACK_LIBS=${MY_LIB_PATH}/LAPACK/liblapack.a
   export SCALAPACK_LIBS=${MY_LIB_PATH}/SCALAPACK/libscalapack.a
   export FFT_LIBS="${MY_LIB_PATH}/FFTW3/lib/libfftw3.a ${MY_LIB_PATH}/FFTW3/lib/libfftw3_omp.a"
Marco Govoni's avatar
Marco Govoni committed
42

Victor Yu's avatar
Victor Yu committed
43
44
   ./configure --enable-openmp=yes --enable-parallel=yes --enable-shared=yes --with-scalapack --with-hdf5=no

45
   make -j 4 pw
Victor Yu's avatar
Victor Yu committed
46

47
   cd West
Victor Yu's avatar
Victor Yu committed
48

Marco Govoni's avatar
Marco Govoni committed
49
   make conf PYT=python3 PYT_LDFLAGS="`python3-config --ldflags --embed`"
Marco Govoni's avatar
Marco Govoni committed
50
   make all
51

Victor Yu's avatar
Victor Yu committed
52
To use the script do:
53

Victor Yu's avatar
Victor Yu committed
54
.. code-block:: bash
55
56
57
58
59
60
61
62
63

   $ bash build_west.sh


Running WEST
~~~~~~~~~~~~

We can run the `wstat.x` WEST executables on 2 cores using the following command:

Victor Yu's avatar
Victor Yu committed
64
.. code-block:: bash
65
66
67

   $ export OMP_NUM_THREADS=1
   $ mpirun -np 2 ./wstat.x -i wstat.in > wstat.out