Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
52 changes: 29 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@ cd deepflame-dev
### 4. Install dependencies and DeepFlame based on your need
DeepFlame supports three compilation choices: no torch, LibTorch, and PyTorch.
>**Note**: You are encouaged to try all three options, but remember to install the next version in a new terminal to clean previous environment variables.
#### 4.1 No Torch version
If your are using DeepFlame's cvODE solver without DNN model, just install [LibCantera](https://anaconda.org/conda-forge/libcantera-devel) via [conda](https://docs.conda.io/en/latest/miniconda.html#linux-installers).

#### 4.1 PyTorch version (**RECOMMEND**)
PyTorch version aims to support Python-based progamming for DeepFlame. First install [LibCantera](https://anaconda.org/conda-forge/libcantera-devel) via [conda](https://docs.conda.io/en/latest/miniconda.html#linux-installers). Run the following commands to install:
```
conda create -n df-notorch
conda activate df-notorch
conda create -n df-pytorch python=3.8
conda activate df-pytorch
conda install -c cantera libcantera-devel
```
>**Note**: Check your Miniconda3/envs/libcantera directory and make sure the install was successful (lib/ include/ etc. exist).

If the conda env `df-notorch` is activated, install DeepFlame by running:
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge
conda install pybind11

. install.sh --use_pytorch
```
. install.sh
```
If `df-notorch` not activated (or you have a self-complied libcantera), specify the path to your libcantera:
>**Note**: You may come accross an error regarding shared library *libmkl_rt.so.2* when libcantera is installed through cantera channel. If so, go to your conda environment and check the existance of *libmkl_rt.so.2* and *libmkl_rt.so.1*, and then link *libmkl_rt.so.2* to *libmkl_rt.so.1*.
```
. install.sh --libcantera_dir /your/path/to/libcantera/
cd ~/miniconda3/envs/df-pytorch/lib
ln -s libmkl_rt.so.1 libmkl_rt.so.2
```
>**Note**: Check your Miniconda3/envs/libcantera directory and make sure the install was successful (lib/ include/ etc. exist).

#### 4.2 LibTorch version
If you choose to use LibTorch (C++ API for Torch), first create the conda env and install [LibCantera](https://anaconda.org/conda-forge/libcantera-devel):
Expand All @@ -104,24 +104,30 @@ or you can pass your own libtorch path to DeepFlame.
. install.sh --libtorch_dir /path/to/libtorch/
```

#### 4.3 PyTorch version
PyTorch version aims to support Python-based progamming for DeepFlame. Run the following commands to install:

> **Note**: Some compiling issues may happen due to system compatability. Instead of using conda installed Cantera C++ lib and the downloaded Torch C++ lib, try to compile your own Cantera and Torch C++ libraries.



#### 4.3 No Torch version
If your are using DeepFlame's cvODE solver without DNN model, just install [LibCantera](https://anaconda.org/conda-forge/libcantera-devel) via [conda](https://docs.conda.io/en/latest/miniconda.html#linux-installers).
```
conda create -n df-pytorch python=3.8
conda activate df-pytorch
conda create -n df-notorch
conda activate df-notorch
conda install -c cantera libcantera-devel
conda install pytorch torchvision torchaudio cudatoolkit=11.6 -c pytorch -c conda-forge
conda install pybind11
```


If the conda env `df-notorch` is activated, install DeepFlame by running:

. install.sh --use_pytorch
```
>**Note**: You may come accross an error regarding shared library *libmkl_rt.so.2* when libcantera is installed through cantera channel. If so, go to your conda environment and check the existance of *libmkl_rt.so.2* and *libmkl_rt.so.1*, and then link *libmkl_rt.so.2* to *libmkl_rt.so.1*.
. install.sh
```
cd ~/miniconda3/envs/df-pytorch/lib
ln -s libmkl_rt.so.1 libmkl_rt.so.2
If `df-notorch` not activated (or you have a self-complied libcantera), specify the path to your libcantera:
```
. install.sh --libcantera_dir /your/path/to/libcantera/
```

> **Note**: Some compiling issues may happen due to system compatability. Instead of using conda installed Cantera C++ lib and the downloaded Torch C++ lib, try to compile your own Cantera and Torch C++ libraries.

## Running DeepFlame examples
1. Source your OpenFOAM, for example (depends on your OpenFOAM path):
Expand Down
51 changes: 25 additions & 26 deletions docs/source/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,6 @@ DeepFlame supports three compilation choices: no torch, LibTorch, and PyTorch.
.. Note:: You are encouaged to try all three options, but remember to install the next version in a new terminal to clean previous environment variables.


No Torch version
-------------------------

If your are using DeepFlame's CVODE solver without DNN model, just install LibCantera via `conda <https://docs.conda.io/en/latest/miniconda.html#linux-installers>`_.

.. code-block:: bash

conda create -n df-notorch
conda activate df-notorch
conda install -c cantera libcantera-devel

.. Note:: Check your ``Miniconda3/envs/libcantera`` directory and make sure the install was successful (lib/ include/ etc. exist).


If the conda env ``df-notorch`` is activated, install DeepFlame by running:

.. code-block:: bash

. install.sh

If ``df-notorch`` not activated (or you have a self-complied libcantera), specify the path to your libcantera:

.. code-block:: bash

. install.sh --libcantera_dir /your/path/to/libcantera/


PyTorch version (**RECOMMEND**)
-------------------------------
Expand Down Expand Up @@ -107,3 +81,28 @@ Then you can pass your own libtorch path to DeepFlame.

.. Note:: Some compiling issues may happen due to system compatability. Instead of using conda installed Cantera C++ lib and the downloaded Torch C++ lib, try to compile your own Cantera and Torch C++ libraries.

No Torch version
-------------------------

If your are using DeepFlame's CVODE solver without DNN model, just install LibCantera via `conda <https://docs.conda.io/en/latest/miniconda.html#linux-installers>`_.

.. code-block:: bash

conda create -n df-notorch
conda activate df-notorch
conda install -c cantera libcantera-devel

.. Note:: Check your ``Miniconda3/envs/libcantera`` directory and make sure the install was successful (lib/ include/ etc. exist).


If the conda env ``df-notorch`` is activated, install DeepFlame by running:

.. code-block:: bash

. install.sh

If ``df-notorch`` not activated (or you have a self-complied libcantera), specify the path to your libcantera:

.. code-block:: bash

. install.sh --libcantera_dir /your/path/to/libcantera/