From 82f4f11df786b7610212362e158315843ae18d7f Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Tue, 11 Feb 2020 14:43:56 -0500 Subject: [PATCH 01/10] Add Cython CI --- .travis.python.sh | 29 +++++++++++++++++++++++++++++ .travis.yml | 8 ++++++++ 2 files changed, 37 insertions(+) create mode 100644 .travis.python.sh diff --git a/.travis.python.sh b/.travis.python.sh new file mode 100644 index 000000000..d4f65fd9b --- /dev/null +++ b/.travis.python.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -x + +# Install a system package required by our library +sudo apt-get install wget libicu libicu-dev + +CURRDIR=$(pwd) + +mkdir $CURRDIR/build +cd $CURRDIR/build + +cmake $CURRDIR -DCMAKE_BUILD_TYPE=Release \ + -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_UNSTABLE=ON \ + -DGTSAM_USE_QUATERNIONS=OFF \ + -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \ + -DGTSAM_INSTALL_CYTHON_TOOLBOX=ON \ + -DGTSAM_PYTHON_VERSION=Default \ + -DGTSAM_ALLOW_DEPRECATED_SINCE_V4=OFF \ + -DCMAKE_INSTALL_PREFIX=$CURRDIR/../gtsam_install + +make -j$(nproc) install + +cd $CURRDIR/../gtsam_install/cython + +sudo python setup.py install + +cd $CURRDIR/cython/gtsam/tests + +python -m unittest discover \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 14fe66ac1..0afe7a43e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -122,3 +122,11 @@ jobs: compiler: clang env: CC=clang-9 CXX=clang++-9 CMAKE_BUILD_TYPE=Release GTSAM_BUILD_UNSTABLE=OFF GTSAM_USE_QUATERNIONS=ON script: bash .travis.sh -t + - stage: special + os: linux + compiler: gcc + script: bash .travis.python.sh + - stage: special + os: osx + compiler: clang + script: bash .travis.python.sh From 314d94d620fd7bf6adb960a1544266bf1e257825 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Tue, 11 Feb 2020 17:24:32 -0500 Subject: [PATCH 02/10] Fix requirements for building --- .travis.python.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.python.sh b/.travis.python.sh index d4f65fd9b..1151f8434 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -1,11 +1,13 @@ #!/bin/bash -set -x +set -x -e # Install a system package required by our library sudo apt-get install wget libicu libicu-dev CURRDIR=$(pwd) +python -m pip install ./cython/requirements.txt + mkdir $CURRDIR/build cd $CURRDIR/build From ef424bf144a05de3a899dc68ea0a87831e759207 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 12 Feb 2020 00:18:20 -0500 Subject: [PATCH 03/10] Fixing install step --- .travis.python.sh | 2 +- .travis.sh | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.python.sh b/.travis.python.sh index 1151f8434..f909f5307 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -2,7 +2,7 @@ set -x -e # Install a system package required by our library -sudo apt-get install wget libicu libicu-dev +sudo apt-get install wget libicu-dev CURRDIR=$(pwd) diff --git a/.travis.sh b/.travis.sh index bc9029595..9e1e43ad5 100755 --- a/.travis.sh +++ b/.travis.sh @@ -68,6 +68,8 @@ function test () finish } +exit 0 + # select between build or test case $1 in -b) From f59bee260aa16a15354180d920eba18f131c3b4d Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 12 Feb 2020 01:08:32 -0500 Subject: [PATCH 04/10] Fix typo --- .travis.python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.python.sh b/.travis.python.sh index f909f5307..8c51199c2 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -6,7 +6,7 @@ sudo apt-get install wget libicu-dev CURRDIR=$(pwd) -python -m pip install ./cython/requirements.txt +python -m pip install -r ./cython/requirements.txt mkdir $CURRDIR/build cd $CURRDIR/build From 7e7d0668979c3fea42cd16d4a7b2c3af509d92ba Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 12 Feb 2020 10:08:12 -0500 Subject: [PATCH 05/10] Add missing sudo --- .travis.python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.python.sh b/.travis.python.sh index 8c51199c2..701166649 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -6,7 +6,7 @@ sudo apt-get install wget libicu-dev CURRDIR=$(pwd) -python -m pip install -r ./cython/requirements.txt +sudo python -m pip install -r ./cython/requirements.txt mkdir $CURRDIR/build cd $CURRDIR/build From 2a5fe53b2baad0272d6ad384226efe417ebb8a20 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 12 Feb 2020 10:58:16 -0500 Subject: [PATCH 06/10] Disable native flag --- .travis.python.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.python.sh b/.travis.python.sh index 701166649..9b5c4c664 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -1,8 +1,12 @@ #!/bin/bash set -x -e -# Install a system package required by our library -sudo apt-get install wget libicu-dev +if [[ $(uname) == "Darwin" ]]; then + brew install wget +else + # Install a system package required by our library + sudo apt-get install wget libicu-dev +fi CURRDIR=$(pwd) @@ -15,6 +19,7 @@ cmake $CURRDIR -DCMAKE_BUILD_TYPE=Release \ -DGTSAM_BUILD_TESTS=OFF -DGTSAM_BUILD_UNSTABLE=ON \ -DGTSAM_USE_QUATERNIONS=OFF \ -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \ + -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ -DGTSAM_INSTALL_CYTHON_TOOLBOX=ON \ -DGTSAM_PYTHON_VERSION=Default \ -DGTSAM_ALLOW_DEPRECATED_SINCE_V4=OFF \ From 0d28ba2c99886e8dcc73a017975b3aa25627d95d Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 12 Feb 2020 12:48:15 -0500 Subject: [PATCH 07/10] Resume normal CI --- .travis.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.sh b/.travis.sh index 9e1e43ad5..bc9029595 100755 --- a/.travis.sh +++ b/.travis.sh @@ -68,8 +68,6 @@ function test () finish } -exit 0 - # select between build or test case $1 in -b) From d64badbd21a7e8f9c9167569429fb8154e9402e0 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Thu, 13 Feb 2020 16:41:59 -0500 Subject: [PATCH 08/10] Build against Python 3 --- .travis.python.sh | 15 +++++++++++---- .travis.yml | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.travis.python.sh b/.travis.python.sh index 9b5c4c664..5f551976d 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -1,6 +1,13 @@ #!/bin/bash set -x -e +if [ -z ${PYTHON_VERSION+x} ]; then + echo "Please provide the Python version to build against!" + exit 127 +fi + +PYTHON="python${PYTHON_VERSION}" + if [[ $(uname) == "Darwin" ]]; then brew install wget else @@ -10,7 +17,7 @@ fi CURRDIR=$(pwd) -sudo python -m pip install -r ./cython/requirements.txt +sudo $PYTHON -m pip install -r ./cython/requirements.txt mkdir $CURRDIR/build cd $CURRDIR/build @@ -21,7 +28,7 @@ cmake $CURRDIR -DCMAKE_BUILD_TYPE=Release \ -DGTSAM_BUILD_EXAMPLES_ALWAYS=OFF \ -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF \ -DGTSAM_INSTALL_CYTHON_TOOLBOX=ON \ - -DGTSAM_PYTHON_VERSION=Default \ + -DGTSAM_PYTHON_VERSION=$PYTHON_VERSION \ -DGTSAM_ALLOW_DEPRECATED_SINCE_V4=OFF \ -DCMAKE_INSTALL_PREFIX=$CURRDIR/../gtsam_install @@ -29,8 +36,8 @@ make -j$(nproc) install cd $CURRDIR/../gtsam_install/cython -sudo python setup.py install +sudo $PYTHON setup.py install cd $CURRDIR/cython/gtsam/tests -python -m unittest discover \ No newline at end of file +$PYTHON -m unittest discover \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 0afe7a43e..fe9667330 100644 --- a/.travis.yml +++ b/.travis.yml @@ -125,8 +125,10 @@ jobs: - stage: special os: linux compiler: gcc + env: PYTHON_VERSION=3 script: bash .travis.python.sh - stage: special os: osx compiler: clang + env: PYTHON_VERSION=3 script: bash .travis.python.sh From 2c5153f036816a69266662736a0777c71c159da6 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Fri, 14 Feb 2020 11:31:53 -0500 Subject: [PATCH 09/10] Fix Linux build --- .travis.python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.python.sh b/.travis.python.sh index 5f551976d..d126e26ff 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -12,7 +12,7 @@ if [[ $(uname) == "Darwin" ]]; then brew install wget else # Install a system package required by our library - sudo apt-get install wget libicu-dev + sudo apt-get install wget libicu-dev python3-pip fi CURRDIR=$(pwd) From a7b8bf8e6ffc4c593615b858e6fb05a8b97547fe Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Fri, 14 Feb 2020 13:44:00 -0500 Subject: [PATCH 10/10] Include setuptools --- .travis.python.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.python.sh b/.travis.python.sh index d126e26ff..1ef5799aa 100644 --- a/.travis.python.sh +++ b/.travis.python.sh @@ -12,7 +12,7 @@ if [[ $(uname) == "Darwin" ]]; then brew install wget else # Install a system package required by our library - sudo apt-get install wget libicu-dev python3-pip + sudo apt-get install wget libicu-dev python3-pip python3-setuptools fi CURRDIR=$(pwd)