Skip to content
Permalink
Browse files

Fixed CI (#590)

Fixed an issue introduced in a recent release of Azure Pipelines. It seems that the python running on the CI machines does not correctly identify the library path where libpython is with the LIBDIR config variable. This commit exposes an environment varible that allows the use to specift the python library path by hand.
  • Loading branch information...
mikand authored and marcogario committed Jun 17, 2019
1 parent 8936426 commit 9bbc0494bdf5a4853a5f7a3f28a67a0ae013bc0a
Showing with 14 additions and 2 deletions.
  1. +6 −0 ci/install_unix.sh
  2. +2 −0 ci/run_unix.sh
  3. +3 −1 pysmt/cmd/installers/btor.py
  4. +3 −1 pysmt/cmd/installers/cvc4.py
@@ -28,13 +28,19 @@ function os_install {
fi
}



# Use python or pypy as commands depending on the build
PYTHON="python"
if [ "${PYTHON_VERSION}" == "pypy" ] || [ "${PYTHON_VERSION}" == "pypy3" ]
then
PYTHON="${PYTHON_VERSION}"
fi

# Fix problem with LIBDIR of Azure Pipelines
VRS=`python -c 'import platform;print(platform.python_version())'`
export PYSMT_PYTHON_LIBDIR="/opt/hostedtoolcache/Python/${VRS}/x64/lib/"

# 'pip install' command
PIP_INSTALL="${PYTHON} -m pip install --upgrade"

@@ -1,5 +1,7 @@
#!/bin/bash

set -ev

PYTHON="python"
if [ "${PYTHON_VERSION}" == "pypy" ] || [ "${PYTHON_VERSION}" == "pypy3" ]
then
@@ -46,7 +46,9 @@ def compile(self):
# vs python 3.
import distutils.sysconfig as sysconfig
import sys
PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
PYTHON_LIBRARY = os.environ.get('PYSMT_PYTHON_LIBDIR')
if not PYTHON_LIBRARY:
PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
PYTHON_INCLUDE_DIR = sysconfig.get_python_inc()
PYTHON_EXECUTABLE = sys.executable
CMAKE_OPTS = ' -DPYTHON_LIBRARY=' + PYTHON_LIBRARY
@@ -57,7 +57,9 @@ def compile(self):
# Inject Python library and include paths into CMake because CVC4 search
# system can be fooled in some systems
import distutils.sysconfig as sysconfig
PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
PYTHON_LIBRARY = os.environ.get('PYSMT_PYTHON_LIBDIR')
if not PYTHON_LIBRARY:
PYTHON_LIBRARY = sysconfig.get_config_var('LIBDIR')
PYTHON_INCLUDE_DIR = sysconfig.get_python_inc()
SolverInstaller.run(['sed', '-i',
's|cmake_opts=""|cmake_opts="-DPYTHON_LIBRARY=' + PYTHON_LIBRARY + ' -DPYTHON_INCLUDE_DIR=' + PYTHON_INCLUDE_DIR + '"|g',

0 comments on commit 9bbc049

Please sign in to comment.
You can’t perform that action at this time.