From e061a8e5fe3541551c54764719b2f0e87db3e11b Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Wed, 18 Dec 2019 16:06:02 -0800 Subject: [PATCH 1/9] [CI] Switch CI to GitHub Actions GitHub Actions offers a number of benefits over TravisCI and Appveyor. Related to Cantera/enhancements#37 --- .github/workflows/main.yml | 229 +++++++++++++++++++++++++++++++++++++ .travis.yml | 92 --------------- appveyor.yml | 28 ----- 3 files changed, 229 insertions(+), 120 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000000..3611c51174 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,229 @@ +name: CI + +on: + push: + # Build on tags that look like releases + tags: + - v* + # Build when master or testing is pushed to + branches: + - master + - testing + pull_request: + # Build when a pull request targets master + branches: + - master + +jobs: + multiple-pythons: + name: ${{ matrix.os }} with Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + python-version: [ '3.5', '3.6', '3.7', '3.8' ] + os: [ ubuntu-latest, macos-latest] + fail-fast: false + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Setup python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + - name: Install Apt dependencies + run: sudo apt-get install libboost-dev gfortran + if: runner.os == 'Linux' + - name: Install Brew dependencies + run: brew install boost libomp + if: runner.os == 'macOS' + - name: Upgrade pip + run: python3 -m pip install -U pip setuptools + - name: Install Python dependencies + run: python3 -m pip install ruamel.yaml scons numpy cython h5py + - name: Build Cantera + run: python3 `which scons` build -j2 + - name: Test Cantera + run: python3 `which scons` test + - name: Run Samples + run: python3 `which scons` samples + + # Coverage is its own job because macOS builds of the samples + # use Homebrew gfortran which is not compatible for coverage + # with XCode clang. Also, turning off optimization really + # slows down the tests + coverage: + name: Coverage + runs-on: ubuntu-latest + needs: multiple-pythons + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Setup python + uses: actions/setup-python@v1 + with: + python-version: '3.8' + architecture: x64 + - name: Install Apt dependencies + run: | + sudo apt-get install libboost-dev gfortran liblapack-dev libblas-dev + - name: Upgrade pip + run: python3 -m pip install -U pip setuptools + - name: Install Python dependencies + run: python3 -m pip install ruamel.yaml scons numpy cython gcovr h5py + - name: Build Cantera + run: | + python3 `which scons` build blas_lapack_libs=lapack,blas coverage=y \ + optimize=n -j2 + - name: Test Cantera + run: python3 `which scons` test + - name: Run Samples + run: python3 `which scons` samples + - name: Run Coverage report + run: gcovr -r . -j 2 --xml coverage.xml --print-summary + - name: Upload Coverage to Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + + ubuntu-1604-py2: + # Ubuntu 16.04 using Python 2 to run SCons and the system Python 3 for the interface + name: Python 2 running SCons on Ubuntu 16.04 + runs-on: ubuntu-16.04 + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Install Apt dependencies + run: | + sudo apt-get install libboost-dev gfortran scons python3-numpy \ + python3-pip python3-setuptools libsundials-serial-dev liblapack-dev \ + libblas-dev + - name: Install Python dependencies + run: | + sudo -H /usr/bin/python3 -m pip install ruamel.yaml cython h5py + - name: Build Cantera + run: scons build python_cmd=/usr/bin/python3 blas_lapack_libs=lapack,blas -j2 + - name: Test Cantera + run: scons test + - name: Run Test Problems + run: scons test_problems + - name: Run Samples + run: scons samples + + multiple-sundials: + name: Sundials ${{ matrix.sundials-ver }} + runs-on: ubuntu-latest + strategy: + matrix: + sundials-ver: [ 2, 3, 4, 5.3 ] + fail-fast: false + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - uses: goanpeca/setup-miniconda@v1 + with: + auto-update-conda: true + python-version: 3.8 + channel-priority: strict + channels: conda-forge + name: Set up conda + - name: Install conda dependencies + shell: bash -l {0} + run: | + conda install -q sundials=${{ matrix.sundials-ver}} scons numpy ruamel_yaml \ + cython libboost fmt eigen yaml-cpp h5py + - name: Build Cantera + run: | + scons build extra_inc_dirs=$CONDA_PREFIX/include:$CONDA_PREFIX/include/eigen3 \ + extra_lib_dirs=$CONDA_PREFIX/lib system_fmt=y system_eigen=y system_yamlcpp=y \ + system_sundials=y -j2 VERBOSE=True + shell: bash -l {0} + - name: Test Cantera + run: scons test + shell: bash -l {0} + - name: Run Samples + run: scons samples + shell: bash -l {0} + + cython-latest: + name: Test pre-release version of Cython + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Setup python + uses: actions/setup-python@v1 + with: + python-version: '3.8' + architecture: x64 + - name: Install Apt dependencies + run: sudo apt-get install libboost-dev + - name: Install Python dependencies + run: | + python3 -m pip install ruamel.yaml scons numpy h5py; + python3 -m pip install https://github.com/cython/cython/archive/master.zip --install-option='--no-cython-compile'; + - name: Build Cantera + run: python3 `which scons` build f90_interface=n python_package='full' -j2 + - name: Test Cantera + run: python3 `which scons` test + - name: Run Samples + run: python3 `which scons` samples + + windows: + name: ${{ matrix.os }}, MSVC ${{ matrix.vs-toolset }}, Python ${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ['windows-2019'] + vs-toolset: ['14.0', '14.2'] + python-version: [ '3.5', '3.6', '3.7', '3.8' ] + # Must use windows-2016 image because it installs VS2017 (MSVC 14.1) + # Scons cannot find MSVC 14.1 when VS2019 is installed + include: + - os: 'windows-2016' + vs-toolset: '14.1' + python-version: '3.5' + - os: 'windows-2016' + vs-toolset: '14.1' + python-version: '3.6' + - os: 'windows-2016' + vs-toolset: '14.1' + python-version: '3.7' + - os: 'windows-2016' + vs-toolset: '14.1' + python-version: '3.8' + fail-fast: false + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Set Up Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: 'x64' + - name: Install Python dependencies + run: | + python -m pip install -U pip setuptools + python -m pip install scons pypiwin32 numpy ruamel.yaml cython h5py + - name: Build Cantera + run: | + scons build -j2 boost_inc_dir=%BOOST_ROOT_1_69_0% debug=n VERBOSE=y python_package=full ^ + msvc_version=${{ matrix.vs-toolset }} f90_interface=n + shell: cmd + - name: Test Cantera + run: scons test + - name: Run Samples + run: scons samples diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ea48ca0f41..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,92 +0,0 @@ -language: cpp -sudo: false -dist: xenial -os: - - linux - - osx -addons: - apt: - packages: - - python3-pip - - python3-dev - - python3-numpy - - python3-setuptools - - scons - - python-numpy - - gfortran - - libsundials-serial-dev - - liblapack-dev - - libblas-dev - - libboost-dev - - doxygen - - graphviz - ssh_known_hosts: - - cantera.org - -env: - global: - secure: "IqQ4IVKzZbMCIVrD6t3YQDi3mEiswhTWo3AAKg2CrA+CETads/I9d0g68krKCA2xue0zm9pFVWbs5MT2F6Yq2PNsdvoN3ZMHrpXTN2ZJ7pgukgVwNuBe7B/tm6xBzSbZ4KPIanWCu3TNXsZp9EPG1rdhagAZZ+TeDYdIUKAITjYOVIiiAsqiLllsE9cAq3jkiu/JAxB0tzicxERi1RtnMfL/1d9fupP+yrExwIYo+hhAwWwghdiKzh551sowpbVFVxuOtTJfpC+vh1a/kLo/VTr4DDe6Bdkubc7beU8WZiZNVVbNoydy/qYkKuOzmXu9Llo9flMzJKswR7Szxi8nhD2zc+3pOYxJilWPYtrG4WrJr3WFTU3xZg5KsLwNpCane1uAsrj/NNtMagp+Wj1yOBMDMmHF5GAyCVEgSqY2PLISaEPOPCJV4VihaHyie1hM/A5YlD2VwkkKJTjMIP2VpaLVo9Sr3jXUIhtp/wLNleSWENX7etFjVqhwX1ldhz6+gVrn/H6oS2LwHQwlAseE9O6eqAB5ia+9duYDt7JS5F1P8QMYhz1gaJGXKWBnCEur5XHoGhZ75nyNnpmLjDOHKk5NmQQNL6ltUqg3fX7EWOjzxHlymdZ/4lg5AESj/+nBAhJJcAYRn9hHti7JLMjF6Qk/Kf3pJ6qVBHETY2KivH8=" - - -before_script: | - echo TRAVIS_OS_NAME: $TRAVIS_OS_NAME - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - export CONDA_ARCH="${TRAVIS_OS_NAME}_${BUILD_ARCH}" - curl -S -L https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -o miniconda.sh; - bash miniconda.sh -b -p $HOME/miniconda - source $HOME/miniconda/etc/profile.d/conda.sh && conda activate - conda config --set always_yes yes --set changeps1 no - conda install -q numpy cython scons boost ruamel_yaml h5py - conda install -q -c conda-forge openmp - else - pip3 install --user --upgrade pip - pip3 install --user --upgrade setuptools wheel - pip3 install --user cython - pip3 install --user ruamel.yaml==0.15.94 # Need a version compatible with Python 3.4 - pip3 install --user h5py - - # Install packages for the documentation - pip3 install --user sphinx sphinxcontrib-matlabdomain sphinxcontrib-doxylink - pip3 install --user https://github.com/hagenw/sphinxcontrib-katex/archive/master.tar.gz - fi - rm -f cantera.conf -script: | - set -e - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - scons build -j2 python_cmd=/usr/bin/python3 VERBOSE=y python_package=full blas_lapack_libs=lapack,blas optimize=n coverage=y - scons test - scons samples - scons build sphinx_docs=y doxygen_docs=y sphinx_cmd="/usr/bin/python3 `which sphinx-build`" - if [[ "${TRAVIS_PULL_REQUEST}" == "false" ]] && [[ "${TRAVIS_BRANCH}" == "master" ]] && [[ "${TRAVIS_REPO_SLUG}" == "Cantera/cantera" ]]; then - cd build - find docs -type f | grep -v /xml/ | grep -v .map$ | grep -v .md5$ | tar cjvf docs/dev-docs.tar.bz2 --files-from - >/dev/null - cd - - openssl aes-256-cbc -k "${ctdeploy_pass}" -in ./doc/ctdeploy_key.enc -out ./doc/ctdeploy_key -d - chmod 0600 ./doc/ctdeploy_key - RSYNC_OPTIONS=( - -avzP - --checksum - --rsh='ssh -i ./doc/ctdeploy_key' - --exclude='*.map' - --exclude='*.md5' - --exclude='/doxygen/xml' - --delete - --delete-excluded - ) - RSYNC_USER="ctdeploy" - RSYNC_SERVER="cantera.org" - RSYNC_DEST="cantera/documentation/dev" - DOCS_OUTPUT_DIR="./build/docs/" - rsync "${RSYNC_OPTIONS[@]}" "${DOCS_OUTPUT_DIR}" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST} - else - echo "Skipping documentation upload from source other than Cantera/cantera:master" - fi - else - scons build -j2 python_cmd=python3 VERBOSE=y python_package=full blas_lapack_libs=lapack,blas optimize=n coverage=y extra_inc_dirs=$CONDA_PREFIX/include extra_lib_dirs=$CONDA_PREFIX/lib - scons test - scons samples - fi -after_success: | - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - bash <(curl -s https://codecov.io/bash) - fi diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e24f637ca4..0000000000 --- a/appveyor.yml +++ /dev/null @@ -1,28 +0,0 @@ -version: 1.0.{build} -install: -- ps: | - C:\Python37-x64\python.exe -m pip install --no-cache-dir --upgrade pip - C:\Python37-x64\python.exe -m pip install --upgrade setuptools - C:\Python37-x64\python.exe -m pip install --upgrade --no-warn-script-location wheel - C:\Python37-x64\Scripts\pip.exe install scons==3.0.1 - C:\Python37-x64\Scripts\pip.exe install --no-cache-dir --no-warn-script-location numpy - C:\Python37-x64\Scripts\pip.exe install --no-warn-script-location cython - C:\Python37-x64\Scripts\pip.exe install pypiwin32 - C:\Python37-x64\Scripts\pip.exe install ruamel.yaml - C:\Python37-x64\Scripts\pip.exe install h5py - -build_script: -- cmd: C:\Python37-x64\Scripts\scons build -j2 boost_inc_dir=C:\Libraries\boost_1_62_0 debug=n VERBOSE=y python_package=full -- cmd: C:\Python37-x64\Scripts\scons samples - -test_script: -- ps: | - C:\Python37-x64\Scripts\scons test - $sconsstatus = $lastexitcode - $wc = New-Object 'System.Net.WebClient' - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\work\gtest-general.xml)) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\work\gtest-thermo.xml)) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\work\gtest-equil.xml)) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\work\gtest-kinetics.xml)) - $wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\test\work\gtest-transport.xml)) - if ( $sconsstatus ) { exit $sconsstatus } From 95122f69efd7244872dc341de3e63b51aa2475ec Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Thu, 11 Jun 2020 14:57:36 -0400 Subject: [PATCH 2/9] [CI] Use the pipe-to-Bash method for Codecov Remove samples from coverage build. The tests are what provide the coverage of the code. --- .github/workflows/main.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3611c51174..6a157c3b7e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -74,22 +74,17 @@ jobs: - name: Upgrade pip run: python3 -m pip install -U pip setuptools - name: Install Python dependencies - run: python3 -m pip install ruamel.yaml scons numpy cython gcovr h5py + run: python3 -m pip install ruamel.yaml scons numpy cython h5py - name: Build Cantera run: | python3 `which scons` build blas_lapack_libs=lapack,blas coverage=y \ optimize=n -j2 - name: Test Cantera run: python3 `which scons` test - - name: Run Samples - run: python3 `which scons` samples - - name: Run Coverage report - run: gcovr -r . -j 2 --xml coverage.xml --print-summary - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v1 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml + run: bash <(curl -s https://codecov.io/bash) + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} ubuntu-1604-py2: # Ubuntu 16.04 using Python 2 to run SCons and the system Python 3 for the interface From 25a3758bc4c50c57e2f96f5e76a3f02f1bb473d1 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Sat, 13 Jun 2020 13:55:06 -0400 Subject: [PATCH 3/9] [Doc] KaTeX version is no longer configurable The KaTeX version is no longer configurable in the sphinxcontrib-katex extension. There is now a Python script in the website repository api-docs folder that can bump the KaTeX version in the built documentation to match the version supplied by sphinxcontrib-katex. --- doc/sphinx/conf.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/sphinx/conf.py b/doc/sphinx/conf.py index f641bf24de..1fd191d3d8 100644 --- a/doc/sphinx/conf.py +++ b/doc/sphinx/conf.py @@ -43,8 +43,6 @@ 'sphinx.ext.intersphinx', ] -katex_version = '0.11.1' - autodoc_default_flags = ['members','show-inheritance','undoc-members'] autoclass_content = 'both' From b2517df16ef955aaf46ecb76fd9d74658b71ebc9 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Sat, 13 Jun 2020 14:07:15 -0400 Subject: [PATCH 4/9] [CI] Add the documentation build --- .github/workflows/main.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a157c3b7e..92994e1bc3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: name: Checkout the repository with: submodules: recursive - - name: Setup python + - name: Setup Python uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} @@ -86,6 +86,30 @@ jobs: env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + docs: + name: Build docs and upload to website + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.8' + architecture: x64 + - name: Install Apt dependencies + run: sudo apt-get install libboost-dev doxygen graphviz + - name: Upgrade pip + run: python3 -m pip install -U pip setuptools + - name: Install Python dependencies + run: | + python3 -m pip install ruamel.yaml scons numpy cython sphinx \ + sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink + - name: Build Cantera with documentation + run: python3 `which scons` build doxygen_docs=y sphinx_docs=y + ubuntu-1604-py2: # Ubuntu 16.04 using Python 2 to run SCons and the system Python 3 for the interface name: Python 2 running SCons on Ubuntu 16.04 From f04fad96b0e64cf209a82614005a9d6b4e1c073e Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Thu, 18 Jun 2020 11:38:00 -0400 Subject: [PATCH 5/9] [CI] Upload the documentation to the website Uses the SSH action to add the deploy account SSH key to the configuration and add the Cantera server to the known_hosts. --- .github/workflows/main.yml | 31 +++++++++++++++++++++++++------ doc/ctdeploy_key.enc | Bin 1696 -> 0 bytes 2 files changed, 25 insertions(+), 6 deletions(-) delete mode 100644 doc/ctdeploy_key.enc diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 92994e1bc3..6f409dc0bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: run: python3 `which scons` build -j2 - name: Test Cantera run: python3 `which scons` test - - name: Run Samples + - name: Build Samples run: python3 `which scons` samples # Coverage is its own job because macOS builds of the samples @@ -87,7 +87,7 @@ jobs: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} docs: - name: Build docs and upload to website + name: Build docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -109,6 +109,25 @@ jobs: sphinxcontrib-katex sphinxcontrib-matlabdomain sphinxcontrib-doxylink - name: Build Cantera with documentation run: python3 `which scons` build doxygen_docs=y sphinx_docs=y + # The known_hosts key is generated with `ssh -F cantera.org` from a + # machine that has previously logged in to cantera.org and trusts + # that it logged in to the right machine + - name: Set up SSH key and host for deploy + uses: shimataro/ssh-key-action@v2 + with: + key: ${{ secrets.CTDEPLOY_KEY }} + known_hosts: ${{ secrets.CTDEPLOY_HOST }} + - name: Upload the docs + if: github.event_name == 'push' && github.repository_owner == 'Cantera' && github.ref == 'master' + env: + RSYNC_USER: "ctdeploy" + RSYNC_SERVER: "cantera.org" + RSYNC_DEST: "cantera/documentation/dev" + DOCS_OUTPUT_DIR: "./build/docs/" + run: | + rsync -avzP --checksum --exclude='*.map' --exclude='*.md5' \ + --exclude='/doxygen/xml' --delete --delete-excluded \ + "${DOCS_OUTPUT_DIR}" ${RSYNC_USER}@${RSYNC_SERVER}:${RSYNC_DEST} ubuntu-1604-py2: # Ubuntu 16.04 using Python 2 to run SCons and the system Python 3 for the interface @@ -133,7 +152,7 @@ jobs: run: scons test - name: Run Test Problems run: scons test_problems - - name: Run Samples + - name: Build Samples run: scons samples multiple-sundials: @@ -169,7 +188,7 @@ jobs: - name: Test Cantera run: scons test shell: bash -l {0} - - name: Run Samples + - name: Build Samples run: scons samples shell: bash -l {0} @@ -196,7 +215,7 @@ jobs: run: python3 `which scons` build f90_interface=n python_package='full' -j2 - name: Test Cantera run: python3 `which scons` test - - name: Run Samples + - name: Build Samples run: python3 `which scons` samples windows: @@ -244,5 +263,5 @@ jobs: shell: cmd - name: Test Cantera run: scons test - - name: Run Samples + - name: Build Samples run: scons samples diff --git a/doc/ctdeploy_key.enc b/doc/ctdeploy_key.enc deleted file mode 100644 index 567f9eb43b900414b6fe63bd9006046f7dd9f481..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1696 zcmV;R24DG8VQh3|WM5x_Y}m5S!jc}RPFJ6o5x203&oy3szU2cW!zN70wJzE2z4pYp z{4d7PrTG0HW?^6}HSoQI)HU1otN8CEE}^Zl+&PKcU*<175vhbj7wv1;N4zkne-*$# zI(n3+a9--_PNEe}uj+0-&>og#JVdZ_7uWeWfqyc1=+ey{sH51Lyq?OQnBqpb^RFeD zEHp%;u_Dhk_FFBM3kJ99q3!-dqB(=fAYfq14{>&av>+~F5cqpa6%@8E33N~8$7Q_~ z6*j9Ss7+W!eQTiW916Mt1xoQK(^R!qysO{N@Tg<4Y%;QAO>PqQwS1-l(n5s+T;x*h zrG(EvHMjxgBH7yFW(#qlyb0R$^~wve5iKmn74Cmgop>1%Gc&^jaV$g~sY?OR@`*1` zU-+*jzw1Vj#w6SeeCA?5GLuynJ0-x2Z^^i5b=8LRNZ*>obYNntOLB%;e1Wa^y&GmW z`R0cxK%QNr!x{5mh8lO6{py?J{*{r;OvR$}%HC$kllr+Nj?=D8SWm%Fr~260Rxxlr zKpr`d<|RY^-;+h@xi#aG6ldllZ=a@0t21x6FLa2AI4F1jL=bJ zjbepVq^we`75{ z6z~qgNanaVwF+q%k>8S; z*}ZPz=!6?q9zz*tV~u<1PwK6>XFECd*scex9IbmGq4<`dbS#s>8*Y3S+C#yj4-%ZG z-dy8lQDis~c7xsyH)0(;)i!HnBdbS+P}t#bM>cwtduNp^2Q}>yrJFl%?b7XGej(W* z$v$Oqbd?PYX!ws>lit884j7E2#b7Gi zQ4sa-dl^qyt3>Qo#=}ld-_u7X6wLd=doG6nEKCeD$Ftw$hTBCn>N8;O1r{Pq`G-Tg zF|9KrsgOUXajSc=OYvisn9zo&;1Q@a{M7+lgau;XPZewt2n}t~4RBOmmcg|9_%_zJ z)qloR!N`dVp|Jef_{%5N#1>KX(ILL*$t=8XNCLtaXKyKCv%3Ow5smPip=kbPFu0xj znPC_MsF&YjP7EW3vh5Bp*jJ$$}tP{NwpPXRo)WAwFfmIS{6>amcRO-wZ(uSUh zIuRzN>wzFeWYrW0hM*W-OHtt&H*KcE7vu{KeLPzdrhiBtnw$2{miD~VQ^x}5k+V+I9+$m*qNJ{-dgkZbnIiJP*jWyS|6_7?VRnGY%fWZ~K~B z{TbLHQ%J<}y}6NES_k_S4EmNvjsQOnropUoqA={Va&#hzVJ%nUQ-xjK->A4aUA42P zWlYG<02J9VCnwxGJHhnndtCoB%SMV={|lL^Xtb6Oh2V=8L#tFi@LlQwiQxg*NXdpu zwcP#!QW+JkR!sqD91H}NHT^1DwWvdk8cmAloDZ$gt3_*1A6C<~n(HLJ@2!1n2LoV} zvLV3a4iG{*v?$pcbc@|Im|KCW%AQ>q^^>Z!30YD?EN{h+OZ0gwb_}KoGIYNR5?x?9 z8OyEUXdjvnfb~0Y%YahQa!fFazguKKz-2q+6ac4aln<=gQjdOSb+7mOqxW! From 60f3567613a4e40b12cd99f746ed2f8eef28b541 Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Fri, 26 Jun 2020 12:47:46 -0400 Subject: [PATCH 6/9] Fix building Fortran shared library on macOS The shared library should be linked with the Fortran linker, not the C++ linker. On macOS, the C++ stdlib also has to be linked to the shared library to resolve all the symbols at link time. --- src/fortran/SConscript | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fortran/SConscript b/src/fortran/SConscript index 84816c5baa..29eea1e440 100644 --- a/src/fortran/SConscript +++ b/src/fortran/SConscript @@ -30,11 +30,13 @@ if localenv['layout'] != 'debian': shlib = build(localenv.SharedLibrary(target=sharedName, source=objects, SPAWN=getSpawn(localenv), SHLIBVERSION=localenv['cantera_pure_version'], - LIBS=list(env['cantera_libs']))) + LIBS=list(env['cantera_libs'] + env['cxx_stdlib']), + LINK='$FORTRAN_LINK')) install(localenv.InstallVersionedLib, '$inst_libdir', shlib) else: shlib = build(localenv.SharedLibrary(target=sharedName, source=objects, SPAWN=getSpawn(localenv), - LIBS=list(env['cantera_libs']))) + LIBS=list(env['cantera_libs'] + env['cxx_stdlib']), + LINK='$FORTRAN_LINK')) install('$inst_libdir', shlib) localenv.Depends(shlib, localenv['config_h_target']) From 6580cc22523b144dd4e25e182bcfa4691dae653f Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Fri, 26 Jun 2020 13:37:08 -0400 Subject: [PATCH 7/9] [CI] Split macOS builds into their own job --- .github/workflows/main.yml | 41 +++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f409dc0bf..2a0427f71d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,13 +15,12 @@ on: - master jobs: - multiple-pythons: - name: ${{ matrix.os }} with Python ${{ matrix.python-version }} - runs-on: ${{ matrix.os }} + ubuntu-multiple-pythons: + name: Ubuntu 18.04 with Python ${{ matrix.python-version }} + runs-on: ubuntu-latest strategy: matrix: python-version: [ '3.5', '3.6', '3.7', '3.8' ] - os: [ ubuntu-latest, macos-latest] fail-fast: false steps: - uses: actions/checkout@v2 @@ -35,10 +34,36 @@ jobs: architecture: x64 - name: Install Apt dependencies run: sudo apt-get install libboost-dev gfortran - if: runner.os == 'Linux' + - name: Upgrade pip + run: python3 -m pip install -U pip setuptools + - name: Install Python dependencies + run: python3 -m pip install ruamel.yaml scons numpy cython h5py + - name: Build Cantera + run: python3 `which scons` build -j2 + - name: Test Cantera + run: python3 `which scons` test + - name: Build Samples + run: python3 `which scons` samples + + macos-multiple-pythons: + name: macOS with Python ${{ matrix.python-version }} + runs-on: macos-latest + strategy: + matrix: + python-version: [ '3.5', '3.6', '3.7', '3.8' ] + fail-fast: false + steps: + - uses: actions/checkout@v2 + name: Checkout the repository + with: + submodules: recursive + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 - name: Install Brew dependencies run: brew install boost libomp - if: runner.os == 'macOS' - name: Upgrade pip run: python3 -m pip install -U pip setuptools - name: Install Python dependencies @@ -57,7 +82,7 @@ jobs: coverage: name: Coverage runs-on: ubuntu-latest - needs: multiple-pythons + needs: [ubuntu-multiple-pythons] steps: - uses: actions/checkout@v2 name: Checkout the repository @@ -150,8 +175,6 @@ jobs: run: scons build python_cmd=/usr/bin/python3 blas_lapack_libs=lapack,blas -j2 - name: Test Cantera run: scons test - - name: Run Test Problems - run: scons test_problems - name: Build Samples run: scons samples From 6604b3711b84dbaa65d152a7fb2e8d4c7876629d Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 26 Jun 2020 15:15:19 -0400 Subject: [PATCH 8/9] [Test] Reduce absolute comparison tolerance for Fortran 90 test --- test_problems/SConscript | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test_problems/SConscript b/test_problems/SConscript index fb6e91bdd9..ae4cb0d636 100644 --- a/test_problems/SConscript +++ b/test_problems/SConscript @@ -231,7 +231,8 @@ CompileAndTest('clib', 'clib_test', 'clib_test', extensions=['^clib_test.c'], libs=['cantera_shared']) if env['f90_interface'] == 'y': - Test('f90-demo', 'fortran', '#build/samples/f90/demo', 'f90_demo_blessed.txt') + Test('f90-demo', 'fortran', '#build/samples/f90/demo', 'f90_demo_blessed.txt', + threshold=1e-10) Test('f77-isentropic', 'fortran', '#build/samples/f77/isentropic', 'f77_isentropic_blessed.txt') Test('f77-ctlib', 'fortran', '#build/samples/f77/ctlib', 'f77_ctlib_blessed.txt') From 2a06aecf1920b167707b28ac32342e3adb78d57a Mon Sep 17 00:00:00 2001 From: "Bryan W. Weber" Date: Fri, 26 Jun 2020 16:32:58 -0400 Subject: [PATCH 9/9] [CI] Install the wheel package with pip --- .github/workflows/main.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2a0427f71d..a3ad1eac67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -35,7 +35,7 @@ jobs: - name: Install Apt dependencies run: sudo apt-get install libboost-dev gfortran - name: Upgrade pip - run: python3 -m pip install -U pip setuptools + run: python3 -m pip install -U pip setuptools wheel - name: Install Python dependencies run: python3 -m pip install ruamel.yaml scons numpy cython h5py - name: Build Cantera @@ -65,7 +65,7 @@ jobs: - name: Install Brew dependencies run: brew install boost libomp - name: Upgrade pip - run: python3 -m pip install -U pip setuptools + run: python3 -m pip install -U pip setuptools wheel - name: Install Python dependencies run: python3 -m pip install ruamel.yaml scons numpy cython h5py - name: Build Cantera @@ -97,7 +97,7 @@ jobs: run: | sudo apt-get install libboost-dev gfortran liblapack-dev libblas-dev - name: Upgrade pip - run: python3 -m pip install -U pip setuptools + run: python3 -m pip install -U pip setuptools wheel - name: Install Python dependencies run: python3 -m pip install ruamel.yaml scons numpy cython h5py - name: Build Cantera @@ -127,7 +127,7 @@ jobs: - name: Install Apt dependencies run: sudo apt-get install libboost-dev doxygen graphviz - name: Upgrade pip - run: python3 -m pip install -U pip setuptools + run: python3 -m pip install -U pip setuptools wheel - name: Install Python dependencies run: | python3 -m pip install ruamel.yaml scons numpy cython sphinx \ @@ -229,13 +229,15 @@ jobs: python-version: '3.8' architecture: x64 - name: Install Apt dependencies - run: sudo apt-get install libboost-dev + run: sudo apt-get install libboost-dev liblapack-dev libblas-dev + - name: Upgrade pip + run: python3 -m pip install -U pip setuptools wheel - name: Install Python dependencies run: | python3 -m pip install ruamel.yaml scons numpy h5py; python3 -m pip install https://github.com/cython/cython/archive/master.zip --install-option='--no-cython-compile'; - name: Build Cantera - run: python3 `which scons` build f90_interface=n python_package='full' -j2 + run: python3 `which scons` build blas_lapack_libs=lapack,blas python_package='full' -j2 - name: Test Cantera run: python3 `which scons` test - name: Build Samples