message: [Python] initial attempt to automatically find PYTHON_LIB path
diff: @@ -33,9 +33,34 @@ USE_HDF ?= 0 # Include HDF5 support (requires HDF5)
  ALT_MAPPERS ?= 0 # Include alternative mappers (not recommended)
  USE_PYTHON := 1
  -PYTHON_EXE ?= python3.7
  -#PYTHON_LIB ?= /usr/lib64/libpython3.6m.so.1.0
  -PYTHON_VERSION_MAJOR ?= 3
  +ifndef PYTHON_LIB
  + ifndef PYTHON_ROOT
  + PYTHON_EXE := $(shell which python3 | head -1)
  + ifeq ($(PYTHON_EXE),)
  + $(error cannot find python - set PYTHON_ROOT if not in PATH)
  + endif
  + PYTHON_VERSION_MAJOR := $(shell $(PYTHON_EXE) -c 'import sys; print(sys.version_info.major)')
  + PYTHON_VERSION_MINOR := $(shell $(PYTHON_EXE) -c 'import sys; print(sys.version_info.minor)')
  + PYTHON_ROOT := $(dir $(PYTHON_EXE))
  + endif
  +
  + # Try searching for common locations of the Python shared library.
  + ifneq ($(strip $(PYTHON_ROOT)),)
  + ifeq ($(strip $(DARWIN)),1)
  + PYTHON_EXT := dylib
  + else
  + PYTHON_EXT := so
  + endif
  + PYTHON_LIB := $(wildcard $(PYTHON_ROOT)/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.$(PYTHON_EXT))
  + ifeq ($(strip $(PYTHON_LIB)),)
  + PYTHON_LIB := $(wildcard $(abspath $(PYTHON_ROOT)/../lib/libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.$(PYTHON_EXT)))
  + ifeq ($(strip $(PYTHON_LIB)),)
  + $(warning cannot find libpython$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)*.$(PYTHON_EXT) - falling back to using LD_LIBRARY_PATH)
  + PYTHON_LIB :=
  + endif
  + endif
  + endif
  +endif
  # Put the binary file name here
  OUTFILE ?= flexflow_python
  