Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update recipe conda forge #27

Merged
merged 67 commits into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
1ed76d5
Add manual triggering option for build
bryanwweber Dec 20, 2021
d74097d
Fix version regex in recipe
bryanwweber Dec 20, 2021
ed91d71
Use SSH to clone the MATLAB headers
bryanwweber Dec 21, 2021
266b0d6
Prefer ruamel.yaml dependency
bryanwweber Dec 21, 2021
1ee16de
Fix complaints about unsatisfied dependency on ruamel.yaml
speth Jan 7, 2022
ede2532
Don't fail if there's nothing to delete
speth Jan 7, 2022
243a22d
Whoops the MATLAB headers need the SSH key
bryanwweber Jan 13, 2022
0692cb0
WIP updates to the recipe SKIP CI
bryanwweber Feb 7, 2022
f5c521a
Try these config settings
bryanwweber Feb 8, 2022
f7a9789
Bump Python 3.10 to NumPy 1.21
bryanwweber Feb 8, 2022
3769cf3
Try to work around Accelerate failures on macOS
bryanwweber Feb 11, 2022
3a3074a
Try to fix missing Python on Linux
bryanwweber Feb 11, 2022
89d2089
Update Windows scripts as well
bryanwweber Feb 11, 2022
f743937
Debug SSH failures
bryanwweber Feb 11, 2022
7a74b7b
Fix some syntax errors
bryanwweber Feb 11, 2022
0cb45bd
Move debugging
bryanwweber Feb 11, 2022
586e9e1
Bump python for Matlab builds
bryanwweber Feb 11, 2022
de95369
Try to fix the builds
bryanwweber Feb 11, 2022
77998be
Debugging
bryanwweber Feb 11, 2022
9f8160d
Typo
bryanwweber Feb 11, 2022
985398b
Typo
bryanwweber Feb 11, 2022
3b85e0c
>_<
bryanwweber Feb 11, 2022
60d9861
Remove rpath linking from SCons
bryanwweber Feb 11, 2022
8691f42
More debugging!
bryanwweber Feb 11, 2022
c100175
Fix Windows wheel install
bryanwweber Feb 12, 2022
5223166
Try to fix cloning the matlab headers
bryanwweber Feb 12, 2022
81cf1c6
Figure out why scons is rebuilding
bryanwweber Feb 12, 2022
3e352c3
Try rsync for the matlab headers
bryanwweber Feb 12, 2022
477370b
Update recipe dependencies to avoid rebuild
bryanwweber Feb 12, 2022
bcb1615
Fix libcantera tests
bryanwweber Feb 12, 2022
ad3c8c0
Bit more debugging
bryanwweber Feb 13, 2022
5b64b9a
Don't run tests on Python 3.10
bryanwweber Feb 13, 2022
08b6444
Fix the matlab recipe yaml
bryanwweber Feb 13, 2022
5b40b5e
Split the library build
bryanwweber Feb 13, 2022
b423aab
Fix Windows rsync
bryanwweber Feb 13, 2022
0b85be5
Fix Matlab Windows/macOS builds
bryanwweber Feb 13, 2022
f1ef717
Fix libcantera/Python builds
bryanwweber Feb 13, 2022
726c261
Fixes for Windows
bryanwweber Feb 13, 2022
f09b1e2
Fixes for Matlab
bryanwweber Feb 13, 2022
03a5f2a
Fixes for missing deps
bryanwweber Feb 13, 2022
48cea3e
Fixes and fixes!
bryanwweber Feb 13, 2022
c83f0b2
Try to remove some dependencies
bryanwweber Feb 13, 2022
5223639
Remove Windows rename_shared_libs option
bryanwweber Feb 13, 2022
33b219e
Use Python to set MW_HEADERS on Win
bryanwweber Feb 13, 2022
35c1575
Linux/macOS building updates
bryanwweber Feb 13, 2022
c4cde8f
Try again to fix Matlab Windows rsync
bryanwweber Feb 13, 2022
d35632d
Another try at Windows
bryanwweber Feb 13, 2022
c562e68
Another rsync try
bryanwweber Feb 13, 2022
40ae6a9
I'm just guessing at this point
bryanwweber Feb 13, 2022
eae72d3
A separate rsync for Windows
bryanwweber Feb 13, 2022
12bfe06
Another rsync try
bryanwweber Feb 13, 2022
faa8175
Debug
bryanwweber Feb 13, 2022
a2362e7
Debug!
bryanwweber Feb 13, 2022
9081d04
Need a bindir
bryanwweber Feb 13, 2022
2c2dc5c
Single quotes?
bryanwweber Feb 13, 2022
c92f33b
Only run the POSIX rsync on POSIX
bryanwweber Feb 13, 2022
c311854
Gotta use a different name for the rsync dir
bryanwweber Feb 13, 2022
511b99a
Move rpath rewrite above interface build
bryanwweber Feb 13, 2022
bbdda66
Try Windows 2022 runner
bryanwweber Feb 13, 2022
ba690f2
Switch to MSVC 14.2
bryanwweber Feb 13, 2022
d6afa77
Build the interface first
bryanwweber Feb 13, 2022
b57872f
Cut alpha and beta off the PKG_VERSION
bryanwweber Feb 14, 2022
f76c87e
Also cut rc from version
bryanwweber Feb 15, 2022
edac54c
Try modern compilers settting on Windows
bryanwweber Feb 15, 2022
4e6bac6
Try different dependency versions
bryanwweber Feb 15, 2022
148e974
Remove `path` source
bryanwweber Feb 16, 2022
d8207cb
Add input to workflow dispatch for uploading [skip ci]
bryanwweber Feb 16, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .ci_support/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
numpy:
- '1.16'
- '1.16'
- '1.16'
- '1.19'
- '1.21'
zip_keys:
- - python
- numpy
Expand Down
58 changes: 49 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,25 @@ on:
# Build when a pull request targets main
branches:
- main
workflow_dispatch:
inputs:
upload:
description: Attempt to upload to Anaconda
required: true
default: "false"

env:
MW_HEADERS_DIR: ${{ github.workspace }}/../mw_headers
MACOSX_DEPLOYMENT_TARGET: "10.9"

jobs:
build-x64:
name: ${{ matrix.os }}-x64 with MATLAB=${{ matrix.MATLAB }}
build:
name: ${{ matrix.os }} with MATLAB=${{ matrix.MATLAB }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
MATLAB: [0, 1]
os: [windows-2016, ubuntu-latest, macos-latest]
os: [windows-2019, ubuntu-latest, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -63,12 +70,45 @@ jobs:
shell: bash -l {0}
run: conda build ./cantera -m ./.ci_support/conda_build_config.yaml
if: matrix.MATLAB == 0
- name: Get the MATLAB headers
# The known_hosts key is generated with `ssh-keygen -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 cloning MATLAB
if: matrix.MATLAB == 1
run: git clone https://cantera:${GIT_PW}@cantera.org/mw_headers.git "${MW_HEADERS_DIR}"
env:
GIT_PW: ${{ secrets.GIT_PW }}
shell: bash -l {0}
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.CTDEPLOY_SSH_KEY }}
known_hosts: ${{ secrets.CTDEPLOY_KNOWN_HOSTS }}
# If the version of rsync is changed, the directories below have to be updated
- name: Install rsync on Windows
if: matrix.MATLAB == 1 && runner.os == 'Windows'
run: choco install rsync --version 6.2.4
# This seems like overkill, but rsync on Windows requires a POSIX-style path
- name: Display the path
run: |
import os
from pathlib import Path, PurePosixPath
mw_headers_dir = Path(os.environ["MW_HEADERS_DIR"]).resolve()
mw_headers_dir = PurePosixPath(
"/cygdrive",
mw_headers_dir.drive[0],
PurePosixPath(*mw_headers_dir.parts[1:])
)
with Path(os.environ["GITHUB_ENV"]).open(mode="a") as gh_env:
gh_env.write(f"CYG_MW_HEADERS_DIR={mw_headers_dir}")
shell: python
if: runner.os == 'Windows' && matrix.MATLAB == 1
- name: Get the MATLAB headers
if: matrix.MATLAB == 1 && runner.os == 'Windows'
run: |
rsync -azvP -e `
'C:\ProgramData\chocolatey\lib\rsync\tools\cwrsync_6.2.4_x64_free\bin\ssh.exe -i C:\Users\runneradmin\.ssh\id_rsa -o UserKnownHostsFile=C:\Users\runneradmin\.ssh\known_hosts' `
ctdeploy@cantera.org:. $Env:CYG_MW_HEADERS_DIR
shell: powershell
- name: Get the MATLAB headers
if: matrix.MATLAB == 1 && runner.os != 'Windows'
run: "rsync -azvP ctdeploy@cantera.org:. ${MW_HEADERS_DIR}"
shell: bash
- name: Build the MATLAB recipe
shell: bash -l {0}
run: conda build ./cantera-matlab -m ./.ci_support/conda_build_config.yaml
Expand All @@ -77,4 +117,4 @@ jobs:
run: |
anaconda --token ${{ secrets.ANACONDA_TOKEN }} upload --force --label dev $CONDA/conda-bld/*/*cantera*.tar.bz2
shell: bash -l {0}
if: github.event_name == 'push' && github.event.ref == 'refs/heads/main'
if: github.event.inputs.upload == 'true'
14 changes: 1 addition & 13 deletions cantera-matlab/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,8 @@ echo ****************************
echo MATLAB BUILD STARTED
echo ****************************

REM IF %ARCH% EQU 64 (
REM CALL "%VS140COMNTOOLS%"\..\..\VC\bin\amd64\vcvars64.bat
REM ) ELSE (
REM CALL "%VS140COMNTOOLS%"\..\..\VC\bin\vcvars32.bat
REM )

:: Have to use CALL to prevent the script from exiting after calling SCons
CALL scons clean
IF ERRORLEVEL 1 EXIT 1

DEL /F cantera.conf

COPY "%RECIPE_DIR%\..\.ci_support\cantera_base.conf" cantera.conf
ECHO msvc_version='14.1' >> cantera.conf
ECHO msvc_version='14.2' >> cantera.conf

SET "STAGE_DIR=stage"
ECHO stage_dir="%STAGE_DIR%" >> cantera.conf
Expand Down
28 changes: 19 additions & 9 deletions cantera-matlab/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@ echo "****************************"
echo "MATLAB BUILD STARTED"
echo "****************************"

if [[ "$DIRTY" != "1" ]]; then
scons clean
fi

rm -f cantera.conf

cp "${RECIPE_DIR}/../.ci_support/cantera_base.conf" cantera.conf

echo "prefix = ''" >> cantera.conf
Expand All @@ -22,19 +16,35 @@ echo "stage_dir = '${STAGE_DIR}'" >> cantera.conf
if [[ "${OSX_ARCH}" == "" ]]; then
echo "CC = '${CC}'" >> cantera.conf
echo "CXX = '${CXX}'" >> cantera.conf
echo "cc_flags = '${CFLAGS}'" >> cantera.conf
echo "cxx_flags = '${CPPFLAGS}'" >> cantera.conf
echo "optimize_flags = ''" >> cantera.conf
echo "debug = False" >> cantera.conf
echo "use_rpath_linkage = False" >> cantera.conf
echo "no_debug_linker_flags = '${LDFLAGS}'" >> cantera.conf
echo "renamed_shared_libraries = False" >> cantera.conf
echo "VERBOSE = True" >> cantera.conf
else
echo "CC = '${CLANG}'" >> cantera.conf
echo "CXX = '${CLANGXX}'" >> cantera.conf
echo "cc_flags = '-isysroot ${CONDA_BUILD_SYSROOT} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}'" >> cantera.conf
echo "cc_flags = '-isysroot ${CONDA_BUILD_SYSROOT} ${CFLAGS}'" >> cantera.conf
echo "cxx_flags = '${CPPFLAGS}'" >> cantera.conf
echo "optimize_flags = ''" >> cantera.conf
echo "debug = False" >> cantera.conf
echo "no_debug_linker_flags = '${LDFLAGS} -isysroot ${CONDA_BUILD_SYSROOT}'" >> cantera.conf
echo "env_vars = 'LD'" >> cantera.conf
echo "VERBOSE = True" >> cantera.conf
echo "renamed_shared_libraries = False" >> cantera.conf
echo "use_rpath_linkage = False" >> cantera.conf
fi

echo "matlab_toolbox = 'y'" >> cantera.conf
echo "matlab_path = '${MW_HEADERS_DIR}'" >> cantera.conf

set -xe

scons build -j${CPU_COUNT}
scons install
${BUILD_PREFIX}/bin/python `which scons` build -j${CPU_COUNT}
${BUILD_PREFIX}/bin/python `which scons` install

# "Install" just the Matlab interface. This method should
# prevent this package from clobbering any existing
Expand Down
20 changes: 9 additions & 11 deletions cantera-matlab/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
{% set data = load_file_regex(load_file='SConstruct', regex_pattern="env\\['cantera_version'\\] = .([\d.abrc]+).") %}
{% set data = load_file_regex(load_file='SConstruct', regex_pattern="env\\[.cantera_version.\\] = .([\d.abrc]+).") %}

package:
name: cantera-matlab
version: {{ data.group(1) }}

source:
git_url: https://github.com/Cantera/cantera.git
git_tag: main
git_tag: add-package-workflow

requirements:
build:
- {{ compiler('c') }} # [not win]
- {{ compiler('cxx') }} # [not win]
- vs2017_win-64 ==19.15.* # [win64]
- vs2017_win-32 ==19.15.* # [win32]
- scons >=3.1
- python >=3.5
- numpy
- {{ compiler('c') }}
- {{ compiler('cxx') }}
- scons >=4.1
host:
- libboost
run:
- vs2015_runtime # [win]
- pywin32 # [win]

build:
number: 0
include_recipe: True
script_env:
- MW_HEADERS_DIR
ignore_run_exports_from:
# Only the header version of this library is used
- libboost

about:
home: https://cantera.org
Expand Down
16 changes: 2 additions & 14 deletions cantera/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,15 @@ echo ****************************
echo BUILD STARTED
echo ****************************

REM IF %ARCH% EQU 64 (
REM CALL "%VS141COMNTOOLS%"\..\..\VC\bin\amd64\vcvars64.bat
REM ) ELSE (
REM CALL "%VS150COMNTOOLS%"\..\..\VC\bin\vcvars32.bat
REM )

:: Have to use CALL to prevent the script from exiting after calling SCons
CALL scons clean
IF ERRORLEVEL 1 EXIT 1

DEL /F cantera.conf

COPY "%RECIPE_DIR%\..\.ci_support\cantera_base.conf" cantera.conf
ECHO msvc_version='14.1' >> cantera.conf
ECHO msvc_version='14.2' >> cantera.conf

:: Set the number of CPUs to use in building
SET /A CPU_USE=%CPU_COUNT% / 2
IF %CPU_USE% EQU 0 SET CPU_USE=1

SET "ESC_PREFIX=%PREFIX:\=/%"
ECHO prefix="%ESC_PREFIX%" >> cantera.conf
ECHO prefix="%ESC_PREFIX%/Library" >> cantera.conf
ECHO boost_inc_dir="%ESC_PREFIX%/Library/include" >> cantera.conf

CALL scons build -j%CPU_USE%
Expand Down
42 changes: 26 additions & 16 deletions cantera/build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
set +x

echo "****************************"
echo "LIBRARY BUILD STARTED"
echo "****************************"

if [[ "$DIRTY" != "1" ]]; then
scons clean
fi

rm -f cantera.conf
echo "******************"
echo "MAIN BUILD STARTED"
echo "******************"

cp "${RECIPE_DIR}/../.ci_support/cantera_base.conf" cantera.conf

Expand All @@ -20,18 +13,35 @@ if [[ "${OSX_ARCH}" == "" ]]; then
echo "CXX = '${CXX}'" >> cantera.conf
echo "blas_lapack_libs = 'mkl_rt,dl'" >> cantera.conf
echo "blas_lapack_dir = '${PREFIX}/lib'" >> cantera.conf
echo "cc_flags = '${CFLAGS}'" >> cantera.conf
echo "cxx_flags = '${CPPFLAGS}'" >> cantera.conf
echo "optimize_flags = ''" >> cantera.conf
echo "debug = False" >> cantera.conf
echo "use_rpath_linkage = False" >> cantera.conf
echo "no_debug_linker_flags = '${LDFLAGS}'" >> cantera.conf
echo "renamed_shared_libraries = False" >> cantera.conf
echo "VERBOSE = True" >> cantera.conf
else
echo "CC = '${CLANG}'" >> cantera.conf
echo "CXX = '${CLANGXX}'" >> cantera.conf
echo "cc_flags = '-isysroot ${CONDA_BUILD_SYSROOT} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}'" >> cantera.conf
echo "blas_lapack_libs = 'openblas'" >> cantera.conf
echo "blas_lapack_dir = '${PREFIX}/lib'" >> cantera.conf
echo "cc_flags = '-isysroot ${CONDA_BUILD_SYSROOT} ${CFLAGS}'" >> cantera.conf
echo "cxx_flags = '${CPPFLAGS}'" >> cantera.conf
echo "optimize_flags = ''" >> cantera.conf
echo "debug = False" >> cantera.conf
echo "no_debug_linker_flags = '${LDFLAGS} -isysroot ${CONDA_BUILD_SYSROOT}'" >> cantera.conf
echo "VERBOSE = True" >> cantera.conf
echo "renamed_shared_libraries = False" >> cantera.conf
echo "use_rpath_linkage = False" >> cantera.conf
fi

set -xe

scons build -j${CPU_COUNT}

${BUILD_PREFIX}/bin/python `which scons` build -j${CPU_COUNT}
cp cantera.conf cantera.conf.pre-py
set +xe

echo "****************************"
echo "BUILD COMPLETED SUCCESSFULLY"
echo "****************************"
echo "********************"
echo "MAIN BUILD COMPLETED"
echo "********************"
5 changes: 0 additions & 5 deletions cantera/build_devel.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ ECHO ************************
ECHO DEVEL BUILD STARTED
ECHO ************************

DEL /F cantera.conf

COPY "%RECIPE_DIR%\..\.ci_support\cantera_base.conf" cantera.conf
ECHO msvc_version='14.1' >> cantera.conf

CALL scons install

ECHO ************************
Expand Down
31 changes: 7 additions & 24 deletions cantera/build_devel.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
echo "****************************"
echo "DEVEL LIBRARY INSTALL STARTED"
echo "****************************"
echo "***************************"
echo "DEVEL LIBRARY BUILD STARTED"
echo "***************************"

set -e
rm -f cantera.conf

cp "${RECIPE_DIR}/../.ci_support/cantera_base.conf" cantera.conf

echo "prefix = '${PREFIX}'" >> cantera.conf
echo "boost_inc_dir = '${PREFIX}/include'" >> cantera.conf

if [[ "${OSX_ARCH}" == "" ]]; then
echo "CC = '${CC}'" >> cantera.conf
echo "CXX = '${CXX}'" >> cantera.conf
echo "blas_lapack_libs = 'mkl_rt,dl'" >> cantera.conf
echo "blas_lapack_dir = '${PREFIX}/lib'" >> cantera.conf
else
echo "CC = '${CLANG}'" >> cantera.conf
echo "CXX = '${CLANGXX}'" >> cantera.conf
echo "cc_flags = '-isysroot ${CONDA_BUILD_SYSROOT} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}'" >> cantera.conf
fi

scons install
${BUILD_PREFIX}/bin/python `which scons` install
set +e

echo "****************************"
echo "DEVEL LIBRARY INSTALL COMPLETED SUCCESSFULLY"
echo "****************************"
echo "*****************************"
echo "DEVEL LIBRARY BUILD COMPLETED"
echo "*****************************"
7 changes: 7 additions & 0 deletions cantera/build_lib.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
call %RECIPE_DIR%/build_devel.bat
echo "****************************"
echo "DELETING files from devel except shared libraries"
echo "****************************"

rd /s /q %PREFIX%\Library\share
rd /s /q %PREFIX%\Library\include\cantera
18 changes: 18 additions & 0 deletions cantera/build_lib.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
source $RECIPE_DIR/build_devel.sh
echo "****************************"
echo "DELETING files from devel except shared libraries"
echo "****************************"

rm -rf $PREFIX/share
rm -rf $PREFIX/include/cantera
rm -rf $PREFIX/bin
rm -rf $PREFIX/lib/pkg-config
rm -rf $PREFIX/lib/libcantera.a

if [[ "$target_platform" == osx-* ]]; then
${OTOOL:-otool} -L $PREFIX/lib/libcantera.dylib
fi

echo "************************"
echo "DELETING files COMPLETED"
echo "************************"
3 changes: 1 addition & 2 deletions cantera/build_py.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ echo ****************************
echo PYTHON %PYTHON% BUILD COMPLETED SUCCESSFULLY
echo ****************************

cd interfaces/cython
"%PYTHON%" setup.py build --build-lib=../../build/python install
"%PYTHON%" -m pip install --no-deps --find-links=build\python\dist\ cantera
IF ERRORLEVEL 1 EXIT 1
Loading