diff --git a/CMakeLists.txt b/CMakeLists.txt index 03f050636..e465c1fd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,8 @@ # #****************************************************************************** +cmake_minimum_required(VERSION 3.5) project (MantaFlow) -cmake_minimum_required(VERSION 2.8) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/tools/cmake/") set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) @@ -117,15 +117,11 @@ endif() # translate option into python version string if(NOT PYTHON_VERSION) - set(PYTHON_VER_ID) # use any... + set(PYTHON_VER_ID 3) # use version 3 else() set(PYTHON_VER_ID ${PYTHON_VERSION}) endif() -if(OPENVDB AND NOT TBB) - message(FATAL_ERROR "Cannot activate OPENVDB without TBB") -endif() - MESSAGE(STATUS "") MESSAGE(STATUS "Options - " " -DDEBUG='${DEBUG}' " @@ -387,7 +383,7 @@ if(OPENVDB) else() message("Warning - OpenVDB not found, trying default paths") # might be in path... - list(APPEND F_LIBS Half openvdb tbb) + list(APPEND F_LIBS Imath openvdb tbb) endif() endif() @@ -399,7 +395,7 @@ if(OPENVDB) list(APPEND INCLUDE_PATHS ${HOUDINI_INCLUDE_DIRS}) list(APPEND INCLUDE_PATHS ${HOUDINI_INCLUDE_DIRS}/OpenEXR) list(APPEND F_LIB_PATHS ${HOUDINI_LIBRARY_DIRS}) - list(APPEND F_LIBS "Half.lib") + list(APPEND F_LIBS "Imath.lib") endif() else() # for open exr - should be in the default path, add includes if necessary diff --git a/README.md b/README.md index 323603e66..a81e1d2fb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Mantaflow # Mantaflow is an open-source framework targeted at fluid simulation research in Computer Graphics. -Its parallelized C++ solver core, python scene definition interface and plugin system allow for quickly prototyping and testing new algorithms. +Its parallelized C++ solver core, python scene definition interface and plugin system allow for quickly prototyping and testing new algorithms. In addition, it provides a toolbox of examples for deep learning experiments with fluids. E.g., it contains examples how to build convolutional neural network setups in conjunction with the [tensorflow framework](https://www.tensorflow.org). @@ -11,3 +11,42 @@ For more information on how to install, run and code with Mantaflow, please head ![mantaflow logo](resources/mantaflow-logo1.png) +## Building from source ## + +This installation guide focusses on Ubuntu 24.04 as a distribution. The process will however look very similar with other distributions, the main differences being the package manager and library package names. + +First, install a few pre-requisites: + + sudo apt install pt-get install cmake g++ git python3-dev qt5-qmake libqt5opengl5-dev libtbb-dev libopenvdb-dev + +If you want to enable CUDA support, additionally get the latest toolkit from nVidia, and install the appropriate developer driver (be careful though, these driver tend to wreck X11 - get some installation instructions from the web if this is the first time you install CUDA on Linux) + +Then, change to the directory to install the source code in, and obtain the current sources from the repository (or alternatively download and extract a source code package) + + git clone https://github.com/thunil/mantaflow.git + +To build the project using CMake, set up a build directory and choose the build options (explanation): + + mkdir mantaflow/build + cd mantaflow/build + cmake .. -DGUI=ON -DOPENVDB=ON + make -j8 + +To build Mantaflow with OpenVDB and Threading Building Blocks (TBB) support, you need to disable GUI. There is an issue with duplicated symbols between Qt and Threading Building Blocks (TBB): + + cmake .. -DTBB=ON -DOPENVDB=ON + +That's it! You can now test mantaflow using an example scene + + ./manta ../scenes/simpleplume.py + +## Run tests ## + +Generate reference date and run tests: + + cd tools/tests + MANTA_GEN_TEST_DATA=1 ./runTests.py ../../build/manta + +Run tests: + + ./runTests.py ../../build/manta diff --git a/tensorflow/example2_liquid/tf_train.py b/tensorflow/example2_liquid/tf_train.py index 97e5c4133..46e86e9a7 100644 --- a/tensorflow/example2_liquid/tf_train.py +++ b/tensorflow/example2_liquid/tf_train.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/python3 # ---------------------------------------------------------------------------- # diff --git a/tools/getGitVersion.py b/tools/getGitVersion.py index 311417067..3b727629d 100755 --- a/tools/getGitVersion.py +++ b/tools/getGitVersion.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 import os import shutil import sys diff --git a/tools/tests/quickRunTfTests.py b/tools/tests/quickRunTfTests.py index c3f23d229..51311e94a 100644 --- a/tools/tests/quickRunTfTests.py +++ b/tools/tests/quickRunTfTests.py @@ -3,7 +3,7 @@ # assume it's called from tools/tests os.chdir("../../tensorflow") -pyExe = "python" +pyExe = "python3" mantaExe = "/Users/sinithue/devel/manta/buildMaster/manta" dataPath = "./data" diff --git a/tools/tests/runTests.py b/tools/tests/runTests.py index fc09d21f6..55ffa3a3d 100755 --- a/tools/tests/runTests.py +++ b/tools/tests/runTests.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python3 # # Simple script to run all base tests # The test scripts are named test_XXXX_description.py