Skip to content

Commit b1b6f70

Browse files
committed
Document how to set build paths.
1 parent fb302b2 commit b1b6f70

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

INSTALL.rst

+29-4
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,35 @@ etc., you can install the following:
174174

175175
.. note::
176176

177-
Matplotlib depends on non-Python libraries. `pkg-config
178-
<https://www.freedesktop.org/wiki/Software/pkg-config/>`_ can be used
179-
to find required non-Python libraries and thus make the install go more
180-
smoothly if the libraries and headers are not in the expected locations.
177+
Matplotlib depends on non-Python libraries.
178+
179+
On Linux and OSX, pkg-config_ can be used to find required non-Python
180+
libraries and thus make the install go more smoothly if the libraries and
181+
headers are not in the expected locations.
182+
183+
.. _pkg-config: https://www.freedesktop.org/wiki/Software/pkg-config/
184+
185+
If not using pkg-config (in particular on Windows), you may need to set the
186+
include path (to the FreeType, libpng, and zlib headers) and link path (to
187+
the FreeType, libpng, and zlib libraries) explicitly, if they are not in
188+
standard locations. This can be done using standard environment variables
189+
-- on Linux and OSX:
190+
191+
.. code-block:: sh
192+
193+
export CFLAGS='-I/directory/containing/ft2build.h ...'
194+
export LDFLAGS='-L/directory/containing/libfreetype.so ...'
195+
196+
and on Windows:
197+
198+
.. code-block:: bat
199+
200+
set CL=/IC:\directory\containing\ft2build.h ...
201+
set LINK=/LIBPATH:C:\directory\containing\freetype.lib ...
202+
203+
where ``...`` means "also give, in the same format, the directories
204+
containing ``png.h`` and ``zlib.h`` for the include path, and for
205+
``libpng.so``/``png.lib`` and ``libz.so``/``z.lib`` for the link path."
181206

182207
.. note::
183208

0 commit comments

Comments
 (0)