Skip to content

Commit bc3f1a6

Browse files
Merge pull request #63 from pypr/update-install
Update installation instructions a little.
2 parents 4e509b7 + 4469a9a commit bc3f1a6

File tree

1 file changed

+58
-8
lines changed

1 file changed

+58
-8
lines changed

docs/source/installation.rst

+58-8
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,24 @@ that is compatible with your Python installation. In addition, if you need to
1717
use OpenMP you will need to make sure your compiler is compatible with that.
1818
Some additional information on this is included below.
1919

20+
Installing the bleeding edge
21+
----------------------------
22+
23+
Note that if you want the latest bleeding edge of compyle, clone the
24+
repository and install compyle like so::
25+
26+
$ git clone https://github.com/pypr/compyle
27+
$ cd compyle
28+
$ python setup.py develop
29+
# Or
30+
$ pip install -e .
31+
32+
If you just want the latest version and do not want to clone the repository,
33+
you can also do::
34+
35+
$ pip install https://github.com/pypr/compyle/zipball/master
36+
37+
2038
.. _PyOpenCL: https://documen.tician.de/pyopencl/
2139
.. _OpenCL: https://www.khronos.org/opencl/
2240
.. _Cython: http://www.cython.org
@@ -36,12 +54,34 @@ with (on apt-compatible systems)::
3654
$ sudo apt-get install libgomp1
3755

3856

39-
Setting up on MacOS
40-
---------------------
57+
Installation with conda on MacOS
58+
---------------------------------
59+
60+
Recent conda_ packages make the process of setup very easy on MacOS assuming
61+
that you have the `XCode command line utilities`_ installed. Please make sure
62+
you install this.
4163

42-
Ensure that you have gcc or clang installed by installing XCode. See `this
43-
<http://stackoverflow.com/questions/12228382/after-install-xcode-where-is-clang>`_
44-
if you installed XCode but can't find clang or gcc.
64+
For example with conda-forge_ the following creates a new Python 3.8
65+
environment with compyle installed and working with both OpenMP and OpenCL::
66+
67+
$ conda create -c conda-forge -n py38 python=3.8 numpy pyopencl
68+
$ conda activate py38 # or a suitable such invocation
69+
$ pip install compyle
70+
71+
Note that the above implicitly installs the ``llvm-openmp`` package in the
72+
environment which works out of the box with clang and provides OpenMP support.
73+
74+
.. _conda: https://docs.conda.io/
75+
.. _conda-forge: https://conda-forge.org/
76+
.. _XCode command line utilities: http://stackoverflow.com/questions/12228382/after-install-xcode-where-is-clang
77+
78+
79+
Possible issues on MacOS
80+
--------------------------
81+
82+
Ensure that you have gcc or clang installed by installing XCode. See
83+
installing `XCode command line utilities`_ if you installed XCode but can't
84+
find clang or gcc.
4585

4686
If you are getting strange errors of the form::
4787

@@ -62,17 +102,22 @@ in your default environment (``.bashrc`` for bash shells) so you do not have
62102
to do this every time.
63103

64104

105+
65106
OpenMP on MacOS
66107
~~~~~~~~~~~~~~~~
67108

109+
These instructions are a bit old and only if you are not using conda as
110+
discussed above.
111+
68112
The default clang compiler available on MacOS uses an LLVM backend and does
69-
not support OpenMP_. There are two ways to support OpenMP. The first involves
70-
installing the OpenMP support for clang. This can be done with brew_ using::
113+
not support OpenMP_ out of the box. There are two ways to support OpenMP. The
114+
first involves installing the OpenMP support for clang. This can be done with
115+
brew_ using::
71116

72117
$ brew install libomp
73118

74119
Once that is done, it should "just work". If you get strange errors, try
75-
setting the ``MACOSX_DEPLOYMENT_TARGET`` as shown above.
120+
setting the ``MACOSX_DEPLOYMENT_TARGET`` as shown in the previous section.
76121

77122
Another option is to install GCC for MacOS available on brew_ using ::
78123

@@ -121,3 +166,8 @@ documentation for PyOpenCL_ and PyCUDA_. Once those packages work correctly,
121166
you should be all set. Note that if you are only using OpenCL/CUDA you do not
122167
need to have Cython or a C/C++ compiler. Some features on CUDA require the use
123168
of the CuPy_ library.
169+
170+
If you want to use OpenCL support, you will need to install the ``pyopencl``
171+
package (``conda install -c conda-forge pyopencl`` or ``pip install
172+
pyopencl``). For CUDA Support, you will need to install ``pycuda`` and
173+
``cupy``. Of course this assumes you have the required hardware for this.

0 commit comments

Comments
 (0)