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
Copy file name to clipboardExpand all lines: docs/install.rst
+156-1Lines changed: 156 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,13 @@ For the basic libraries
18
18
* GNU make
19
19
20
20
21
+
Optional:
22
+
23
+
* for building Python wrappers you will need ``python3``, ``pip3`` and ``numpy``.
24
+
* for building standard MATLAB wrappers: MATLAB
25
+
* for modifying MATLAB wrappers (experts only): ``mwrap``
26
+
27
+
21
28
Quick install instructions
22
29
*********************************************
23
30
@@ -52,12 +59,25 @@ You may then link to the FMM library using the ``-lfmm2d`` option.
52
59
To verify successful compilation of the program, run ``make test``
53
60
which compiles some fortran test drivers in ``test/`` linked against
54
61
the static library, after which it
55
-
runs the test programs. The last 4 lines of the terminal output should be::
62
+
runs the test programs. The last 17 lines of the terminal output should be::
56
63
57
64
cat print_testreshelm.txt
58
65
Successfully completed 27 out of 27 tests in hfmm2d testing suite
66
+
Successfully completed 27 out of 27 tests in hf-hfmm2d testing suite
59
67
Successfully completed 27 out of 27 tests in hfmm2d vec testing suite
68
+
Successfully completed 1 out of 1 tests in helm2d_mps testing suite
69
+
cat print_testreslap.txt
70
+
Successfully completed 9 out of 9 tests in cfmm2d testing suite
71
+
Successfully completed 9 out of 9 tests in cfmm2d vec testing suite
72
+
Successfully completed 9 out of 9 tests in lfmm2d testing suite
73
+
Successfully completed 9 out of 9 tests in lfmm2d vec testing suite
74
+
Successfully completed 9 out of 9 tests in rfmm2d testing suite
75
+
Successfully completed 9 out of 9 tests in rfmm2d vec testing suite
76
+
cat print_testresbh.txt
77
+
Successfully completed 1 out of 1 tests in bhfmm2d testing suite
60
78
rm print_testreshelm.txt
79
+
rm print_testreslap.txt
80
+
rm print_testresbh.txt
61
81
62
82
63
83
To verify successful installation of the program, and the correct
@@ -118,6 +138,78 @@ The corresponding makefiles are ``hfmm2d_example.make``,
118
138
``hfmm2d_vec_example.make``, and ``hfmm2d_legacy_example.make``.
119
139
120
140
141
+
Building Python wrappers
142
+
****************************
143
+
144
+
First make sure you have python (version 3 or higher), pip and numpy installed.
145
+
146
+
You may then execute ``make python`` (after copying over the
147
+
operating system specific make.inc.* file to make.inc) which calls
148
+
pip for the install and then runs some tests.
149
+
150
+
To rerun the tests, you may run ``pytest`` in ``python/``
151
+
or alternatively run ``python python/test_hfmm.py`` and
152
+
``python python/test_lfmm.py``.
153
+
154
+
See ``python/hfmmexample.py`` and ``python/lfmmexample.py`` to see
155
+
usage examples for the Python wrappers.
156
+
157
+
.. note::
158
+
On windows, you will need to update ``distutils.cfg`` located in
159
+
``(PYTHON_INSTALL_DIR)\Lib\distutils`` and set it to::
160
+
161
+
[build]
162
+
compiler=mingw32
163
+
164
+
[build_ext]
165
+
compiler=mingw32
166
+
167
+
which forces python to use the mingw compiler for building its
168
+
modules. In case you wish to revert to using VC/C++ for building python
169
+
modules, make sure to update distutils.cfg appropriately.
170
+
171
+
172
+
A few words about Python environments
173
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
+
175
+
There can be confusion and conflicts between various versions of Python and installed packages. It is therefore a very good idea to use virtual environments. Here's a simple way to do it (after installing python-virtualenv)::
176
+
177
+
Open a terminal
178
+
virtualenv -p /usr/bin/python3 env1
179
+
. env1/bin/activate
180
+
181
+
Now you are in a virtual environment that starts from scratch. All pip installed packages will go inside the env1 directory. (You can get out of the environment by typing ``deactivate``)
182
+
183
+
It's advisable to install numpy into a virtual environment using pip as.
184
+
185
+
virtualenv -p /usr/bin/python3 env1
186
+
. env1/bin/activate
187
+
pip install numpy
188
+
189
+
190
+
Building the MATLAB wrappers
191
+
****************************
192
+
193
+
First make sure you have MATLAB installed.
194
+
195
+
Then run ``make matlab`` (after copying over the operating
196
+
system specific make.inc.* file to make.inc) which links the .m files to
197
+
the .c file in the matlab folder.
198
+
199
+
To run tests, you can run ``matlab test_hfmm3d.m`` and
200
+
``matlab test_lfmm3d.m`` and it should return with $0$ crashes.
201
+
202
+
Example codes for demonstrating the Helmholtz and Laplace
203
+
interfaces are ``hfmm3d_example.m`` and ``lfmm3d_example.m``.
204
+
205
+
In order to build the MATLAB routines with the optimized direct kernel
206
+
evaluation routines on a Mac, we recommend building mex with gcc
207
+
instead of clang. The relevant xml files for configuring mex to use
208
+
gcc can be found at https://github.com/danfortunato/matlab-gcc.
209
+
Follow the instructions there to configure mex with gcc, and set
210
+
CC = ``gcc-<version number>`` in your make.inc file.
211
+
212
+
121
213
Tips for installing dependencies
122
214
**********************************
123
215
@@ -170,3 +262,66 @@ Download and install ``git`` for windows
0 commit comments