From 206e253674650c0984ff044611553fe926ecc3d2 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Fri, 27 Aug 2021 23:49:12 +0200 Subject: [PATCH 01/14] CI test for https://github.com/coin-or/CppAD/issues/112 --- .github/workflows/ci-windows-clang.yml | 96 +++++++++++++++++++++++ .github/workflows/conda/conda-env-win.yml | 8 ++ 2 files changed, 104 insertions(+) create mode 100644 .github/workflows/ci-windows-clang.yml create mode 100644 .github/workflows/conda/conda-env-win.yml diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml new file mode 100644 index 0000000..820c6e5 --- /dev/null +++ b/.github/workflows/ci-windows-clang.yml @@ -0,0 +1,96 @@ +name: PyCppAD CI for Windows - Clang +on: + pull_request: + push: + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + name: [windows-latest-clang-cl] + + include: + - name: windows-latest-clang-cl + os: windows-2019 + compiler: clang-cl + + steps: + - uses: actions/checkout@v2 + - name: Checkout submodules + run: | + git submodule update --init + - uses: goanpeca/setup-miniconda@v1 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + with: + activate-environment: pycppad + environment-file: .github/workflows/conda/conda-env-win.yml + python-version: 3.7 + - name: Install cmake and update conda + run: | + conda install cmake -c main + - name: Build CppADCodeGen, CppAD, PyCppAD + shell: cmd /C CALL {0} + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: 'true' + run: | + :: unset extra Boost envs + set Boost_ROOT= + set BOOST_ROOT_1_69_0= + set BOOST_ROOT_1_72_0= + set PATH=%PATH:C:\hostedtoolcache\windows\Boost\1.72.0;=% + + call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 + + :: Create build directory + git checkout --recursive https://github.com/coin-or/CppAD + cd CppAD + cmake ^ + -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ + -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ + .. + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + cd .. + + git checkout --recursive https://github.com/joaoleal/CppADCodeGen + cd CppADCodeGen + cmake ^ + -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ + -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ + .. + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + cd .. + + + mkdir build + pushd build + + + :: Configure + cmake ^ + -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ + -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ + -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ + -DPYTHON_SITELIB=%CONDA_PREFIX%\Lib\site-packages ^ + -DPYTHON_EXECUTABLE=%CONDA_PREFIX%\python.exe ^ + -DBUILD_WITH_CPPAD_CODEGEN_BINDINGS=ON ^ + .. + + :: Build + cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + + :: Testing + set PATH=%PATH%;%CONDA_PREFIX%\Lib\site-packages\pycppad + ctest --output-on-failure -C Release -V + + :: Test Python import + cd .. + python -c "import pycppad" diff --git a/.github/workflows/conda/conda-env-win.yml b/.github/workflows/conda/conda-env-win.yml new file mode 100644 index 0000000..523b3e6 --- /dev/null +++ b/.github/workflows/conda/conda-env-win.yml @@ -0,0 +1,8 @@ +name: pycppad +channels: + - conda-forge + - nodefaults +dependencies: + - boost + - eigenpy + - python \ No newline at end of file From dbcb0f007faa4486f5ab1d2ff3e36f35e984355e Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Fri, 27 Aug 2021 23:58:31 +0200 Subject: [PATCH 02/14] fix path --- .github/workflows/ci-windows-clang.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index 820c6e5..faf6659 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -57,7 +57,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install - cd .. + cd ../../ git checkout --recursive https://github.com/joaoleal/CppADCodeGen cd CppADCodeGen @@ -67,7 +67,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install - cd .. + cd ../../ mkdir build From 969816854d8f4714b5bb3d0fa6b89d83fdb90c60 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 00:09:12 +0200 Subject: [PATCH 03/14] fix command --- .github/workflows/ci-windows-clang.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index faf6659..95ed9ea 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -49,7 +49,7 @@ jobs: call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 :: Create build directory - git checkout --recursive https://github.com/coin-or/CppAD + git clone --recursive https://github.com/coin-or/CppAD cd CppAD cmake ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ @@ -59,7 +59,7 @@ jobs: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install cd ../../ - git checkout --recursive https://github.com/joaoleal/CppADCodeGen + git clone --recursive https://github.com/joaoleal/CppADCodeGen cd CppADCodeGen cmake ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ From e224c78bea585e527f17acb3c13a21ce8c1f0635 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 08:43:19 +0200 Subject: [PATCH 04/14] build dir fix --- .github/workflows/ci-windows-clang.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index 95ed9ea..2bb0383 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -51,22 +51,26 @@ jobs: :: Create build directory git clone --recursive https://github.com/coin-or/CppAD cd CppAD + mkdir build + cd build cmake ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + make install cd ../../ git clone --recursive https://github.com/joaoleal/CppADCodeGen cd CppADCodeGen + mkdir build + cd build cmake ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. - cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target install + make install cd ../../ From b7acc283024377c8e735bb6565a77dbd4a17a2b9 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 08:55:25 +0200 Subject: [PATCH 05/14] fix --- .github/workflows/ci-windows-clang.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index 2bb0383..658639f 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -52,25 +52,26 @@ jobs: git clone --recursive https://github.com/coin-or/CppAD cd CppAD mkdir build - cd build + pushd build cmake ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. + cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target install make install cd ../../ git clone --recursive https://github.com/joaoleal/CppADCodeGen cd CppADCodeGen mkdir build - cd build + pushd build cmake ^ -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. - make install + cmake --build ${{github.workspace}}/CppADCodeGen/build --config ${{env.BUILD_TYPE}} --target install cd ../../ From d12d12b4021f4f8fc9f933dfa49e8afb808b34af Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 09:06:44 +0200 Subject: [PATCH 06/14] fix --- .github/workflows/ci-windows-clang.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index 658639f..8a83ecc 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -59,8 +59,8 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target install - make install - cd ../../ + + cd ${{github.workspace}} git clone --recursive https://github.com/joaoleal/CppADCodeGen cd CppADCodeGen @@ -72,7 +72,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. cmake --build ${{github.workspace}}/CppADCodeGen/build --config ${{env.BUILD_TYPE}} --target install - cd ../../ + cd ${{github.workspace}} mkdir build From 11aefced09a5fe6a7f98bfcd6560ab62cdb36da3 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 09:21:06 +0200 Subject: [PATCH 07/14] add getest --- .github/workflows/conda/conda-env-win.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/conda/conda-env-win.yml b/.github/workflows/conda/conda-env-win.yml index 523b3e6..bbf821c 100644 --- a/.github/workflows/conda/conda-env-win.yml +++ b/.github/workflows/conda/conda-env-win.yml @@ -5,4 +5,5 @@ channels: dependencies: - boost - eigenpy - - python \ No newline at end of file + - python + - gtest From 7026e33812d2886327960bfdf99f3d0cfd8a4711 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 09:33:02 +0200 Subject: [PATCH 08/14] remove gtest. add source --- .github/workflows/ci-windows-clang.yml | 1 + .github/workflows/conda/conda-env-win.yml | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index 8a83ecc..34e0503 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -70,6 +70,7 @@ jobs: -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ + -DGOOGLETEST_GIT=ON .. cmake --build ${{github.workspace}}/CppADCodeGen/build --config ${{env.BUILD_TYPE}} --target install cd ${{github.workspace}} diff --git a/.github/workflows/conda/conda-env-win.yml b/.github/workflows/conda/conda-env-win.yml index bbf821c..d8f75b1 100644 --- a/.github/workflows/conda/conda-env-win.yml +++ b/.github/workflows/conda/conda-env-win.yml @@ -6,4 +6,3 @@ dependencies: - boost - eigenpy - python - - gtest From aef4008f141fa1c729a36ddf204f3e64830a2333 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 09:41:23 +0200 Subject: [PATCH 09/14] fix --- .github/workflows/ci-windows-clang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index 34e0503..b8f9f82 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -70,7 +70,7 @@ jobs: -G "Visual Studio 16 2019" -T "ClangCl" -DCMAKE_GENERATOR_PLATFORM=x64 ^ -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ - -DGOOGLETEST_GIT=ON + -DGOOGLETEST_GIT=ON ^ .. cmake --build ${{github.workspace}}/CppADCodeGen/build --config ${{env.BUILD_TYPE}} --target install cd ${{github.workspace}} From 0fb22138649f1a91ea7a19cc753f6ba03b7e5a4d Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 09:58:00 +0200 Subject: [PATCH 10/14] use local cppad to check support --- .github/workflows/ci-windows-clang.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index b8f9f82..baabee1 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -49,7 +49,7 @@ jobs: call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" amd64 :: Create build directory - git clone --recursive https://github.com/coin-or/CppAD + git clone --recursive https://github.com/proyan/CppAD cd CppAD mkdir build pushd build From 927768cb9b89acaa5d946d0d887b97dabb1d2fc3 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 11:37:22 +0200 Subject: [PATCH 11/14] [ci-windows] make check on cppad --- .github/workflows/ci-windows-clang.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index baabee1..c93f0e5 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -59,6 +59,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target install + make check cd ${{github.workspace}} From 723857aaffa2ac8125eaccfe5065c4cec7f32070 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Sat, 28 Aug 2021 11:58:52 +0200 Subject: [PATCH 12/14] [ci] make check in cppad/build --- .github/workflows/ci-windows-clang.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index c93f0e5..ba59812 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -59,6 +59,7 @@ jobs: -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target install + cd ${{github.workspace}}/CppAD/build/ make check cd ${{github.workspace}} From 79fef1d33923087bd453ea3c17f90364f6cd5509 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Mon, 30 Aug 2021 09:52:49 +0200 Subject: [PATCH 13/14] [ci][windows] make check before make install --- .github/workflows/ci-windows-clang.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index ba59812..e085613 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -58,10 +58,10 @@ jobs: -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. - cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target install + cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} cd ${{github.workspace}}/CppAD/build/ make check - + make install cd ${{github.workspace}} git clone --recursive https://github.com/joaoleal/CppADCodeGen From 27898fdff97253b01b1518f379a0005c3c0a4161 Mon Sep 17 00:00:00 2001 From: Rohan Budhiraja Date: Mon, 30 Aug 2021 10:13:59 +0200 Subject: [PATCH 14/14] [ci][windows] try cmake --target check install --- .github/workflows/ci-windows-clang.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-windows-clang.yml b/.github/workflows/ci-windows-clang.yml index e085613..44bffc8 100644 --- a/.github/workflows/ci-windows-clang.yml +++ b/.github/workflows/ci-windows-clang.yml @@ -58,10 +58,9 @@ jobs: -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library ^ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ^ .. - cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} + cmake --build ${{github.workspace}}/CppAD/build --config ${{env.BUILD_TYPE}} --target check install cd ${{github.workspace}}/CppAD/build/ - make check - make install + cd ${{github.workspace}} git clone --recursive https://github.com/joaoleal/CppADCodeGen