Skip to content

Commit

Permalink
Use python itself to get the extension suffix, not python-config (#8148)
Browse files Browse the repository at this point in the history
* Use python itself to get the extension suffix, not python-config

* Add a comment
  • Loading branch information
abadams authored Mar 12, 2024
1 parent 009fe7a commit 3c2d809
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/onnx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ ifeq ($(UNAME), Darwin)
# Keep OS X builds from complaining about missing libpython symbols
PYBIND11_CFLAGS += -undefined dynamic_lookup
endif
PY_EXT = $(shell $(PYTHON)-config --extension-suffix)
# Get the python extension module suffix from python itself. You can
# also do this with python-config, but that's not resistant to version
# mismatches between python and python-config. This can happen when
# using a virtualenv, because virtualenvs override python, but not
# python-config.
PY_EXT = $(shell $(PYTHON) -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))')
PY_MODEL_EXT = model_cpp$(PY_EXT)
PYCXXFLAGS = $(PYBIND11_CFLAGS) $(CXXFLAGS) -Wno-deprecated-register

Expand Down

0 comments on commit 3c2d809

Please sign in to comment.