@@ -7,82 +7,82 @@ Install
7
7
Charm4py runs on Linux, macOS, Windows, Raspberry Pi, and a wide variety of clusters and
8
8
supercomputer environments (including many supercomputers in the TOP500).
9
9
10
- Charm4py runs on Python 3.4 +. Charm4py has been tested with the
10
+ Charm4py runs on Python 3.7 +. Charm4py has been tested with the
11
11
following Python implementations:
12
12
CPython (most common implementation) and PyPy _.
13
13
14
14
15
15
.. _PyPy : https://pypy.org
16
16
17
+ Installing Charm4Py binaries (via pip)
18
+ ---------------------------------------
17
19
18
- Installing Charm4Py on a laptop/personal machine
19
- ------------------------------------------------
20
+ The easiest way to install Charm4Py is via pip. Currently, pip wheels are available for Linux and macOS.
20
21
21
- This install process covers the installation of Charm4Py on a laptop or personal machine, as opposed to a cluster.
22
+ To install the latest release of Charm4Py, run::
22
23
23
- Before installing, you need the following prerequisites:
24
- - CPython: numpy, greenlet and cython (``pip3 install 'numpy>=1.10.0' cython greenlet ``)
25
- - PyPy: none
24
+ $ pip install charm4py
26
25
27
- You can get these prerequisites by running the following command::
26
+ This will install the latest stable release of Charm4Py, using the default underlying Charm++ build
27
+ (see the `Charm++ manual `_ for more information on the different builds of Charm++). If you want to
28
+ use a specific Charm++ build, you can install and build Charm4Py from source. Note that the source distribution
29
+ is available via "pip install", but the standard from source build process is via "git clone", as outlined below.
28
30
29
- $ pip3 install -r requirements.txt
31
+ Installing Charm4Py from source
32
+ ------------------------------------------------------------
33
+
34
+ This install process covers the installation of Charm4Py from source.
30
35
31
36
The first step is to clone the Charm4py repository from Git::
32
37
33
38
$ git clone https://github.com/charmplusplus/charm4py.git
34
39
$ cd charm4py
35
40
36
- Next, create a folder called charm_src in the charm4py repo, and then clone the Charm++ repo
37
- into that folder::
41
+ Next, clone the Charm++ repo into charm_src::
38
42
39
- $ mkdir charm_src && cd charm_src
40
- $ git clone https://github.com/charmplusplus/charm.git
43
+ $ git clone https://github.com/charmplusplus/charm.git charm_src/charm
41
44
42
- Once this is done, there are two ways to build Charm4py. The first way is to change back up
43
- into the Charm4Py directory and run the install script ::
45
+ Once this is done, there are two ways to build Charm4py. The first is to simply run the installation
46
+ from the Charm4py root. This method will use the default Charm++ backend ::
44
47
45
48
$ cd ..
46
- $ python3 setup.py install
49
+ $ pip install .
47
50
48
- The other option is to manually build Charm++ before building Charm4py. To do this, change to
49
- the charm directory and run the following build command::
51
+ The other option is to manually build Charm++ before building Charm4py. This may be necessary
52
+ if you want to configure Charm++ differently from the default. To do this, change to
53
+ the charm directory and run the following build command, then build Charm4Py::
50
54
51
55
$ cd charm
52
- $ ./build charm4py netlrts-<os>-<architecture> -j<N> --with-production
53
-
54
- For building on a laptop, you must use a netlrts build of Charm4Py. Check the Charm++ documentation
55
- to identify the correct os and architecture command to pass into the build command. The -j option
56
- is a cmake option that launches N threads for the make.
57
-
58
- Then, return to the charm4py directory and run setup.py::
59
-
56
+ $ ./build charm4py <target-architecture> -j<N> --with-production
60
57
$ cd ../..
61
- $ python3 setup.py install
58
+ $ pip install .
62
59
60
+ Finally, if necessary, when installing dependencies or when running the install script, add the --user
61
+ option to the Python command to complete the installation without permission errors.
63
62
64
63
After building, you can run Charm4py examples. One example you can try is
65
64
array_hello.py, which can be run as follows::
66
65
67
66
$ cd examples/hello
68
67
$ python -m charmrun.start +p2 array_hello.py
69
68
70
- Installing Charm4Py on a cluster machine
71
- ----------------------------------------
69
+ Choosing your target architecture when building from source
70
+ ------------------------------------------------------------
72
71
73
- To install Charm4Py on a cluster machine, you will generally follow the same steps as above, but
74
- with the following changes. First, when building Charm++, use the MPI build instead of the netlrts
75
- build::
72
+ When building from source, as described above, you must chose the appropriate target architecture.
76
73
77
- $ ./build charm4py mpi-<os>-<architecture> -j<N> --with-production
78
-
79
- Next, pass in the MPI option to the python setup script ::
80
-
81
- $ python3 setup.py install --mpi
74
+ For building on a laptop or personal machine, you must use a netlrts build of Charm4Py.
75
+ For example, to build for a personal machine running macOS with ARM processors, using 4 cmake
76
+ threads, you would run ::
77
+
78
+ $ ./build charm4py netlrts-darwin-arm -j4 --with-production
82
79
83
- Finally, if necessary, when installing dependencies or when running the install script, add the --user
84
- option to the Python command to complete the installation without permission errors.
80
+ To install Charm4Py on a cluster machine, you will generally want to chose a different backend.
81
+ For example, to use Charm4Py with MPI, build the Charm backend as follows::
85
82
83
+ $ ./build charm4py mpi-<os>-<architecture> -j<N> --with-production
86
84
85
+ Check the Charm++ documentation to identify the correct os and architecture command
86
+ to pass into the build command.
87
87
88
88
.. _manual : https://charm.readthedocs.io/en/latest/charm++/manual.html#installing-charm
0 commit comments