Fix for conda-compatible build
Build _catboost.so on linux for GLIBC 2.12
@@ -11,8 +11,22 @@ if [[ -z "${CUDA_ARG}" ]]; then
echo 'missing CUDA_ARG variable, should be something like "-DCUDA_ROOT=/usr/local/cuda-9.1/"'
fi
-python ya make -r -DOS_SDK=local $CUDA_ARG -o . catboost/app
-strip catboost/app/catboost
+function python_version {
+ case `$1 --version 2>&1` in
+ Python*2.7*) echo 2.7 ;;
+ Python*3.5*) echo 3.5 ;;
+ Python*3.6*) echo 3.6 ;;
+ Python*3.7*) echo 3.7 ;;
+ *) echo "Cannot determine python version" ; exit 1 ;;
+ esac
+}
+
+case `uname -s` in
+ Linux) OS_SDK="-DOS_SDK=ubuntu-10" USE_SYSTEM_PYTHON="-DUSE_SYSTEM_PYTHON=`python_version python`" ;;
+ *) OS_SDK="-DOS_SDK=local" ;;
+esac
+
+python ya make -r -DNO_DEBUGINFO $OS_SDK $USE_SYSTEM_PYTHON $CUDA_ARG -o . catboost/app
echo "Starting R package build"
cd catboost/R-package
@@ -28,7 +42,7 @@ cp -r inst catboost
cp -r man catboost
cp -r tests catboost
-python ../../ya make -r -DNO_DEBUGINFO -T src -DOS_SDK=local $CUDA_ARG
+python ../../ya make -r -DNO_DEBUGINFO -T src $OS_SDK $USE_SYSTEM_PYTHON $CUDA_ARG
mkdir -p catboost/inst/libs
cp $(readlink src/libcatboostr.so) catboost/inst/libs
@@ -40,19 +54,19 @@ cd ../python-package
PY27=2.7.14
pyenv install -s $PY27
pyenv shell $PY27
-python mk_wheel.py -DOS_SDK=local $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python2-config
+python mk_wheel.py $OS_SDK -DUSE_SYSTEM_PYTHON=2.7 $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python2-config
PY35=3.5.5
pyenv install -s $PY35
pyenv shell $PY35
-python mk_wheel.py -DOS_SDK=local $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python3-config
+python mk_wheel.py $OS_SDK -DUSE_SYSTEM_PYTHON=3.5 $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python3-config
PY36=3.6.6
pyenv install -s $PY36
pyenv shell $PY36
-python mk_wheel.py -DOS_SDK=local $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python3-config
+python mk_wheel.py $OS_SDK -DUSE_SYSTEM_PYTHON=3.6 $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python3-config
PY37=3.7.0
pyenv install -s $PY37
pyenv shell $PY37
-python mk_wheel.py -DOS_SDK=local $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python3-config
+python mk_wheel.py $OS_SDK -DUSE_SYSTEM_PYTHON=3.7 $CUDA_ARG -DPYTHON_CONFIG=$(pyenv prefix)/bin/python3-config
