Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each extension #2042

Merged
merged 1 commit into from

2 participants

@bfroehle

By using a unique symbol for each extension we prevent multiple definition linking errors which arise when statically linking a Python interpreter.

Closes gh-2039.

@bfroehle bfroehle Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each exten…
…sion.

By using a unique symbol for each extension we prevent multiple
definition linking errors which arise when statically linking
a Python interpreter.

Closes gh-2039.
40bbb9b
@mdboom
Owner

Looks good. Seems harmless enough -- I'd like to get someone on Mac to test this before merging.

@mdboom mdboom merged commit b239626 into matplotlib:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 21, 2013
  1. @bfroehle

    Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for each exten…

    bfroehle authored
    …sion.
    
    By using a unique symbol for each extension we prevent multiple
    definition linking errors which arise when statically linking
    a Python interpreter.
    
    Closes gh-2039.
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 setupext.py
View
6 setupext.py
@@ -648,8 +648,12 @@ def check(self):
def add_flags(self, ext):
import numpy
+ # Ensure that PY_ARRAY_UNIQUE_SYMBOL is uniquely defined for
+ # each extension
+ array_api_name = 'MPL_' + ext.name.replace('.', '_') + '_ARRAY_API'
+
ext.include_dirs.append(numpy.get_include())
- ext.define_macros.append(('PY_ARRAY_UNIQUE_SYMBOL', 'MPL_ARRAY_API'))
+ ext.define_macros.append(('PY_ARRAY_UNIQUE_SYMBOL', array_api_name))
class CXX(SetupPackage):
Something went wrong with that request. Please try again.