Added version to python3 compilation options.

This commit is contained in:
Axel 2020-08-25 14:10:53 +02:00 committed by Marc Garcia Puig
parent 6a156fbf75
commit c2f703b504
6 changed files with 48 additions and 20 deletions

9
Jenkinsfile vendored
View File

@ -43,8 +43,7 @@ pipeline
{
steps
{
sh '. /home/jenkins/.venv/bin/activate'
sh 'make setup'
sh 'make setup ARGS="--py3-version 3.7"'
}
}
stage('ubuntu build')
@ -52,7 +51,7 @@ pipeline
steps
{
sh 'make LibCarla'
sh 'make PythonAPI'
sh 'make PythonAPI ARGS="--py3-version 3.7"'
sh 'make CarlaUE4Editor'
sh 'make examples'
}
@ -69,7 +68,7 @@ pipeline
{
steps
{
sh 'make check ARGS="--all --xml"'
sh 'make check ARGS="--all --xml --py3-version 3.7"'
}
post
{
@ -91,7 +90,7 @@ pipeline
{
steps
{
sh 'make package'
sh 'make package ARGS="--py3-version 3.7"'
sh 'make package ARGS="--packages=AdditionalMaps --clean-intermediate"'
sh 'make examples ARGS="localhost 3654"'
}

View File

@ -18,12 +18,14 @@ BUILD_FOR_PYTHON2=false
BUILD_FOR_PYTHON3=false
BUILD_RSS_VARIANT=false
OPTS=`getopt -o h --long help,rebuild,py2,py3,clean,rss -n 'parse-options' -- "$@"`
OPTS=`getopt -o h --long help,rebuild,py2,py3,clean,rss,py3-version -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2 ; fi
eval set -- "$OPTS"
PY3_VERSION=3
while true; do
case "$1" in
--rebuild )
@ -37,6 +39,10 @@ while true; do
--py3 )
BUILD_FOR_PYTHON3=true;
shift ;;
--py3-version )
PY3_VERSION="$3";
shift
shift ;;
--rss )
BUILD_RSS_VARIANT=true;
shift ;;
@ -53,7 +59,7 @@ while true; do
esac
done
if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_FOR_PYTHON2} || ${BUILD_FOR_PYTHON3}; }; then
if ! { ${REMOVE_INTERMEDIATE} || ${BUILD_FOR_PYTHON2} || ${BUILD_FOR_PYTHON3} ; }; then
fatal_error "Nothing selected to be done."
fi
@ -94,7 +100,7 @@ if ${BUILD_FOR_PYTHON3} ; then
log "Building Python API for Python 3."
/usr/bin/env python3 setup.py bdist_egg
/usr/bin/env python${PY3_VERSION} setup.py bdist_egg
fi

View File

@ -41,12 +41,14 @@ SMOKE_TESTS_2=false
SMOKE_TESTS_3=false
RUN_BENCHMARK=false
OPTS=`getopt -o h --long help,gdb,xml,gtest_args:,all,libcarla-release,libcarla-debug,python-api-2,python-api-3,smoke-2,smoke-3,benchmark -n 'parse-options' -- "$@"`
OPTS=`getopt -o h --long help,gdb,xml,gtest_args:,all,libcarla-release,libcarla-debug,python-api-2,python-api-3,smoke-2,smoke-3,benchmark,py3-version -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2 ; fi
eval set -- "$OPTS"
PY3_VERSION=3
while true; do
case "$1" in
--gdb )
@ -89,6 +91,10 @@ while true; do
RUN_BENCHMARK=true;
GTEST_ARGS="--gtest_filter=benchmark*";
shift ;;
--py3-version )
PY3_VERSION="$3"
shift
shift ;;
-h | --help )
echo "$DOC_STRING"
echo -e "$USAGE_STRING"
@ -197,7 +203,7 @@ if ${PYTHON_API_3} ; then
log "Running Python API for Python 3 unit tests."
/usr/bin/env python3 -m nose2 ${EXTRA_ARGS}
/usr/bin/env python${PY3_VERSION} -m nose2 ${EXTRA_ARGS}
if ${XML_OUTPUT} ; then
mv test-results.xml ${CARLA_TEST_RESULTS_FOLDER}/python-api-3.xml
@ -242,7 +248,7 @@ if ${SMOKE_TESTS_3} ; then
log "Running smoke tests for Python 3."
/usr/bin/env python3 -m nose2 ${EXTRA_ARGS}
/usr/bin/env python${PY3_VERSION} -m nose2 ${EXTRA_ARGS}
if ${XML_OUTPUT} ; then
mv test-results.xml ${CARLA_TEST_RESULTS_FOLDER}/smoke-tests-3.xml

View File

@ -84,25 +84,25 @@ CarlaUE4Editor: LibCarla.server.release
.PHONY: PythonAPI
PythonAPI: LibCarla.client.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py2 --py3
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py2 --py3 $(ARGS)
PythonAPI.2: LibCarla.client.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py2
PythonAPI.3: LibCarla.client.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py3
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py3 $(ARGS)
PythonAPI.rebuild: LibCarla.client.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --rebuild
PythonAPI.rss: LibCarla.client.rss.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py2 --py3 --rss
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py2 --py3 --rss $(ARGS)
PythonAPI.rss.2: LibCarla.client.rss.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py2 --rss
PythonAPI.rss.3: LibCarla.client.rss.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py3 --rss
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --py3 --rss $(ARGS)
PythonAPI.rss.rebuild: LibCarla.client.rss.release osm2odr
@${CARLA_BUILD_TOOLS_FOLDER}/BuildPythonAPI.sh --rebuild --rss
@ -140,7 +140,7 @@ plugins:
@${CARLA_BUILD_TOOLS_FOLDER}/Plugins.sh $(ARGS)
setup:
@${CARLA_BUILD_TOOLS_FOLDER}/Setup.sh
@${CARLA_BUILD_TOOLS_FOLDER}/Setup.sh $(ARGS)
ad-rss:
@${CARLA_BUILD_TOOLS_FOLDER}/Ad-rss.sh

View File

@ -16,7 +16,7 @@ DO_CLEAN_INTERMEDIATE=false
PROPS_MAP_NAME=PropsMap
PACKAGE_CONFIG=Shipping
OPTS=`getopt -o h --long help,config:,no-zip,clean-intermediate,packages: -n 'parse-options' -- "$@"`
OPTS=`getopt -o h --long help,config:,no-zip,clean-intermediate,packages,py3-version: -n 'parse-options' -- "$@"`
if [ $? != 0 ] ; then echo "$USAGE_STRING" ; exit 2 ; fi

View File

@ -1,5 +1,22 @@
#! /bin/bash
# ==============================================================================
# -- Parse arguments -----------------------------------------------------------
# ==============================================================================
PY3_VERSION=3
while true; do
case "$1" in
--py3-version )
PY3_VERSION="$2";
shift
shift ;;
* )
break ;;
esac
done
# ==============================================================================
# -- Set up environment --------------------------------------------------------
# ==============================================================================
@ -139,7 +156,7 @@ else
pushd ${BOOST_BASENAME}-source >/dev/null
py3="/usr/bin/env python3"
py3="/usr/bin/env python${PY3_VERSION}"
py3_root=`${py3} -c "import sys; print(sys.prefix)"`
pyv=`$py3 -c "import sys;x='{v[0]}.{v[1]}'.format(v=list(sys.version_info[:2]));sys.stdout.write(x)";`
./bootstrap.sh \
@ -149,9 +166,9 @@ else
--with-python=${py3} --with-python-root=${py3_root}
if ${TRAVIS} ; then
echo "using python : ${pyv} : ${py3_root}/bin/python3 ;" > ${HOME}/user-config.jam
echo "using python : ${pyv} : ${py3_root}/bin/python${PY3_VERSION} ;" > ${HOME}/user-config.jam
else
echo "using python : ${pyv} : ${py3_root}/bin/python3 ;" > project-config.jam
echo "using python : ${pyv} : ${py3_root}/bin/python${PY3_VERSION} ;" > project-config.jam
fi
./b2 toolset="${BOOST_TOOLSET}" cxxflags="${BOOST_CFLAGS}" --prefix="../${BOOST_BASENAME}-install" -j ${CARLA_BUILD_CONCURRENCY} stage release