Skip to content

Don't explicitly add default include paths to Extensions #13064

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ install:
# and for the wheels
- del %LIBRARY_LIB%\png.lib
- del %LIBRARY_LIB%\z.lib
- set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.
# enables the local freetype build
- set MPLLOCALFREETYPE=1
# Show the installed packages + versions
- conda list

test_script:
# Now build the thing..
- set LINK=/LIBPATH:%cd%\lib
- pip install -ve .
# these should show no z, png, or freetype dll...
- set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe"
Expand Down
33 changes: 29 additions & 4 deletions INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,35 @@ etc., you can install the following:

.. note::

Matplotlib depends on non-Python libraries. `pkg-config
<https://www.freedesktop.org/wiki/Software/pkg-config/>`_ can be used
to find required non-Python libraries and thus make the install go more
smoothly if the libraries and headers are not in the expected locations.
Matplotlib depends on non-Python libraries.

On Linux and OSX, pkg-config_ can be used to find required non-Python
libraries and thus make the install go more smoothly if the libraries and
headers are not in the expected locations.

.. _pkg-config: https://www.freedesktop.org/wiki/Software/pkg-config/

If not using pkg-config (in particular on Windows), you may need to set the
include path (to the FreeType, libpng, and zlib headers) and link path (to
the FreeType, libpng, and zlib libraries) explicitly, if they are not in
standard locations. This can be done using standard environment variables
-- on Linux and OSX:

.. code-block:: sh

export CFLAGS='-I/directory/containing/ft2build.h ...'
export LDFLAGS='-L/directory/containing/libfreetype.so ...'

and on Windows:

.. code-block:: bat

set CL=/IC:\directory\containing\ft2build.h ...
set LINK=/LIBPATH:C:\directory\containing\freetype.lib ...

where ``...`` means "also give, in the same format, the directories
containing ``png.h`` and ``zlib.h`` for the include path, and for
``libpng.so``/``png.lib`` and ``libz.so``/``z.lib`` for the link path."

.. note::

Expand Down
4 changes: 0 additions & 4 deletions build_alllocal.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,5 @@ mkdir lib || cmd /c "exit /b 0"
copy %LIBRARY_LIB%\zlibstatic.lib lib\z.lib
copy %LIBRARY_LIB%\libpng_static.lib lib\png.lib

:: Make the header files and the rest of the static libs available during the build
:: CONDA_PREFIX is a env variable which is set to the currently active environment path
set MPLBASEDIRLIST=%CONDA_PREFIX%\Library\;.

:: build the target
python setup.py %TARGET%
10 changes: 10 additions & 0 deletions doc/api/next_api_changes/2018-12-29-AL.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Changes to search paths for FreeType and libpng
```````````````````````````````````````````````

The ``MPLBASEDIRLIST`` environment variables and ``basedirlist`` entry in
``setup.cfg`` have no effect anymore. Instead, if building in situations where
FreeType or libpng are not in the compiler or linker's default path, set the
standard environment variables ``CFLAGS``/``LDFLAGS`` on Linux or OSX, or
``CL``/``LINK`` on Windows, to indicate the relevant paths.

See details in :file:`INSTALL.rst`.
5 changes: 0 additions & 5 deletions setup.cfg.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@

[egg_info]

[directories]
# Uncomment to override the default basedir in setupext.py.
# This can be a single directory or a comma-delimited list of directories.
#basedirlist = /usr

[test]
# If you plan to develop Matplotlib and run or add to the test suite,
# set this to True. It will download and build a specific version of
Expand Down
Loading