Compiling libFluid
Revision as of 08:37, 30 January 2024 by Ville Valtavirta (talk | contribs) (Created page with "libFluid is a library of water properties, which provides steam table data for Kraken. libFluid is used in Kraken by compiling its Python bindings and adding those to the Pyt...")
libFluid is a library of water properties, which provides steam table data for Kraken.
libFluid is used in Kraken by compiling its Python bindings and adding those to the Python path.
- Python bindings include the developer libraries of whichever version of Python you are using
- E.g.
sudo apt install python3.8-dev
- Python bindings require pybind11:
You can install pybind11 to your kraken virtual environment with
workon kraken python -m pip install pybind11
You will also need to add the path of the pybind11 module to your environment e.g. by adding an export command to the postactivate file of your kraken virtual environment (see: Setting up environment variables):
export pybind11_DIR=/home/<username>/Envs/kraken/lib/python3.<version>/site-packages/pybind11
- If CMake on your computer is older than version 3.15, you can try changing version number in cmake_minimum_required(VERSION 3.15). find_package(Python) requires CMake version 3.12 or newer.
- Switch on the building of the Python bindings in the CMakeLists.txt
option(LIBFLUID_PYTHON "Build the Python interface library" ON)
- Configure and build:
mkdir build cd build cmake .. make
- In order to use libFluid with KrakenTools add the path to libFluid/build/bindings/Python folder to your Python path (see Adding folders to the Python path).
- In case this process leads to CMake partially finding the wrong Python version, you can add the following lines inside if(LIBFLUID_PYTHON) for e.g. Python 3.8
find_package(PythonInterp 3.8 REQUIRED) find_package(PythonLibs 3.8 REQUIRED)