From 588198c5dda256ce6b0cd72d7b1953e86b7fca92 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 15 Dec 2020 16:07:49 -0500 Subject: [PATCH] Add --embed to python-config for legacy build Newer versions of Python (v3.9) do not include the python library in their python-config --ldflags unless you also pass --embed. --- lib/python/Makefile.lammps | 2 +- lib/python/Makefile.lammps.python3 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/python/Makefile.lammps b/lib/python/Makefile.lammps index 4289674e99..e4afa70456 100644 --- a/lib/python/Makefile.lammps +++ b/lib/python/Makefile.lammps @@ -2,6 +2,6 @@ # See the README file for more explanation python_SYSINC = $(shell which python-config > /dev/null 2>&1 && python-config --includes || :) -python_SYSLIB = $(shell which python-config > /dev/null 2>&1 && python-config --ldflags || :) +python_SYSLIB = $(shell which python-config > /dev/null 2>&1 && python-config --ldflags --embed > /dev/null 2>&1 && python-config --ldflags --embed || (which python-config > /dev/null 2>&1 && python-config --ldflags || :) ) python_SYSPATH = PYTHON=python diff --git a/lib/python/Makefile.lammps.python3 b/lib/python/Makefile.lammps.python3 index 5c43b45ff6..d37e822327 100644 --- a/lib/python/Makefile.lammps.python3 +++ b/lib/python/Makefile.lammps.python3 @@ -2,6 +2,6 @@ # See the README file for more explanation python_SYSINC = $(shell which python3-config > /dev/null 2>&1 && python3-config --includes || (which python-config > /dev/null 2>&1 && python-config --includes || :)) -python_SYSLIB = $(shell which python3-config > /dev/null 2>&1 && python3-config --ldflags || (which python-config > /dev/null 2>&1 && python-config --ldflags || :)) +python_SYSLIB = $(shell which python3-config > /dev/null 2>&1 && python3-config --ldflags --embed > /dev/null 2>&1 && python3-config --ldflags --embed || (which python3-config > /dev/null 2>&1 && python3-config --ldflags || (which python-config > /dev/null 2>&1 && python-config --ldflags || :) ) ) python_SYSPATH = PYTHON=$(shell which python3 > /dev/null 2>&1 && echo python3 || echo python)