Skip to content

Add support for python version agnostic building (#379) #408

Add support for python version agnostic building (#379)

Add support for python version agnostic building (#379) #408

name: Build and Validation with CPU inference
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build_validation:
runs-on: self-hosted
if: github.repository_owner == 'deepmodeling'
container:
image: ubuntu:20.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: install dependencies
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install -y sudo wget unzip git software-properties-common make cmake g++ mpich openmpi-bin libopenmpi-dev libscalapack-mpi-dev vim git-core
sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -"
sudo add-apt-repository http://dl.openfoam.org/ubuntu
sudo apt-get update
export DEBIAN_FRONTEND=noninteractive
apt-get -y install openfoam7
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b
. ~/miniconda3/etc/profile.d/conda.sh
conda create -n libcantera python=3.8
conda activate libcantera
conda install -c cantera libcantera-devel
conda install pytorch pybind11
conda install --channel https://conda.anaconda.org/zhaofeng-shu33 easydict
git clone https://github.com/deepmodeling/deepflame-dev.git
cd deepflame-dev
- name: build and validation with CPU inference
env:
OMPI_ALLOW_RUN_AS_ROOT: 1
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1
OMPI_MCA_btl_vader_single_copy_mechanism: none
run:
/bin/bash -c " echo $PWD && ls $PWD
&& wget https://github.com/JX278/DeepFlame-flareFGM-table/raw/main/flareFGM_Table_Download.zip
&& unzip flareFGM_Table_Download.zip
&& ls $PWD
&& ls flareFGM_Table_Download
&& cp -r flareFGM_Table_Download/SandiaD/flare.tbl examples/dfLowMachFoam/2DSandiaD_flareFGM/
&& git clone https://github.com/intelligent-algorithm-team/intelligent-combustion.git
&& cp -r intelligent-combustion/DeePCK/Model/HE04_Hydrogen_ESH2_GMS_sub_20221101/ mechanisms/ && source ~/miniconda3/etc/profile.d/conda.sh && conda activate libcantera && source /opt/openfoam7/etc/bashrc
&& . configure.sh --use_pytorch && source ./bashrc && . install.sh
&& cd test && ./Allrun && conda deactivate "
- name: test
run: |
cd test
cmake -B build
cmake --build build
cd build
ctest