mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
This experimental Matlab Toolbox for Cantera changes the Matlab interface to the modern Matlab structure and syntaxes for OOP. It replaces the MEX interface with direct function calling from Canter Clib.
Installation guide:
- Install Matlab (any release newer than R2008a).
- Compile Cantera from Source and install in your Conda environment, as directed in this link. https://cantera.org/install/compiling-install.html. 2.5) The experimental Matlab Toolbox does not require a SCons option to install at this moment since it's stand-alone. It also does not require the current Matlab Toolbox to be installed.
- For first time users, launch Matlab, then navigate to [/path/to/cantera/source/code]
using "Browse for Folder". 3.5) Note for Ubuntu users, Matlab must be launched from
the terminal using the following command:
LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libstdc++.so.6' matlab. This is because Matlab does not load the correct GLIBC++ library on start-up and will return an error when loading the Cantera toolbox. - In the Maltab command window, run
addpath(genpath([pwd, '/interfaces/matlab_experimental']))to add search path for the experimental toolbox. - In the Maltab command window, run
addpath(genpath([pwd, '/samples/matlab_experimental']))to add search path for the sample files. - In the Matlab command window, run
cd([pwd, '/interfaces/matlab_experimental/Utility'])to navigate to the Utility folder. - Open the file named 'cantera_root.m', in the second line, edit
output=tooutput=[/path/to/conda/environment], then save the file. This sets the search path for theLoadCanteracommand to find the shared library file for Cantera. - After steps 3 to 7 are complete, make sure search paths to the current Matlab Toolbox and samples files are removed (if it's already installed). Having both the current and experimental version of the toolbox in the search path will lead to conflicts.
- In the Matlab command window, run
savepathto save all search paths. - To start using the experimental toolbox, run
LoadCanteracommand. - To stop using the new Cantera interface, run the following commands:
clear allcleanupUnloadCantera - To switch back to the current matlab toolbox, undo steps 3, 4, 5, 8, and 9. The
command to remove search path in Matlab is
rmpath. - A future updates will add automated installation.